2010-09-02 111 views
2

部分地在Selenium RC testing with Maven回答的問題 - 基本上說回到使用Firefox 3.5(但一個答案表明不起作用)。反正也不是一個選項 - 我們正在使用3.6.8。如何讓Maven在Firefox 3.6中運行Selenium測試?

無論如何,關於如何讓Maven/Selenium與Firefox 3.6.x一起工作的任何線索?

我試圖使用方法:

<dependency> 
    <groupId>org.seleniumhq.selenium</groupId> 
    <artifactId>selenium</artifactId> 
    <version>2.0a5</version> 
</dependency> 

對於在測試中使用相關的Java類。

和:

<plugin> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>selenium-maven-plugin</artifactId> 
    <version>1.1-SNAPSHOT</version> 
    <executions> 
    <execution> 
     <phase>pre-integration-test</phase> 
     <goals> 
     <goal>start-server</goal> 
     </goals> 
     <configuration> 
     <background>true</background> 
     </configuration> 
    </execution> 
    <execution> 
     <id>stop-selenium</id> 
     <phase>post-integration-test</phase> 
     <goals> 
     <goal>stop-server</goal> 
     </goals> 
    </execution> 
    </executions> 
</plugin> 

當我運行鍼對Firefox的集成測試,我得到:

INFO [org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher]準備的Firefox配置文件...

錯誤[org.openqa.selenium.server.BrowserSessionFactory]無法啓動新瀏覽器會話,關閉瀏覽器並清除所有會話數據 java.lang.RuntimeException:在準備配置文件時Firefox拒絕關機

造成者: org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher $ FileLockRemainedException:鎖定文件仍然存在! C:\ DOCUME〜1 \ XXX \ LOCALS在org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.waitForFileLockToGoAway(FirefoxChromeLauncher.java:269)〜1個\ TEMP \ customProfileDirb809d85d6d064be0bdd1a4ee68035cbb \ parent.lock

+0

這是Selenium 2.0b3的問題嗎? – Ardesco 2011-05-26 09:57:11

回答

0

我有Firefox和Selenium RC的問題。

解決方案是編輯硒RC jar文件。在WINRAR打開它們(或類似),並通過文件夾瀏覽

selenium-server.jar\customProfileDirCUSTFF\extensions\* 
selenium-server.jar\customProfileDirCUSTFFCHROME\extensions\* 

打開你見「的install.rdf」

<Description about="urn:mozilla:install-manifest"> 
     <em:id>[email protected]</em:id> 
     <em:type>2</em:type> 
     <em:name>DocumentReadyState</em:name> 
     <em:version>1.0</em:version> 
     <em:description>Provides a mechanism to update the document readyState property</em:description> 

     <!-- 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> 
    </Description> 
</RDF> 

的文件,看看它在那裏MaxVersion說?碰撞說...... 4.6
保存文件並覆蓋.jar中的原始install.rdf

然後......硒很高興。

如果這不起作用,我真的很感謝您的時間。這是我在幾小時/每天的爭吵後發現的一個黑客。

... 編輯 ... 哦我剛剛從上面讀取錯誤消息。遠不及同樣的問題。你的是與鎖文件或以前的Firefox會話。

嘗試清除歷史記錄/重置爲出廠默認設置在瀏覽器和類似的?

+0

正如你所懷疑的,改變maxVesion對我來說並不適用。 問題與清除歷史記錄等無關 Selenium從Maven運行時似乎不支持Firefox 3.6。 – Steve 2010-09-04 23:26:45

相關問題