I have a WebDriver test using the FirefoxDriver that I am attempting to run as a Jenkins job.
It works fine in Windows, it also works from the command line in Linux, where my Jenkins server lives.
Unfortunately, I got the following error during executing as a Jenkins job:
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms
The Jenkins job consists of 2 steps: a shell step that executes:
Xvfb :1 -screen 0 1024x768x24 &
export DISPLAY=:1
And then a maven package to run the test class.
Why can’t I get the Jenkins job to execute Firefox?
What finally ended up working was to create the entire Jenkins job as one step that ran shell commands:
and that worked. No more NotConnectedException.
I had originally had the Jenkins job as 2 steps, shell to create virtual frame buffer and maven goal.