2010-09-02 115 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

相关问题