The versions of each item I am using are as follows: Selenium 3.4.0, GeckoDriver v0.19.0 for Linux 64 and Firefox 52.4.0.
First question I've ever asked on this site. I am normally able to figure stuff out by simple lurking, but this problem has been giving me a real run for my money.
I am attempting to set up Jenkins to "mvn clean test" a project that will run Selenium (using version 3.4.0) tests on "test". Essentially, the project is a collection of classes that use Selenium to interact with another project. I have attached JUnit tests to this project so that by building it, I can use the testing suite I created.
I was able to do this on my local machine using either Chrome or Firefox, but I want to have Jenkins do it automatically on a nightly basis. I have Jenkins on a Centos 7 server, and I am attempting to get the project to work with a headless browser. I have had some separate problems with PhantomJS (the DOM is blank in Phantom), so I am also attempting to use headless Firefox (using version 52.4.0). Here are the general steps I took:
- Install Xvfb on CentOS.
- Install Firefox (52.4.0) on CentOS.
- Run "Xvfb :99 -ac &"
- Run "export DISPLAY=:99"
- Run the project with "mvn clean test".
(I have, and I will, attempt steps 3-5 on Jenkins, but am stuck at just getting it to work on CentOS alone.)
The project starts alright with:
T E S T S
. . . . . .
Running com.*****.*****.workflows.HappyPathTest
. . . . . .
1510266036943 Marionette INFO Listening on port 2828
It then sits at this point for a moment before the following happens:
org.openqa.selenium.WebDriverException: connection refused
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'localhost.localdomain', ip: '0:0:0:0:0:0:0:1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-327.36.3.el7.x8 6_64', java.version: '1.8.0_111'
Driver info: driver.version: FirefoxDriver
remote stacktrace: stack backtrace:
0: 0x4f388c - backtrace::backtrace::trace:
and so on.
The line that the error occurs on is a simple: "methodDriver = new FirefoxDriver();"
I initially took the "connection refused" to mean that the firewall was somehow blocking it, but, of course, everything is on the same server and the "firewalld" process is not running as it is.
Any help would be greatly appreciated.
Edit: The suggested thread involved an apparently similar issue, but the suggestions in there were different from what I used to solve the problem here. I did, however, manage to get past this issue by updating my version of Firefox.