2

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:

  1. Install Xvfb on CentOS.
  2. Install Firefox (52.4.0) on CentOS.
  3. Run "Xvfb :99 -ac &"
  4. Run "export DISPLAY=:99"
  5. 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.

somexp12
  • 497
  • 1
  • 6
  • 19

2 Answers2

1

Well, it seems I was able to get around this specific problem.

I simply updated firefox to 56.0.1. When I originally installed firefox, it looks like Centos did not default to the most recent.

I remember reading some stuff to the effect of "each version of GeckoDriver is tailored specifically to particular version of Firefox." So, it may be that every time you get a new GeckoDriver you need a new firefox.

This has opened the door for an entirely new problem. I get to this line:

wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.className("resultText")));

which works fine with the headed browser, and I get the following back:

"org.openqa.selenium.TimeoutException: Expected condition failed: waiting for presence of any elements located by By.className: resultText (tried for 20 second(s) with 250 MILLISECONDS interval)"

This seems similar to the issues I am getting with PhantomJS. It's as if the headless browser is accessing an entirely different site than the headed browser.

somexp12
  • 497
  • 1
  • 6
  • 19
0

Please check if the disk is full of the core dump files. It could be in your working directory or the user directory. In my environment, we only get first 20 test passed since our user directory only has less than 1G free space.

wangy23
  • 1
  • 1
  • Thank you. Not sure were to check for those, however. I seem to have found an answer to my problem, but it is sounding like this is something I should check for, regardless. – somexp12 Nov 13 '17 at 14:10