Selenium支持高版本的FireFox
今天寫個自動刷新頁面的腳本,發(fā)現(xiàn)在啟動firefox的時(shí)候,出現(xiàn)一個類似如下的錯誤:
請?jiān)谖谋究蜉斎胛淖?5:22:12.031 WARN - GET /selenium-server/driver/?cmd=getNewBrowserSession&1=*fir efox&2=http://www.google.com HTTP/1.1 java.lang.RuntimeException: Firefox refused shutdown while preparing a profile at org.openqa.selenium.server.browserlaunchers.FirefoxCustomProfileLaunc her.waitForFullProfileToBeCreated(FirefoxCustomProfileLauncher.java:277) |
后來查了google發(fā)現(xiàn)問題是selenium不支持高版本firefox, 解決方案如下:
1、用winrar打開selenium-server.jar;
2、查找兩個目錄:customProfileDirCUSTFFCHROME和customProfileDirCUSTFF;
3、搜索每個目錄,對每個文件install.rdf,編輯如下行:
修改
<!-- Firefox --> <em:targetApplication> <Description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minVersion>1.4.1</em:minVersion> <em:maxVersion>3.5.*</em:maxVersion> </Description> </em:targetApplication> 為 <!-- Firefox --> <em:targetApplication> <Description> <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <em:minVersion>1.4.1</em:minVersion> <em:maxVersion>3.6.*</em:maxVersion> </Description> </em:targetApplication> |
還可以改得更加大,那么就可以支持4.0 的firefox了
posted on 2014-06-16 10:19 順其自然EVO 閱讀(3369) 評論(0) 編輯 收藏 所屬分類: selenium and watir webdrivers 自動化測試學(xué)習(xí)