0

I can successfully run my selenium webdriver tests from my local machine(WindowsA), I now want to run my tests using Jenkins (machine B). For my webdriver Tests I see the following output from Jenkins

org.openqa.selenium.WebDriverException: 
Failed to connect to binary FirefoxBinary(/usr/bin/firefox) on port 7055; process output follows: 
Error: no display specified

I've made sure browser and and selenium versions match. I think this is an issue with my Jenkins(linux) machine. I have Xvfb on my linux machine also. I've read articles mention the browser maybe running in HEADLESS mode but seeing as other people are using Jenkins I am cautious before making any changes.

trevdro
  • 23
  • 9

1 Answers1

0

Looks like you are trying to run the tests without specifying a DISPLAY and from what I read in your question I'm not sure if you are really using Xvfb or not and also if the "machine B" has a X server or not. Well, if machine B doesn't has a X server you need to run Xvfb in order to simulate one, then you need to set the $DISPLAY environment variable to the value that the Xvfb server will be listening to and finally you can run the selenium driver. An example:

# The Xvfb server will listen for connections as server number 4
Xvfb :4 &
# set $DISPLAY value to the one defined in your Xvfb server instance
export DISPLAY=:4
# run the selenium driver
java -jar /path/to/your/driver/selenium-server-standalone-2.44.0.jar
Community
  • 1
  • 1
BrunoRB
  • 889
  • 8
  • 14
  • Is there a way to set Display from Jenkins? – trevdro Jan 12 '16 at 18:08
  • Check this question http://stackoverflow.com/questions/10625259/how-to-set-environment-variables-in-jenkins. – BrunoRB Jan 12 '16 at 18:14
  • So I should just take your example (or similar) inject using jenkins. Install selenium standalone server. And that should be it? – trevdro Jan 12 '16 at 18:17
  • You will have to adapt those commands to your specific case, since you didn't explain exactly how you are currently trying to run the tests, and there are a lot of ways to do this in jenkins like with simple bash scripts/taskrunners/plugins, I cannot tell you precisely what to do. – BrunoRB Jan 12 '16 at 18:30
  • Currently I run my tests from my local machine command line using mvn clean test. My project comprises of maven testng selenium and some javascript – trevdro Jan 12 '16 at 18:33
  • Sorry but I can't help you more since I never used maven and testng, though I'm pretty sure the problem that you are having is the one described in my answer. – BrunoRB Jan 12 '16 at 18:42