Selenium支持高版本的FireFox
今天寫(xiě)個(gè)自動(dòng)刷新頁(yè)面的腳本,發(fā)現(xiàn)在啟動(dòng)firefox的時(shí)候,出現(xiàn)一個(gè)類(lèi)似如下的錯(cuò)誤:
請(qǐng)?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) |
后來(lái)查了google發(fā)現(xiàn)問(wèn)題是selenium不支持高版本firefox, 解決方案如下:
1、用winrar打開(kāi)selenium-server.jar;
2、查找兩個(gè)目錄:customProfileDirCUSTFFCHROME和customProfileDirCUSTFF;
3、搜索每個(gè)目錄,對(duì)每個(gè)文件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) 評(píng)論(0) 編輯 收藏 所屬分類(lèi): selenium and watir webdrivers 自動(dòng)化測(cè)試學(xué)習(xí)