【问题标题】:I can't select options in dropdown list in FireFox 48 using marionette driver and selenium 3我无法使用 Marionette 驱动程序和 selenium 3 在 FireFox 48 的下拉列表中选择选项
【发布时间】:2016-12-25 21:09:09
【问题描述】:

我尝试了为 FF48 和 selenium 3 打开木偶的新 geckodriver,但测试无法在下拉列表中为任何元素选择选项。我的测试在 FF45 和所有其他浏览器中运行良好。只有木偶驱动不选择下拉列表中的选项

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

在我开始将壁虎驱动程序与木偶一起使用之前,代码运行良好。

下面是我用来设置 geckodriver 和木偶的代码。

       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);

测试在尝试从元素中选择选项时不会抛出任何异常。

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

研究了这个问题,发现FF48有一个bug,在firefox ngithly 51中修复了。 在我等待 FF51 发布期间,是否有任何解决方法可以让它在 FF48 中运行?

【问题讨论】:

    标签: firefox selenium-webdriver webdriver selenium-firefoxdriver geckodriver


    【解决方案1】:

    我很惊讶没有人遇到过这个问题。我想我可能在错误的地方发布了这个问题,因为我没有得到任何回复。 无论如何,这被证明是 Firefox 48 中的一个错误。它已在 Firefox 51 (Nightly build) 中修复。

    如果您将 Selenium 3 beta 和 Firefox 48 与 geckodriver 一起使用,您将无法使用 webdriver 与任何下拉列表进行交互。该问题已在 Firefox 51 中得到修复。

    【讨论】:

    • Firefox 51 将仅在 2017 年发布。
    • 我今天在试用新的 marionette 驱动程序和 firefox 48 时遇到了这个问题。很高兴我不是唯一一个。
    • 我很惊讶没有很多人面临这个问题。我仍在寻找解决方案。
    【解决方案2】:

    我确实遇到了完全相同的问题,我所做的工作就是为这个问题标记的答案。

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

    【讨论】:

      猜你喜欢
      • 2016-11-10
      • 1970-01-01
      • 1970-01-01
      • 2018-01-18
      • 2015-03-13
      • 2022-12-15
      • 1970-01-01
      • 1970-01-01
      • 2013-05-03
      相关资源
      最近更新 更多