Browser never opens when running Robot Framework tests from Jenkins

故事扮演 提交于 2019-12-03 09:04:06

If your Jenkins job needs to run something that displays a GUI, you cannot run that build in Jenkins which runs as a background service (whether on Windows, Mac or Linux).

(In Linux you can play tricks with Xvnc or similar fake X servers and there are even Jenkins plugins that make it simpler.)

Your alternatives are either:

  • Log in using the GUI session and run Jenkins in a terminal window by typing java -jar /path/to/jenkins.war. When Jenkins is started in the GUI context, any processes started by Jenkins are able to talk to the GUI system and draw windows.
  • Or you can set up a JNLP slave in Jenkins, then log in using the GUI session, open a web browser to access your Jenkins and start the JNLP slave that connects to Jenkins master and now that the slave is running in GUI context, you can configure the job to execute on the slave. Processes that execute in the slave will be able to talk to the GUI system and draw windows.

This question here answers my question, hands down: stackoverflow.com/questions/8787682/…. Jenkins runs the tests as a service in the background. It must do something similar on osx/unix.

We need to run headless browser. We had achieved this for Firefox. We used centOS in jenkins Slave.

I have documented it here: http://dailychitty.blogspot.in/2014/07/configuring-jenkins-agent-to-run-robot.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!