Selenium报错Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms

Selenium报错Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms

2017-02-28 12:42 by ycyzharry, 462 阅读, 0 评论, 收藏, 编辑

若selenium报错信息如下:

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
474-a285-3208198ce6fd}","syncGUID":"73X7LPTu1adZ","location":"app-global","version":"43.0.1","type":"theme","internalName":"classic/1.0","updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"D:\\Program Files\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","installDate":1488173931748,"updateDate":1488173931748,"applyBackgroundUpdates":1,"skinnable":true,"size":24172,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"43.0.1","maxVersion":"43.0.1"}],"targetPlatforms":[]}

 

产生该问题的原因是:selenium webdriver版本与火狐浏览器版本不兼容所致,本例中,我使用的webdriver为selenium-java-2.47.1版本,火狐浏览器为43.0.1版本。

解决办法:使用低版本火狐浏览器,如40.0.3或者使用高版本的selenium webdriver库。

你可能感兴趣的:(java,selenium)