我有一个使用WebDriver
2.53.1的测试套件,现在我尝试升级到3.5.2。
我添加了以下代码:
System.setProperty("webdriver.firefox.bin", C:\\Portable\\firefox.exe);
System.setProperty("webdriver.gecko.driver", "C:\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.navigate().to(url);
当我执行测试时,我看到以下内容:
1503575087525 geckodriver INFO geckodriver 0.18.0 1503575087525 geckodriver INFO在127.0.0.1:20041上收听 1503575088303 geckodriver :: marionette INFO启动浏览器 C:/Portable/firefox.exe with args [" -marionette"]
我在给定端口上获得此JSON输出:
{"value":{"error":"unknown command","message":"GET / did not match a known command","stacktrace":"stack backtrace:\n 0: 0x4bb74f - <no info>\n 1: 0x4bbea9 - <no info>\n 2: 0x43ce8d - <no info>\n 3: 0x4319fd - <no info>\n 4: 0x425ca5 - <no info>\n 5: 0x407eba - <no info>\n 6: 0x6d95b9 - <no info>\n 7: 0x417655 - <no info>\n 8: 0x6d38b3 - <no info>\n 9: 0x7ffdddfa13d2 - BaseThreadInitThunk"}}
它会在浏览器中打开欢迎页面,并且不会转到给定的URL。