代码使用:
enter code here
ProfilesIni profile = new ProfilesIni();
FirefoxProfile ffprofile = profile.getProfile("Other");
WebDriver driver = new FirefoxDriver(ffprofile);
driver.get("http://google.com");
:运行源页面Firefox页面打开但google.com未打开错误
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
reg-app-global","addons":{"fiddlerhook@fiddler2.com":{"descriptor":"C:\\Program Files (x86)\\Fiddler2\\FiddlerHook","mtime":1409222185915,"rdfTime":1406724252000}}},{"name":"app-global","addons":{"{972ce4c6-7e08-4474-a285-3208198ce6fd}":{"descriptor":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","mtime":1411627483703,"rdfTime":1411627483531}}},{"name":"app-profile","addons":{"fxdriver@googlecode.com":{"descriptor":"C:\\Users\\RT-13\\AppData\\Local\\Temp\\anonymous3444483664614526613webdriver-profile\\extensions\\fxdriver@googlecode.com","mtime":1411630550698,"rdfTime":1411630550495}}}]
1411630550942 addons.xpi-utils DEBUG Opening XPI database C:\Users\RT-13\AppData\Local\Temp\anonymous3444483664614526613enter code herewebdriver-profile\extensions.json
1411630550943 addons.xpi DEBUG New add-on fxdriver@googlecode.com installed in app-profile
*** Blocklist::_loadBlocklistFromFile: block`enter code here`list is disabled
1411630551091 addons.xpi-utils DEBUG Make addon app-profile:fxdriver@googlecode.com visible
1411630551094 DeferredSave.extensions.json DEBUG Save changes
1411630551095 DeferredSave.extensions.json DEBUG Save changes
1411630551095 addons.xpi DEBUG New add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} installed in app-global
1411630551098 addons.xpi-utils DEBUG Make addon app-global:{972ce4c6-7e08-4474-a285-3208198ce6fd} visible
1411630551098 DeferredSave.extensions.json DEBUG Save changes
1411630551098 DeferredSave.extensions.json DEBUG Save changes
1411630551098 addons.xpi DEBUG New add-on fiddlerhook@fiddler2.com installed in winreg-app-global
答案 0 :(得分:2)
请将Firefox version
降级为 31 ,并将最新的selenium standalone server 2.43
库添加到构建路径中。这是每个人每周至少面对一次的常见问题:)
答案 1 :(得分:-1)
1)升级您的Selenium Server,即selenium jar" selenium-server-standalone-2.xx.x.JAR" TO " selenium-server-standalone-2.45.0.JAR"
2)升级您的Selenium客户端驱动程序,即selenium libs文件夹" selenium-java-2.xx.x" TO " selenium-java-2.45.0"
3)检查并安装兼容版本的Firefox
这将解决你的问题..干杯!!
参考 - Download updated selenium libs & jar i.e. Version 2.45.0