我正在使用Firefox 47.0.1
驱动Marionette
程序geckodriver-v0.8.0-win32
。但是我得到了无法访问的浏览器异常并且firefox
没有打开。
我的代码片段如下所示:
System.setProperty("webdriver.gecko.driver", "C:/Documents and Settings/Admin/Desktop/wires-0.6.2-win/wires.exe");
GeckoDriverService service = new GeckoDriverService(new File("C:/Documents and Settings/Admin/Desktop/wires-0.6.2-win/wires.exe"), PortProber.findFreePort(), null, null);
DesiredCapabilities cap = DesiredCapabilities.firefox();
cap.setCapability("marionette", true);
cap.setCapability("firefox_binary", "G:/Program Files/Mozilla Firefox/firefox.exe");
driver = new MarionetteDriver(service, cap,PortProber.findFreePort());
显示exception
为:-
org.openqa.selenium.remote.UnreachableBrowserException:无法启动新会话。可能的原因是远程服务器地址无效或浏览器启动失败。构建信息:版本:'2.53.0',修订:'35ae25b',时间:'2016-03-15 16:57:40' 系统信息:主机:'computer_1',ip:'192.168.1.100',os。名称:'Windows XP',os.arch:'x86',os.version:'5.1',java.version:'1.7.0_79' 驱动程序信息:driver.version:MarionetteDriver