Jenkins 无法启动 selenium 测试(等待创建配置文件超时)
Jenkins 无法启动 selenium 测试 (ubuntu)错误
Jenkins can't launch selenium tests (ubuntu) error
11:26:24.652 信息 - 已启动 org.openqa.jetty.jetty.Server@ab50cd11: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 - 最新版本(按照网站上的说明安装)
OS - Ubuntu workstation 11 Jenkins & Selenium - last versions (installed as is it written on sites)
在我看来,用户 jenkins 并没有所有的权利,因为如果我使用同一行在终端中执行,它可以工作 selenium 启动 Firefox &做套房.
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.
我也将 jenkins 用户置于 groop root 中,但也无济于事.
I also put jenkins user in groop root but it also doesn't help.
我在 Linux 方面没有资格,但似乎麻烦在于 jenkins 用户的权限,但我可能会出错.
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.
推荐答案
我最近也遇到了这个问题.
I was recently having this issue too.
我首先尝试了这里提到的方法:http:///www.spacevatican.org/2008/9/27/selenium-and-firefox-3 但是这个修复现在似乎已经过时了,因为插件的 maxVersion 属性都设置为 8.something.
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.
我修复它的方式(如此处所述:http://www.centripetal.ca/blog/2011/02/07/getting-started-with-selenium-and-jenkins/) 是为 Selenium 提供一个 firefox 配置文件.
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.
步骤
- 打开 Firefox 配置文件管理器:$ firefox -ProfileManager
- 创建一个名为 Selenium 的新配置文件
- 现在,在运行 selenium 命令时,将-firefoxProfileTemplate"/home/{username}/.mozilla/firefox/{profile dir}"添加到命令中.(其中 {username} 是您的用户名和 {profile dir}是配置文件目录,对我来说是6f2um01h.Selenium"
我最后的 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"
<小时>
我还建议将 jenkins 使用的 shell 命令复制并粘贴到终端中,以免每次都通过 Jenkins 运行它.
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.
注意我目前发现 Selenium 现在在其进程的下一步(启动 Firefox)中挂起(并且不会崩溃),但这似乎是我在此处添加到 stackoverflow 的另一个错误:在 Ubuntu 上启动 Firefox 时 Selenium 挂起
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
相关文章