I have recently installed the Jenkins on Windows 10 Machine (Jenkins as Service) and configured one Maven Project (Selenium project which open chrome browser and executes some testcase). If i build the same, all my testcase gets execute in Chrome headless mode instead of opening actual browser.

I've tried below solution :

  1. Checking jenkins service option to Allow service to interact with desktop

    enter image description here

  2. Setting NoInteractiveServices flag to 0 in Registry

    enter image description here

But nothing seem to work.

while i use Jenkins by executing Jenkins.war file it runs the testcase as expected (non-headless) but not Jenkins as Service.

Any idea why this is happening ?

  1. Following command line if you plan to run the same application in both a headless and a traditional environment: more details

    java -Djava.awt.headless=true

  2. You can add environment variable in Jenkins configurations Manage Jenkins -> Configure System -> Global Properties -> Environment Variables section As: Name : DISPLAY Value: 0

  3. Installing Jenkins master as a Windows service. This will run browser in other users account to get rid from this do following things:

    3.1 Go to your services and stop Jenkins service. To see all your services run services.msc, from there find Jenkins service and disable\stop it.

    3.2 Go to jenkins home directory(C:\Program Files(x86)\Jenkins) and start cmd with administrator mode and hit java -jar jenkins.war

    if still your problem persist go through following threads 1. for as service,

2. for general queries

  • thanks for the time. I have to use Jenkins master as a Windows service so i can't disable it – NarendraR Sep 18 '18 at 4:47
  • You need to set 'Allow service to interact with desktop' in the service properties: SeleniumHQ/selenium#3349 and on Windows 10 you have to toggle the NoInteractiveServices registry key, or try to start it as a regular Windows CLI process from the terminal or a batch file. – Dev Sep 18 '18 at 7:06
  • added 2 thread in answer please refer them – Dev Sep 18 '18 at 7:07
  • Dev, i have tried both solution but not working. i have updated my question as well – NarendraR Sep 21 '18 at 7:21
  • You can use a Jenkins plugin of a headless X server to run your tests on an installed browser. – Dev Sep 24 '18 at 11:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.