2

I have my selenium automation script running in chrome and it is running through Jenkins. I have two machines in Jenkins, one master, and one slave, both of them are Windows 7.

While running in master, the automation script is working fine and I can see the script opening a chrome browser in the master remote machine, but while it is running in Slave, I don't see any chrome opening in the slave machine. Looks like it is automatically opening a headless browser and running the script in the background.

Is there any way to turn off that automatic headless run and allow slave to actually open the chrome browser?

Note: I have connected to slave via jnlp (Java method).

Vel Guru
  • 526
  • 2
  • 22

2 Answers2

1

I think you are running the agent as a service. Services cannot access the main desktop UI, in some services you can set "Allow service to interact with desktop".

For debugging purposes I would manually start the agent instead of running it as a service.

For more details read: https://stackoverflow.com/questions/5063731/is-there-any-way-to-start-a-gui-application-from-a-windows-service-on-windows-7

Niels van Reijmersdal
  • 32,520
  • 4
  • 57
  • 124
0

I am facing the same issue. And found two different resolutions.

  1. If your requirement is to see the chrome browser then open the command prompt and execute the below command

Java -jar jenkins.war

  1. If your goal is just to change the resolution then add the below options and you can see the configure resolution(in below example resolution is 1920,1080):-

options.addArguments("enable-automation"); options.addArguments("--headless"); options.addArguments("--window-size=1920,1080"); options.addArguments("--no-sandbox"); options.addArguments("--disable-extensions"); options.addArguments("--dns-prefetch-disable"); options.addArguments("--disable-gpu");