【问题标题】:Executing Selenium HTML Test Suite in Jenkins is not able to launch on firefox在 Jenkins 中执行 Selenium HTML 测试套件无法在 Firefox 上启动
【发布时间】:2012-03-28 14:45:53
【问题描述】:

我正在尝试将 Jenkins 与 Selenium 集成。我准备了以下命令:

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>"

当我在命令行中执行命令时,它运行良好。然后我通过 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

然后我们为 Firefox 创建了一个配置文件并使用该配置文件运行。现在我收到以下错误:

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

我有 jenkins 1.452 和 seleniumHQ2.0

我们将不胜感激。

【问题讨论】:

  • 在哪个用户下运行 jenkins?是否以 root 身份运行?
  • 你的操作系统是什么?视窗?还是 Linux?

标签: firefox selenium jenkins test-suite


【解决方案1】:

在调用 Selenium RC 之前,我已经添加了另一个命令来导出显示,这样我就可以从 Jenkins 运行 selenium RC

我执行的命令是

导出 DISPLAY=:0;

【讨论】:

    【解决方案2】:

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

    【讨论】:

      【解决方案3】:

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

      【讨论】:

        【解决方案4】:

        我在尝试让 selenium 无头运行时遇到了同样的错误。经过一番搜索,我意识到我正在运行 selenium 的用户无权访问我创建的 Firefox 配置文件目录。更改配置文件目录的权限让我克服了这个错误。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2012-11-16
          • 1970-01-01
          • 2013-04-05
          • 2012-02-06
          • 1970-01-01
          • 2013-04-10
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多