0

I am not able to execute selenium test cases using robotframework through Jenkins. Installed Firefox, geekodriver.

Works without using Jenkins.

Getting the exception

WebDriverException: Message: Process unexpectedly closed with status: 1

Its a simple test case that has

*** Settings ****
Library    Selenium2Library

*** Test Cases ***
Testing Selenium
     Open Browser    http://google.com    Firefox

Jenkins shell command configuration

pybot test.robot
Dinesh Pundkar
  • 4,160
  • 1
  • 23
  • 37
Vinay
  • 470
  • 1
  • 5
  • 18
  • 2
    you need to give more information,for instance what is the OS in Jenkins. If Jenkins runs under Windows,does this happens also when you are logged by RDP,do you start GUI desktop if this is linux enviroment. etc. – jozefow Feb 26 '18 at 11:38
  • 1
    Often, this means that the version of the driver and the version of firefox are incompatible. Though, if your jenkins is running as a headless service, that could also be the problem. Selenium needs a display in order to open the browser. – Bryan Oakley Feb 26 '18 at 13:24
  • I was facing the same issue with python selenium as well. Just wondering if Jenkins can start a browser on the server. The issue is exactly as mentioned in https://stackoverflow.com/questions/39547598/selenium-common-exceptions-webdriverexception-message-connection-refused . Using pyvirtualdisplay solved the issue with python selenium. Don't know how to use robotframework selenium2library – Vinay Feb 27 '18 at 04:43
  • @Vinay: _"Just wondering if Jenkins can start a browser on the server" - Jenkins has that ability, but it depends on how the jenkins machine is configured. If it's headless, it can't open a browser. – Bryan Oakley Mar 08 '18 at 16:52
  • @BryanOakley: Thanks! Yes, I think it is because Jenkins is configured headless. Resolved it by using a xvfb plugin. – Vinay Mar 21 '18 at 23:26

1 Answers1

0

Install xvfb in the robotframework server. Also use xvfb plugin in Jenkins.

Seems like xvfb is deprecated and heard that there is a vncserver plugin. Need to try this.

Vinay
  • 470
  • 1
  • 5
  • 18