【轉自】http://blog.csdn.net/fetch001/article/details/64437979
【Selenium】 -> 【FireFox】
2.25.0 -> 18
2.30.0 -> 19
2.31.0 -> 20
2.42.2 -> 29
2.44.0 -> 33 (不支持31)
2.53.0 -> 43,46(不支持47)
2.41.0 -> 26(綠色版本)
2.44 -> 32.0-35.0
2.53.0-2.53.6 -> 40.0.3(本司目前使用selenium和firefox版本)
在selenium+python環境下查看selenium版本方法:
cmd下輸入:pip show selenium
卸載selenium版本:
cmd下輸入:pip uninstall selenium
安裝: pip install selenium x.x.x(對應selenium版本)
在通過RF測試框架運行腳本時,提示瀏覽器方面錯誤,org.openqa.selenium.WebDriverException: Target URL ... is not well-formed
解決辦法:
只需要在你訪問的網址前加上:http://即可解決
例如:open browser www.baidu.com firefox運行后則會報以上錯誤
修改:open browser http://www.baidu.com firefox 運行成功
解決selenium不支持firefox低版本
用winrar打開selenium-server.jar;
查找兩個目錄:customProfileDirCUSTFFCHROME和customProfileDirCUSTFF;
搜索每個目錄,直到找到文件install.rdf,解壓縮到一個臨時目錄,編輯如下行:
<em:maxVersion>2.0.0.*</em.maxVersion>
改為
<em:maxVersion>4.0.0.*</em.maxVersion>
selenium-java-2.42.2版本和firefox 29.0.1版本兼容,如果升級到firefox 30+,則瀏覽器啟動失敗。可能是selenium還未同步升級,后面估計可以正常支持。
若selenium的版本和firefox不兼容,需要升級selenium的jar包,或者是升級firefox。
切記,關掉forefox的升級功能,否則連本地Windows上的腳本都跑不起來,且必須降級forefox。
升級后,selenium腳本正常啟動firefox。
各firefox版本下載地址
http://ftp.mozilla.org/pub/firefox/releases/
各selenium jar包下載地址
http://selenium-release.storage.googleapis.com/index.html
在selenium下載頁面 http://www.seleniumhq.org/download/ (需FQ) 各個版本的changelog中,會記錄支持的firefox版本
備注:selenium V3.0之前都不支持ff47.0.所以,如果你是seleniumV3.0以及之前的版本就不要下載ff47.0以及ff47.0之后的版本了。