0
votes

I'm not able to select any dropdown in firefox browser when using selenium 3 beta 2. I'm getting :

element not visible exception

Here are some more details:

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)

While for chrome browser, it is perfectly working fine.

I think there is some issue with firefox browser. Currently i can see that firefox can be updated to 48.0.2. Do we have a fix for this yet?

1
Could you share your code which have you tried??Saurabh Gaur
The problem is with Firefox browser. For chrome it's working fine. new Select(driver.findElement(By.name("country"))).selectByVisibleText("India");Ankit
Follow this answer stackoverflow.com/questions/39224373/….. hope it helps..Saurabh Gaur
@SaurabhGaur: Thanks Saurabh for the redirection to alternate answer.Ankit

1 Answers

0
votes

You should use WebDriverWait if you are not using it.With WebDriverWait the code should be like

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