Alex Kolo
Alex Kolo

Reputation: 273

Chromedriver crashes once running with Jenkins

I have created Web test using Robotframework. Once I am trying to run test with Jenkins, the test fails due to chromedriver crash on start. This is the message I receive:

WebDriverException: Message: unknown error: Chrome failed to start: crashed (Driver info: chromedriver=2.29.461585 (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b),platform=Mac OS X 10.12.4 x86_64)

Attempt to run it manually succeed, everything works fine.

This is a reduced code I am running:

*** Test Cases ***
Test Sanity Setup
    [Tags]    Sanity
    ${chrome_options} =     Evaluate    sys.modules['selenium.webdriver'].ChromeOptions()    sys, selenium.webdriver
    ${prefs}    Create Dictionary   credentials_enable_service=${false}
    Call Method    ${chrome_options}    add_experimental_option    prefs    ${prefs}
    Call Method    ${chrome_options}    add_argument    --disable-infobars
    Call Method    ${chrome_options}    add_argument    --kiosk
    Create WebDriver    Chrome      chrome_options=${chrome_options}
Go to URL
    Go To  ${URL}


Finalize Tests
    close all browsers


*** Keywords ***
Provided precondition
Setup chromedriver
  Set Environment Variable  webdriver.chrome.driver  ./driver/chromedriver.exe

Upvotes: 1

Views: 993

Answers (1)

Joep Weijers
Joep Weijers

Reputation: 1979

Could you please elaborate on what OS you are having Jenkins run this test? The code suggests your local machine is Windows, since you are setting the webdriver.chrome.driver to a Windows .exe? This will not work on Linux and Mac machines.

A manual for running Headless Chrome on Linux and Windows can be found here.

PS: Headless Chrome is coming to Linux and Mac very soon in Chrome 59, but it will take a little more time before Selenium and the Selenium-chrome-driver also support it.

Upvotes: 0

Related Questions