简体   繁体   English

在Eclipse中的Java中执行Selenium WebDriver Firefox时显示错误异常?

[英]Error exception is displayed when Selenium WebDriver Firefox executing in Java in Eclipse?

I am getting an error when executing my Selenium WebDriver Java Test Case. 执行Selenium WebDriver Java测试用例时出现错误。

When I run the test case, Eclipse opens the Firefox browser but no URL is entered and no action is happening. 当我运行测试用例时,Eclipse将打开Firefox浏览器,但是没有输入URL,也没有任何动作。

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
ctExt/content/firefoxextension.png","icon64URL":null,"defaultLocale":{"name":"PDF Architect Converter For Firefox","description":"This extension help you to convert html page to the pdf document.","creator":"pdfforge GmbH","homepageURL":"},"visible":true,"active":false,"userDisabled":true,"appDisabled":true,"descriptor":"C:\\Program Files (x86)\\PDF Architect\\FFPDFArchitectExt","installDate":1395772957003,"updateDate":1395772957003,"applyBackgroundUpdates":1,"bootstrap":false,"skinnable":false,"size":413015,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":true,"hasBinaryComponents":false,"strictCompatibility":false,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"4.0","maxVersion":"9.*"}],"targetPlatforms":[],"multiprocessCompatible":false,"signedState":0,"seen":true}
1481279715745 DeferredSave.extensions.json DEBUG Save changes
1481279715745 addons.xpi DEBUG Updating database with changes to installed add-ons
1481279715745 addons.xpi-utils DEBUG Updating add-on states
1481279715747 addons.xpi-utils DEBUG Writing add-ons list
1481279715749 addons.xpi DEBUG Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\aushelper@mozilla.org.xpi
1481279715750 addons.xpi DEBUG Calling bootstrap method startup on aushelper@mozilla.org version 1.0
1481279715751 addons.xpi DEBUG Registering manifest for C:\Program Files 

You have to match your selenium version to a compatible firefox browser version. 您必须将硒版本与兼容的Firefox浏览器版本进行匹配。

Selenium 3.0.x switched to using the new geckodriver. Selenium 3.0.x切换为使用新的geckodriver。 The geckodriver home page has this to say, "Marionette and geckodriver are not yet feature complete. This means it does not yet offer full conformance with the WebDriver standard or complete compatibility with Selenium." geckodriver 主页上说:“ Marionette和geckodriver尚未完成功能。这意味着它尚未完全符合WebDriver标准或与Selenium完全兼容。”

The Selenium java history page has this to say about v3.0.0 and firefox: Selenium Java历史记录页面上有关于v3.0.0和firefox的内容:

"* Firefox is only fully supported at version 47.0.1 or earlier. Support for later versions of firefox is provided by geckodriver, which is based on the evolving W3C WebDriver spec, and uses the wire protocol in that spec, which is liable to change without notice. * You may wish to choose an ESR release such as 45.4.0esr or earlier. * Firefox 47.0.0 is not supported at all." “ *仅47.0.1或更早版本才完全支持Firefox。geckodriver提供了对firefox更高版本的支持,它基于不断发展的W3C WebDriver规范,并在该规范中使用了有线协议,该协议易于更改*您不妨选择45.4.0esr或更早的ESR版本。*根本不支持Firefox 47.0.0。”

My advice is to drop back to Selenium v2.53 and firefox v47. 我的建议是退回到Selenium v​​2.53和firefox v47。

Yes, After tons of troubleshooting, I finally got it to work. 是的,经过大量的故障排除后,我终于可以正常工作了。 For Selenium WebDriver 3.0, u need FF 50.2 , and top of that u will need the gecko driver and put the statement in ur eclipse pointing to the driver. 对于Selenium WebDriver 3.0,您需要FF 50.2,最重要的是,您将需要gecko驱动程序并将该语句放在eclipse中指向该驱动程序。 Thanks for posting. 感谢您的发布。

System.setProperty("webdriver.gecko.driver","C:\\Path_To_Your_File\\geckodriver-v0.11.1-win64\\geckodriver.exe"); System.setProperty(“ webdriver.gecko.driver”,“ C:\\ Path_To_Your_File \\ geckodriver-v0.11.1-win64 \\ geckodriver.exe”);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM