How to run tests in Jenkins without being headless


#1

Hello,
I have a question about running tests in Jenkins without being headless.

I have a test case that runs fine in CLI mode on windows from a command prompt. In short, the test case creates a new user in our application and then logs into the new user where it has to answer some security questions. When I run it in Jenkins, it fails with an error that the first question it needs to answer is not clickable at that point.

Is there a way to run the test in Jenkins where you can see the flow of the test case in the browser since Jenkins runs the test in headless mode? I tried passing “-Dheadless=false” but it did not like that.

Thanks!


#2

Hi there @jmsc7ran,

can you tell us about your Jenkins environment? Is it a Windows box as well or is it running on a Linux server? If later is that one started with a GUI or runs in Non-GUI server mode? Generally, if your endpoint defined in your endpoints config isn’t set to headless, it means it shows up on local, it should do the very same on your CI build machine. By default, all endpoints added through Webtestit are Headfull, unless you check the box for the headless option (Chrome, FF).

What happens if you trigger the same CLI command that worked on your Win station manually on the build server?


#3

Greetings,
Jenkins ( version 2.189) is running on a Windows 10 machine. I checked the endpoint settings and headless is not checked. I can run the test in CLI mode on the Jenkins server and the browser does show me the test running.

Very odd.


#4

I guess it’s running as a Windows Service perhaps, which makes it behave a bit different. Take a look at this Stackoverflow answer, maybe that helps you figure out what went wrong with the configuration of Jenkins.


Running Ranorex Webtestit in Jenkins for Continuous Integration
#5

Thank you, I just found this link also… https://stackoverflow.com/questions/9618774/jenkins-selenium-gui-tests-are-not-visible-on-windows

I should have researched this more thoroughly before bugging you. Thanks as usual for the quick replies!


#6

Awesome, glad this worked out for you. Yeah sometimes it’s a bit weird process finding the root cause of the issue. I’m glad you figured it out by yourself - and no, you’re not bugging us that’s why we’re here :wink: - and came back to report the working solution. Thanks this is certainly going to help others in the same situation, which frankly isn’t too unusual.

EDIT: I’ve also updated the general HowTo article with a cross reference here. Thanks again for the help Jim