简体   繁体   中英

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.

When I run the test case, Eclipse opens the Firefox browser but no URL is entered and no action is happening.

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.

Selenium 3.0.x switched to using the new 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."

The Selenium java history page has this to say about v3.0.0 and 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."

My advice is to drop back to Selenium v2.53 and 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. Thanks for posting.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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