I've been trying to click on an image on web page. Xpath for this image is:
//*[@id='gridview-1018']/table/tbody/tr[3]/td[7]/div/a/img
HTML code is:
<td class=" x-grid-cell x-grid-cell-gridcolumn-1016 ">`<div class="x-grid-cell-inner " style="text-align: center; ;">`<a href="http://demo.webshopondemand.com/Shop/AbzorbDevelopment/Store/" target="_blank">`<img src="/admin/templates/images/house.png" style="background-color: transparent;"/>`
Tried all the below methods here, but got the same error msg "Unable to locate the element:
driver.findElement(By.xpath(".//*[@id='gridview-1018']/table/tbody/tr[3]/td[7]/div/a/img")).click();WebElement temp = driver.findElement(By.xpath("//img[contains(@src,'/admin/templates/images/house.png')]")); temp.click();
WebDriverWaitwait = newWebDriverWait(driver, 60); wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("x-grid-cell-inner.a.img")));driver.findElement(By.cssSelector("x-grid-cell-`inner.a.img")).click()
4.driver.findElement(By.cssSelector`("a[href='AbzorbDevelopment']")).click();
Thanks for the help