eclipse+selenium測試問題集

1.因Firefox沒有安裝在默認路徑而無法啓動報的錯

can't find firefox binary in PATH.Make sure firefox is installed.


solution:

add code:  System.setProperty("webdriver.firefox.bin","E:\\Firefox\\firefox.exe");

and,E:\\Firefox\\firefox.exe is the path of firefox in your computer.



2.以爲修改了那個錯誤終於可以執行成功人生第一條Java用例,然而我錯了,接下來又來了個因爲用了selenium3.0+Firefox而必須安裝geckodriver的東西

報錯如下

下載地址  https://github.com/mozilla/geckodriver/releases


網速渣渣還沒下載完,不造行不行!!!明天再說。。。


兩天後:

不知道爲什麼圖片不見了呢。。。。心傷!

上面那個地址下載geckodriver總是失敗的,不知道爲什麼,後來去找到了這個(http://download.csdn.net/detail/dongyingying518/9606829)地址下載,試驗可用。

需要添加代碼

System.setProperty("webdriver.firefox.marionette","E:\\Firefox\\geckodriver-v0.9.0-mac\\geckodriver");


3.這樣之後我還遇到一個錯誤

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms

原因:selenium與火狐的版本不對應,官網下載頁每個selenium client的change log對應都有寫兼容的火狐版本。

這裏用的是selenium3.0.0+Firefox47.0.1

親測可用





發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章