Selenium webdriver 如何为此查找Xpath?
还有没有。。如何识别xpathSelenium webdriver 如何为此查找Xpath?,selenium-webdriver,Selenium Webdriver,还有没有。。如何识别xpath Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to find element with link text == More Details (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 421 millisecond
Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to find element with link text == More Details (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 421 milliseconds
通过给出xpath尝试了这种方法。。不走运。。org.openqa.selenium.InvalidSelectorException:xpath表达式“//*[@OnClick='selectTab(2,11,'MainTabControl','Panel','lblTitle','paneltitle','hfldSelectedTab')”]”无法计算或不会生成WebElement(警告:服务器未提供任何stacktrace信息)
命令持续时间或超时:157毫秒尝试使用以下xpath:
//tr[@id='MainTabControl2']//td[@class='TabCaption']
或
//td[@class='TabCaption']
编辑:
如果存在相同的id和类,则可以使用元素的text()
进行选择,如下所示:
//td[contains(text(),'**更多详细信息**')]
与更多详细信息一样,它有8个选项,所有选项都具有相同的id和类值。。它会工作吗?org.openqa.selenium.NoSuchElementException:无法找到xpath=//tr[@id='MainTabControl2']/td[@class='TabCaption'](警告:服务器未提供任何stacktrace信息)的元素命令持续时间或超时:380milliseconds@ChanGan请检查我编辑的答案。另外,请检查您刚才发布的xpath//td[contains(text(),'More Details')]是否正常工作
Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to find element with link text == More Details (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 421 milliseconds
//*[@OnClick='selectTab(2, 11, 'MainTabControl', 'Panel', 'lblTitle', 'paneltitle', 'hfldSelectedTab')']