3

I am observing the below error when i run a chrome browser open test case using robot framework.

WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally

(unknown error: DevToolsActivePort file doesn't exist)

(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) (Driver info: chromedriver=72.0.3626.69 (3c16f8a135abc0d4da2dff33804db79b849a7c38),platform=Linux 4.4.0-31-generic x86_64)

pasted the robot script below :

*** settings *** Library Selenium2Library *** Variables *** ${Browser} Chrome ${URL} https://www.google.com *** Test Cases *** TC001 Browser Start and Close Open Browser ${URL} ${Browser} 

chrome versions used :

  • Chrome version 72
  • ChromeDriver 72.0.3626.69

    4 Answers 4

    3

    I solved it! using --no-sandbox

    ${chrome_options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver Call Method ${chrome_options} add_argument test-type Call Method ${chrome_options} add_argument --disable-extensions Call Method ${chrome_options} add_argument --headless Call Method ${chrome_options} add_argument --disable-gpu Call Method ${chrome_options} add_argument --no-sandbox Create Webdriver Chrome chrome_options=${chrome_options} 

    Instead of

    Open Browser about:blank headlesschrome Open Browser about:blank chrome 
    1
    • OMG this worked for me. My situation is we have a pipeline that is using an ubuntu image and running robot framework. On my local mac, it works with just using Open Browser, but not on the ubuntu image using docker. In any case, it works now. I tried a few other options, but this one was the only one that worked. Thanks!CommentedSep 11, 2020 at 16:22
    2

    Here is an approach that worked for me. We have to pass the chrome_options and chrome web driver path while opening the browser. Please find the code below.

    *** Settings *** Library Selenium2Library *** Variables *** ${URL} https://www.google.com ${CHROMEDRIVER_PATH} /usr/local/bin/chromedriver *** Keywords *** Open Website ${chrome_options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver Call Method ${chrome_options} add_argument --no-sandbox Call Method ${chrome_options} add_argument --headless Open Browser ${URl} chrome options=${chrome_options} executable_path=${CHROMEDRIVER_PATH} *** Settings *** Suite Setup Open Website 

    NOTE: The chrome_options and executable_path have been passed directly to Open Browser command instead of creating a web driver (Because, for some reason, creating a web driver did not work for me. But passing arguments directly to the browser did)

    3
    • I cant open a browser because I plan to run this in gitlab CICommentedAug 30, 2021 at 19:12
    • 1
      We have the --headless argument. So it should ideally run in the Gitlab CI in the headless mode.CommentedAug 31, 2021 at 14:32
    • It worked for me thanks, was struggling from past 2 days
      – Cloudravi
      CommentedJun 16, 2023 at 12:32
    0

    You also need to have Selenium updated, which you'll get if using the newest version of SeleniumLibrary (it was removed the "2" from the name).

    Update your scripts for the new name and update with:

    pip install -U robotframework-seleniumlibrary 
      0

      Try to change your chrome driver to version 2.45 based on http://chromedriver.chromium.org/downloads version 72 is supported by 2.45. :)

        Start asking to get answers

        Find the answer to your question by asking.

        Ask question

        Explore related questions

        See similar questions with these tags.