我嘗試了新geckodriver與木偶開啓FF48和硒3,但測試不能選擇在下拉列表中選擇任何元素。我的測試在FF45和所有其他瀏覽器中運行良好。只有木偶司機沒有選擇在Firefox 48用提線木偶的驅動程序和硒我不能選擇在下拉列表中選擇3
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有缺陷,它是固定在Firefox ngithly 51 有任何解決方法,使其在FF48工作,而我等待FF51釋放?
的Firefox 51將僅在2017年 –
發佈嘗試新的提線木偶的驅動程序和Firefox 48。很高興我不是唯一的一個,當我遇到了這個問題今天。 – PCalouche
我很驚訝沒有很多人都面臨這個問題。我仍在尋找解決方案。 – SOAlgorithm