Jenkins 无法启动硒测试(等待创建配置文件超时)

发布于 2024-11-30 00:21:30 字数 1582 浏览 2 评论 0原文

Jenkins 无法启动 Selenium 测试(ubuntu) 错误

11:26:24.652信息-已启动org.openqa.jetty.jetty.Server@ab50cd 11:26:24.738 信息 - 正在准备 Firefox 配置文件... HTML 套件出现异常: java.lang.RuntimeException:等待创建配置文件超时! 在 org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.waitForFullProfileToBeCreated(FirefoxChromeLauncher.java:360) 在 org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.populateCustomProfileDirectory(FirefoxChromeLauncher.java:114) 在 org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launch(FirefoxChromeLauncher.java:83) 在 org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launchHTMLSuite(FirefoxChromeLauncher.java:405) 在 org.openqa.selenium.server.browserlaunchers.FirefoxLauncher.launchHTMLSuite(FirefoxLauncher.java:105) 在 org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:121) 在 org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:166) 在 org.openqa.selenium.server.SeleniumServer.runHtmlSuite(SeleniumServer.java:556) 在 org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:241) 在 org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:201) 在 org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:40)

操作系统 - Ubuntu 工作站 11 詹金斯和Selenium - 最新版本(按网站上编写的方式安装)

在我看来,用户 jenkins 没有所有权利,因为如果我使用同一行在终端中执行,它可以工作 selenium 启动 Firefox &做套房。

我还将 jenkins 用户放入 group root 中,但这也没有帮助。

我没有 Linux 资格,但似乎 jenkins 用户的权限有问题,但我可能会出错。

如果有人解决了问题,请写下解决方案。

Jenkins can't launch selenium tests (ubuntu)
error

11:26:24.652 INFO - Started org.openqa.jetty.jetty.Server@ab50cd
11:26:24.738 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 org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.populateCustomProfileDirectory(FirefoxChromeLauncher.java:114)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launch(FirefoxChromeLauncher.java:83)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launchHTMLSuite(FirefoxChromeLauncher.java:405)
at org.openqa.selenium.server.browserlaunchers.FirefoxLauncher.launchHTMLSuite(FirefoxLauncher.java:105)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:121)
at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:166)
at org.openqa.selenium.server.SeleniumServer.runHtmlSuite(SeleniumServer.java:556)
at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:241)
at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:201)
at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:40)

OS - Ubuntu workstation 11
Jenkins & Selenium - last versions (installed as is it written on sites)

It seems to me that user jenkins have not all the rights, because if i use the same line to execute in terminal, it works selenium starts Firefox & do the suite.

I also put jenkins user in groop root but it also doesn't help.

I'm not qualified in Linux but it seems than trouble is with rights of jenkins user, but i can mistake.

If somebody have solved the problem please write the solution.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

羁〃客ぐ 2024-12-07 00:21:30

我最近也遇到这个问题了。

我首先尝试了这里提到的方法: http://www. spacevatican.org/2008/9/27/selenium-and-firefox-3 然而,这个修复现在似乎已经过时了,因为插件 maxVersion 属性都设置为8.某事。

我修复它的方式(正如这里提到的:http://www.centripetal.ca/blog/2011/02/07/getting-started-with-selenium-and-jenkins/)的目的是为 Selenium 提供 Firefox 配置文件。

步骤

  1. 打开 Firefox 配置文件管理器: $ firefox -ProfileManager
  2. 创建一个名为 Selenium 的新配置文件
  3. 现在,运行 selenium 命令时,将“-firefoxProfileTemplate "/home/{username}/.mozilla/firefox/{profile dir}" 添加到命令(其中 {username} 是您的用户名,{profile dir} 是配置文件目录,对我来说是“6f2um01h.Selenium”

我的最终 Selenium命令是

$ sudo java -jar /var/lib/jenkins/tools/selenium/selenium-server.jar -htmlSuite *firefox http://google.com "/var/lib/jenkins/jobs/Selenium setup test/workspace/tests/test-testsuite.html" "/var/lib/jenkins/jobs/Selenium setup test/workspace/results/results.html" -log=/tmp/selenium.log -debug=true -firefoxProfileTemplate "/home/username/.mozilla/firefox/6f2um01h.Selenium"

我还建议将 jenkins 使用的 shell 命令复制并粘贴到终端中,以避免每次都通过 Jenkins 运行它,


注意我目前发现 Selenium 现在挂起(并且不会崩溃)。它的过程的步骤(启动 Firefox)但这似乎是一个不同的错误,我已将其添加到 stackoverflow 中:在 Ubuntu 上启动 Firefox 时 Selenium 挂起

I was recently having this issue too.

I first tried the method mentioned here : http://www.spacevatican.org/2008/9/27/selenium-and-firefox-3 However this fix now seems out of date, as the plugin maxVersion properties were all set to 8.something.

The way I fixed it (as mentioned here : http://www.centripetal.ca/blog/2011/02/07/getting-started-with-selenium-and-jenkins/) was to provide Selenium with a firefox profile.

Steps

  1. Open up Firefox profile manager : $ firefox -ProfileManager
  2. Create a new profile, called Selenium
  3. Now, when running the selenium command, add "-firefoxProfileTemplate "/home/{username}/.mozilla/firefox/{profile dir}" to the command. (where {username} is your username and {profile dir} is the profile directory, which for me was "6f2um01h.Selenium"

My final Selenium command was

$ sudo java -jar /var/lib/jenkins/tools/selenium/selenium-server.jar -htmlSuite *firefox http://google.com "/var/lib/jenkins/jobs/Selenium setup test/workspace/tests/test-testsuite.html" "/var/lib/jenkins/jobs/Selenium setup test/workspace/results/results.html" -log=/tmp/selenium.log -debug=true -firefoxProfileTemplate "/home/username/.mozilla/firefox/6f2um01h.Selenium"

I would also recommend copying and pasting the shell command that jenkins is using into Terminal, to save having to run it through Jenkins each time.


N.B. I'm currently finding that Selenium now hangs (and doesn't crash) on the next step of it's process (Launching Firefox) but this seems like a different bug which I've added to stackoverflow here : Selenium hangs when launching Firefox on Ubuntu

情定在深秋 2024-12-07 00:21:30

我有类似的问题。但原因和解决方法不同。

程序(我用的是python)挂起一段时间,然后输出:

selenium.common.exceptions.WebDriverException:消息:'浏览器
在我们能够连接之前似乎已经退出。输出为:*
日志 addons.xpi:启动\n*
日志 addons.xpi:checkForChanges\n*** 日志
addons.xpi:打开数据库\n*** LOG addons.xpi:无更改
发现\n无法 dlopen /usr/lib/libX11.so.6\ndlerror 说:
/usr/lib/libX11.so.6:错误的 ELF 类:ELFCLASS32\n'

这是因为我同时安装了 32 位和 64 位版本的 libX11。通过删除 libX11 32 位版本,该程序可以运行。

I have similar issues. But the cause and solution are different.

The program (I use python) hangs for a while, and then output:

selenium.common.exceptions.WebDriverException: Message: 'The browser
appears to have exited before we could connect. The output was: *
LOG addons.xpi: startup\n*
LOG addons.xpi: checkForChanges\n*** LOG
addons.xpi: Opening database\n*** LOG addons.xpi: No changes
found\nFailed to dlopen /usr/lib/libX11.so.6\ndlerror says:
/usr/lib/libX11.so.6: wrong ELF class: ELFCLASS32\n'

It is because I have installed both 32 and 64 bit version of libX11. By removing libX11 32 bit version, the program works.

动次打次papapa 2024-12-07 00:21:30

@mattbilson 的解决方案对我不起作用,但我找到了针对具有相同症状的问题的不同解决方案。我相信在尝试调试问题的过程中,已经安装了多个版本的 Firefox,并且并非全部来自干净的 deb 包。

为了解决这个问题,我做了:

sudo apt-get purge firefox
sudo mv /usr/lib/firefox /usr/lib/firefox.bak
sudo apt-get install firefox=<MY_FIREFOX_VERSION>

之后我可以运行 Selenium JAR,无需任何特殊参数。

@mattbilson's solution didn't work for me, but I found a different solution to a problem with the same symtomps. I believe In the process of trying to debug the problem, multiple versions of Firefox had been installed, and not all from clean deb packages.

To fix the problem I did:

sudo apt-get purge firefox
sudo mv /usr/lib/firefox /usr/lib/firefox.bak
sudo apt-get install firefox=<MY_FIREFOX_VERSION>

After that I could run the Selenium JAR without any special parameters.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文