Sikuli, selenium testing on Jenkins: Allow the browser to be launched in the foreground, as it is when i run it from development machine? Sikuli, selenium testing on Jenkins: Allow the browser to be launched in the foreground, as it is when i run it from development machine? selenium selenium

Sikuli, selenium testing on Jenkins: Allow the browser to be launched in the foreground, as it is when i run it from development machine?


So you've got a development machine where Sikuli works, and a test machine where Jenkins runs Sikuli and it doesn't work.

I had this same setup (with the Sikuli tester/Jenkins slave running Windows 7). What worked for me was to have the test machine run a VNC server, log in as a the tester account over VNC, and launch the Jenkins slave as a regular application and not a service. I used UltraVNC server.

As far as I could tell, the problem stems from Windows' security measures, which are designed to prevent a remote user from controlling your machine without your presence.

If you run Jenkins as a service, it doesn't get a real desktop allocated to it. The script will run, but (as you're seeing) Sikuli won't actually be able to find anything because there's nothing for it to look at. (Selenium is inspecting the page content programmatically, so it doesn't mind that the page is not actually displayed on any screen.)

You can also just run Jenkins and leave yourself logged in, and skip the VNC server. I wanted to run the machine without a monitor or keyboard and still have control, though. If that's your goal as well, you can't use Remote Desktop, because it allocates a new desktop on connection and then destroys it when you disconnect. (So Jenkins will work when you're watching and fail when you leave for the night. Very frustrating!)

As a side benefit, if you do it this way you can connect over VNC and watch Jenkins as it's running the test.


  1. make the slave machine remote desktop to itself.
  2. run the jenkins salve as program in that session cmd /c start java -jar slave.jar -jnlpUrl http....slave-agent.jnlp -secret ... (find it in your jenkins master (shown when the slave service is down)
  3. set it all to run at salve win startup.