Harshdip Singh
Harshdip Singh

Reputation: 139

How To Run UI Test Classes Using Selenium Webdriver in Jenkins?

I have test classes written in java for UI testing using Maven using Selenium Web-Driver. I want to run them using mvn test command in Jenkins. It is not able to launch the browser for the testing.

The error stack shown is something like this: org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: Error: no display specified Error: no display specified at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:106)

Any help on this will be appreciated.

Upvotes: 0

Views: 3247

Answers (1)

coffeebreaks
coffeebreaks

Reputation: 3817

Firefox needs a X display to run, e.g. Xvfb

You will need to

  • install xvfb on your server. Doing this depends on your server operating system (and package management)
  • start xvfb before the build. You can do this using the xfvb plugin, or by running Xvfb as a daemon. I personally like to use the plugin.

Upvotes: 1

Related Questions