【问题标题】:Unable to identify a static dropdown无法识别静态下拉菜单
【发布时间】:2017-01-12 19:58:00
【问题描述】:

我正在尝试自动化无法识别静态下拉列表的网页。

<select name = "homeURL" tabIndex = "4" class = "storeId" >..</select>

我尝试使用下面提到的代码使用 Select 类来识别它

Select dropdown = new Select(driver.findElement(By.name("homeURL"))); dropdown.selectByIndex(2);

我收到以下错误:

Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to find element with name == homeURL (WARNING: The server did not provide any stacktrace information)

【问题讨论】:

标签: selenium selenium-webdriver


【解决方案1】:

这可能是不同数量的不同因素。例如 web 驱动程序、iframe,甚至页面渲染需要多长时间。请考虑以下链接:

网络驱动程序:Selenium InternetExplorerDriver unable to find element that is clearly there

内嵌框架: Selenium WebDriver: unable to locate element inside iframe using TinyMCE editor

页面渲染问题: Selenium Unable to Find Element

请考虑查看您的网络驱动程序、硒和已安装浏览器的版本。

【讨论】:

  • 谢谢。这是页面渲染问题。
猜你喜欢
  • 2019-08-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-31
  • 2013-12-03
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多