今天寫個自動重新整理頁面的腳本,發現在啟動firefox的時候,出現一個類似如下的錯誤:
請在文本框輸入文字15:22:12.031 warn - get /selenium-server/driver/?cmd=getnewbrowsersession&1=*fir
efox&2=http://www.google.com http/1.1
at org.openqa.selenium.server.browserlaunchers.firefoxcustomprofilelaunc
her.waitforfullprofiletobecreated(firefoxcustomprofilelauncher.java:277)
後來查了google發現問題是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>
為
<em:maxversion>3.6.*</em:maxversion>
還可以改得更加大,那麼就可以支援4.0 的firefox了
最新内容請見作者的github頁:http://qaseven.github.io/