Search code examples
javajenkinsselenium-webdrivercommunicationexception

Selenium webDriver/Maven java tests on Jenkins not able to communicate with firefox


I'm trying to use jenkins to create automated regression tests for a web app. Jenkins basically fetches my maven project from git and reads the pom.xml. Then the test suite is started. The problem is that my tests are using selenium web driver in combination with gekodriver in order to launch firefox and navigate on the website. But everytime I launch the tests I get those errors:

Console logs

[1]

I'm running Jenkins as a service (it's how it was launched after installation) and my tests work fine when ran through eclipse or java. So I think the problem comes from how the jenkins handles selenium webdriver.

As you can probably see, I'm on a Windows 7 professional license. Firefox and gekowebdriver are updated to the last versions.


Solution

  • Fixed: Jenkins being ran as a service was the problem. In order for selenium to properly display firefox, it needed to access the desktop. Fixed the issue by simply allowing Jenkins service to use the desktop. It makes for a poor fix but it works fine.