簡體   English   中英

在Eclipse中的Java中執行Selenium WebDriver Firefox時顯示錯誤異常?

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

執行Selenium WebDriver Java測試用例時出現錯誤。

當我運行測試用例時,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 

您必須將硒版本與兼容的Firefox瀏覽器版本進行匹配。

Selenium 3.0.x切換為使用新的geckodriver。 geckodriver 主頁上說:“ Marionette和geckodriver尚未完成功能。這意味着它尚未完全符合WebDriver標准或與Selenium完全兼容。”

Selenium Java歷史記錄頁面上有關於v3.0.0和firefox的內容:

“ *僅47.0.1或更早版本才完全支持Firefox。geckodriver提供了對firefox更高版本的支持,它基於不斷發展的W3C WebDriver規范,並在該規范中使用了有線協議,該協議易於更改*您不妨選擇45.4.0esr或更早的ESR版本。*根本不支持Firefox 47.0.0。”

我的建議是退回到Selenium v​​2.53和firefox v47。

是的,經過大量的故障排除后,我終於可以正常工作了。 對於Selenium WebDriver 3.0,您需要FF 50.2,最重要的是,您將需要gecko驅動程序並將該語句放在eclipse中指向該驅動程序。 感謝您的發布。

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