Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Chrome WebDriver不从下拉列表中选择_Java_Selenium_Selenium Webdriver_Selenium Chromedriver - Fatal编程技术网

Java Chrome WebDriver不从下拉列表中选择

Java Chrome WebDriver不从下拉列表中选择,java,selenium,selenium-webdriver,selenium-chromedriver,Java,Selenium,Selenium Webdriver,Selenium Chromedriver,我在Firefox上有以下代码,但在Chrome上没有 Select selectSize = new Select(dropDownListBox); selectSize.selectByIndex(1); 我尝试使用显式等待和Thread.sleep,但无法使其工作 当我调试代码时,我发现它实际上获取了值,但没有更新UI 当我使用System.out.printlnselectSize.getFirstSelectedOption.getText时;它实际上是打印尺寸的 我也试着在iP

我在Firefox上有以下代码,但在Chrome上没有

Select selectSize = new Select(dropDownListBox);
selectSize.selectByIndex(1); 
我尝试使用显式等待和Thread.sleep,但无法使其工作

当我调试代码时,我发现它实际上获取了值,但没有更新UI

当我使用System.out.printlnselectSize.getFirstSelectedOption.getText时;它实际上是打印尺寸的

我也试着在iPhone和iPad模拟器上运行这段代码,它在那里也起了作用。我觉得这只适用于Chrome驱动程序

以前有没有人遇到过这个问题,或者你有什么建议

更新:我正在使用Selenium 2.41.0和Chrome WebDriver 2.9


提前感谢

有错误吗?什么版本的硒?ChromeDriver的哪个版本?@Arran Selenium 2.41.0,Chrome WebDriver 2.9,它不会抛出任何错误。司机认为这是选择。