我試圖運行parllel JUnit測試轉換爲java.lang.String中,做了網格設置有3個節點,在執行測試有一個例外WedDriverException:java.util.HashMap中不能初始化時RemoteWebDriver
org.openqa.selenium.firefox.NotConnectedException:無法在45000 ms後在端口7055上連接到主機127.0.0.1。
我的理解是與Firefox和硒版本沒有關係,我認爲這個異常是由於firefox發佈的一個webdriver實例,它沒有在45000毫秒內發佈,這會引發其他webdriver超時異常例如試圖在同一時間上的端口7055連接(蟎是因爲系統緩慢)
所以我相信使用下面的代碼
DesiredCapabilities capablities = new DesiredCapabilities();
FirefoxBinary firefoxBinary = new FirefoxBinary();
firefoxBinary.setTimeout(120000);
FirefoxProfile profile = new FirefoxProfile();
profile.setAcceptUntrustedCertificates(true);
profile.setAssumeUntrustedCertificateIssuer(false);
capablities = DesiredCapabilities.firefox();
capablities.setCapability("firefox_binary", firefoxBinary);
capablities.setCapability("firefox_profile", profile);
driver = new RemoteWebDriver(new URL("http://" + parameters.getRemoteUrl() + ":4444/wd/hub"), capablities);
增加在這種情況下超時,但再有一個例外WedDriverException :java.ut il.HashMap不能被轉換爲java.lang.String
爲firefoxbinary
capablities.setCapability("firefox_binary", firefoxBinary);
否則RemoteWebdriver實例被創建的設置功能時,不會出現任何問題時拋出此異常
請讓我知道如果我是正確的增加關於7055端口的鎖定超時,如果這麼好心地幫助我解決在Firefox中的web驅動程序異常二進制
你認爲這個問題可以被視爲您已鏈接的一個項目重複?萬一,它應該被標記爲這樣。 –
它是相關的,不是重複的。 –