Jenkins不能启动selenium测试(超时等待配置文件被创建) [英] Jenkins can't launch selenium tests (Timed out waiting for profile to be created)

查看:605
本文介绍了Jenkins不能启动selenium测试(超时等待配置文件被创建)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



11:26:24.652 INFO - 启动org.openqa.jetty。 jetty.Server@ab50cd
11:26:24.738 INFO - 准备Firefox配置文件...
HTML套件异常:
java.lang.RuntimeException:超时等待配置文件创建!
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)
在org .openqa.grid.selenium.GridLauncher.main(GridLauncher.java:40)



操作系统 - Ubuntu工作站11
Jenkins& Selenium - 最后的版本(安装为在网站上写的)



在我看来,用户jenkins没有所有的权利,因为如果我使用相同的行执行在终端,它的工作硒启动Firefox&



我也把jenkins用户放在groop root中,但也不起作用。



我不是在Linux的资格,但似乎麻烦是与jenkins用户的权利,但我可以错误。



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

解决方案

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



尝试了此处提到的方法: http://www.spacevatican.org/2008/9/ 27 / selenium-and-firefox-3 但是,这个修复现在似乎已过时,因为插件的maxVersion属性都设置为8.something。



我修复它的方式(如此处所述: 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设置测试/工作区/results/results.html-log = / tmp / selenium.log -debug = true -firefoxProfileTemplate/home/username/.mozilla/firefox/6f2um01h.Selenium






我还建议将jenkins使用的shell命令复制并粘贴到Terminal,通过Jenkins每次。






NB我目前发现Selenium现在挂起下一步是它的进程(启动Firefox),但这似乎是一个不同的bug,我已经添加到stackoverflow这里:在Ubuntu上启动Firefox时Selenium挂起


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.

解决方案

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

这篇关于Jenkins不能启动selenium测试(超时等待配置文件被创建)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆