无法识别静态下拉列表

时间:2017-01-12 19:58:01

标签: selenium selenium-webdriver

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

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

我尝试使用Select class

使用下面提到的代码来识别它

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)

1 个答案:

答案 0 :(得分:0)

可能是各种不同的因素。例如Web驱动程序,iframe,甚至页面呈现所需的时间。请考虑以下链接:

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

I帧: Selenium WebDriver: unable to locate element inside iframe using TinyMCE editor

页面呈现问题: Selenium Unable to Find Element

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

相关问题