使用Maven进行硒RC测试 [英] Selenium RC testing with Maven
问题描述
我正在尝试使用maven运行一系列硒测试,但出现此错误:
I'm trying to run a series of selenium tests using maven and I get this error:
Running com.myapp.web.selenium.MySeleniumTest
WARN [SocketListener0-1] HttpConnection - POST /selenium-server/driver/ HTTP/1.1
java.lang.RuntimeException: Firefox refused shutdown while preparing a profile
at org.openqa.selenium.server.browserlaunchers.FirefoxCustomProfileLauncher.waitForFullProfileToBeCreated(FirefoxCustomProfileLauncher.java:27
7)
at org.openqa.selenium.server.browserlaunchers.FirefoxCustomProfileLauncher.launch(FirefoxCustomProfileLauncher.java:147)
at org.openqa.selenium.server.browserlaunchers.AbstractBrowserLauncher.launchRemoteSession(AbstractBrowserLauncher.java:24)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:587)
.............
Caused by: org.openqa.selenium.server.browserlaunchers.FirefoxCustomProfileLauncher$FileLockRemainedException: Lock file still present! C:\DOCUME~1\Fl
orin\LOCALS~1\Temp\customProfileDir894171\parent.lock
at org.openqa.selenium.server.browserlaunchers.FirefoxCustomProfileLauncher.waitForFileLockToGoAway(FirefoxCustomProfileLauncher.java:235)
at org.openqa.selenium.server.browserlaunchers.FirefoxCustomProfileLauncher.waitForFullProfileToBeCreated(FirefoxCustomProfileLauncher.java:27
我正在使用Firefox 3.6.8,selenium-java-client-driver 0.9.2和selenium-server 0.9.2. 我从这样的测试中启动硒服务器:
I'm using Firefox 3.6.8, selenium-java-client-driver 0.9.2 and selenium-server 0.9.2. I start the selenium server from the tests like this:
private static void initServer() throws Exception {
String[] args = new String[]{"-port", String.valueOf(4444)};
SeleniumServer.main(args);
}
似乎硒配置文件已被锁定且未释放,以便后续测试可以使用它.
It seems that the selenium profile is being locked and not released so that the subsequent tests can use it.
推荐答案
您正在使用的Selenium版本实际上已经很旧了.您是否尝试过使用Selenium Maven插件?根据我的经验,Selenium经常需要升级以适应较新版本的浏览器.
The version of Selenium that you are using is actually quite old. Have you tried using the Selenium Maven plugin instead? In my experience, Selenium has often needed to be upgraded to accommodate newer versions of browsers.
这篇关于使用Maven进行硒RC测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!