I can't select options in dropdown list in FireFox 48 using marionette driver and selenium 3

五迷三道 提交于 2019-12-09 03:31:43

问题


I tried the new geckodriver with marionette turned on for FF48 and selenium 3 but the test can't select the option in the drop down list for any element. My test works fine in FF45 and all other browsers. Only marionette driver does not select the option in the drop down list

new Select(driver.findElement(By.Id("topic"))).selectByVisibleText(item);

The code works fine until I started using gecko driver with marionette.

Below is the code I am using to setup geckodriver with marionette.

       System.setProperty("webdriver.gecko.driver",  System.getProperty("user.dir")+"\\geckodriver.exe");

        ProfilesIni profile = new ProfilesIni();

        FirefoxProfile myprofile = profile.getProfile("DefaultProfile");
        myprofile.setPreference("network.proxy.type", ProxyType.AUTODETECT.ordinal());

        DesiredCapabilities dc=DesiredCapabilities.firefox();
        dc.setCapability(FirefoxDriver.PROFILE, myprofile);
        dc.setCapability("marionette", true);
        driver =  new FirefoxDriver(dc);

The test does not throw any exception when it tries to select an option from the element.

new Select(driver.findElement(By.Id("topic"))).selectByVisibleText(item);

After researching this issue, it turned out that FF48 has a bug and it is fixed in firefox ngithly 51. Is there any workaround to make it work in FF48 while I wait for the FF51 release?


回答1:


I am surprised nobody experienced this issue. I guess I might have posted the question in the wrong place because I did not get any response. Anyway, this turned out to be a bug in Firefox 48. It is fixed in Firefox 51 (Nightly build).

If you are using Selenium 3 beta and Firefox 48 with geckodriver, you won't be able to interact with any drop down list using the webdriver. The issue was fixed in Firefox 51.




回答2:


I did face the exact same issue, The work around which i did is the answer marked for this question.

Selenium : Firefox Driver, Selecting an item from a dropdown using SelectElement in c# not working correctly



来源:https://stackoverflow.com/questions/39026616/i-cant-select-options-in-dropdown-list-in-firefox-48-using-marionette-driver-an

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!