1.相信很多同學剛接觸selenium時,在Eclipse中打開fireFox瀏覽器是報報錯:
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
。。。(異常代碼太多此處省略)
在網上找了好多方法都是不能解決問題,結果是焦頭爛額!
2.其實這是selenium的jar包和火狐瀏覽器不兼容,因為FireFox更新的非常快,解決方法有兩個:
方法一是:去selenium官網下載最新的jar包:
Selenium Jar 包下載地址:http://selenium-release.storage.googleapis.com/index.html
方法二是:下載比較低的FireFox瀏覽器版本:
Firefox各版本下載地址:http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/
希望能幫到遇到此錯誤的同學解決問題,如不能解決可留言隨時溝通(博客園TestYao原創文章轉載請標明出處,謝謝!)