简体   繁体   English

在Jenkins中执行Selenium HTML Test Suite无法在firefox上启动

[英]Executing Selenium HTML Test Suite in Jenkins is not able to launch on firefox

I am trying to integrate Jenkins with Selenium. 我正在尝试将Jenkins与Selenium整合。 I have prepared the following command: 我准备了以下命令:

java -jar <Full Path of the Selenium RC Jar, including jar file name> \
 -htmlSuite *firefox "<Application URL>" \
 "<Test Suite Path Including test suite name>" "<Results file name>"

When I executed the command in the command line, it worked fine. 当我在命令行中执行命令时,它工作正常。 Then I called the same command through Jenkins and I got the following error: 然后我通过Jenkins调用了相同的命令,我收到以下错误:

INFO - Preparing Firefox profile...
HTML suite exception seen:
java.lang.RuntimeException: Timed out waiting for profile to be created!
    at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.waitForFullProfileToBeCreated(FirefoxChromeLauncher.java:360)
    at

Then we created a profile for Firefox and ran with the profile. 然后我们为Firefox创建了一个配置文件并使用配置文件运行。 Now I am getting the following error: 现在我收到以下错误:

516 [main] INFO org.openqa.jetty.util.Container - Started org.openqa.jetty.jetty.Server@13f3045
HTML suite exception seen:
java.lang.NullPointerException
    at org.openqa.selenium.io.FileHandler.copyDir(FileHandler.java:229)
    at org.openqa.selenium.io.FileHandler.copy(FileHandler.java:213)
    at org.openqa.selenium.io.FileHandler.copy(FileHandler.java:200)
    at org.openqa.selenium.browserlaunchers.LauncherUtils.copyDirectory(LauncherUtils.java:223)
    at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.copyDirectory(FirefoxChromeLauncher.java:147)
    at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.initProfileTemplate(FirefoxChromeLauncher.java:174)
    at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.makeCustomProfile(FirefoxChromeLauncher.java:221)
    at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launch(FirefoxChromeLauncher.java:89)
    at

I have jenkins 1.452 and seleniumHQ2.0 我有jenkins 1.452和seleniumHQ2.0

Any help in this regard will be appreciated. 在这方面的任何帮助将不胜感激。

Before I invoke, Selenium RC, I have added one more command to export display, with this I am able to run selenium RC from Jenkins 在我调用之前,Selenium RC,我已经添加了一个导出显示的命令,我可以从Jenkins运行selenium RC

Command I executed is 我执行的命令是

export DISPLAY=:0; export DISPLAY =:0;

在我们的Jenkins实现中,我们使用Xvfb作为Firefox的无头X服务器运行。您可以在这里查看我们的实现细节http://www.hiringthing.com/2012/04/13/automated-ui-testing-with -jenkins-selenium.html

I was getting the same error trying to get selenium to run headless. 试图让硒无头跑,我得到同样的错误。 After some searching I realised that the user I was running selenium as didn't have access to the Firefox profile directory I had created. 经过一番搜索,我意识到我运行selenium的用户无法访问我创建的Firefox配置文件目录。 Changing the permissions on the profile directory got me past this error. 更改配置文件目录的权限让我超过了这个错误。

你可能想在Firefox中为Selenium准备一个配置文件:看看是否有帮助(答案没有标记为已回答,但是OP发布了他的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM