0

使用selenium 3 beta 2時,我無法在Firefox瀏覽器中選擇任何下拉菜單。我越來越:無法在Firefox瀏覽器中選擇硒版本3.0.0-beta2的下拉菜單

element not visible exception

這裏有一些更多的細節:

Browser Page

StackError:

org.openqa.selenium.ElementNotVisibleException: Element is not visible (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 15 milliseconds Build info: version: 'unknown', revision: '2aa21c1', time: '2016-08-02 14:59:43 -0700' System info: host: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_91' Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, appBuildId=20160817112116, version=, platform=XP, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, browserVersion=48.0.1, platformVersion=10.0, browserName=Firefox, takesScreenshot=true, takesElementScreenshot=true, platformName=Windows_NT, device=desktop}] Session ID: 1bdaa5b9-a2b8-47aa-81b8-5516c39462a7 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:683) at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:319) at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:85) at org.openqa.selenium.support.ui.Select.setSelected(Select.java:324) at org.openqa.selenium.support.ui.Select.selectByValue(Select.java:201) at DriverTest.test(DriverTest.java:45)

雖然Chrome瀏覽器,這是完全正常工作。

我覺得Firefox瀏覽器有一些問題。目前我可以看到,Firefox可以更新到48.0.2。我們有沒有解決這個問題呢?

+0

你能分享你的代碼,你試過,你應該使用WebDriverWait? –

+0

問題出在Firefox瀏覽器。對於鉻它工作得很好。 new Select(driver.findElement(By.name(「country」)))。selectByVisibleText(「India」); – Ankit

+0

按照這個答案http://stackoverflow.com/questions/39224373/unable-to-select-dropdown-option-after-updating-jar-files-to-selenium-3-0/39228389#39228389 ..希望它可以幫助.. –

回答

0

,如果你不使用it.With WebDriverWait的代碼應該像

Select sel = new Select(new WebDriverWait(driver,30).until(ExpectedConditions.visibilityOfElementLocated(By.name("country")))); 
    sel.selectByVisibleText("Albania"); 
+0

new Select(driver.findElement(By.name(「country」)))。selectByVisibleText(「India」); \ n我上面的代碼適用於Chrome,但不適用於Firefox ......我認爲這是Firefox和硒3測試版2的問題 – Ankit

相關問題