【发布时间】:2019-09-20 16:06:57
【问题描述】:
我点击图片按钮,但出现如下错误:
org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element
HTML:
<img src="../RupeeWeb/images/entry/trade_jm.png" style="width: 25px; margin-bottom: -1px;"/>
我的代码是:
driver.findElement(By.xpath("//*[@id=\"1556776066373-0-uiGrid-002G-cell\"]/a[1]/img")).click();
错误:
Exception in thread "main" org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element:
【问题讨论】:
-
请使用适当的 HTML 更新您的问题。
标签: selenium selenium-webdriver selenium-chromedriver nosuchelementexception