Open Browser Stopped Working After Update and Create WebDriver will not allow Auth

3,036 views
Skip to first unread message

Shawn Galante

unread,
Nov 20, 2018, 5:35:56 PM11/20/18
to robotframework-users

I am trying to upgrade our container instances of Robot Framework and the corresponding Selenium and Chrome pieces to allow for the use of newer keywords in the SeleniumLibrary for Robot Framework. However I cannot get past 2 issues after updating:

  1.   1 - Using Open Browser keyword results in a chrome crash failure:

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/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
  (Driver info: chromedriver=2.43.600233 (523efee95e3d68b8719b3a1c83051aa63aa6b10d),platform=Linux 3.10.0-693.17.1.el7.x86_64 x86_64)

Using the disable-gpu and no-sandbox parameters in chrome's options.py file

  1.   2 - Switching to Create WebDriver results in a successful navigation of the web page but will not pass authentication (verified good creds being sent) Built using:

    ${chrome_options}=    Evaluate    sys.modules['selenium.webdriver'].ChromeOptions()    sys, selenium.webdriver
        Call Method    ${chrome_options}    add_argument    headless
        Call Method    ${chrome_options}    add_argument    disable-gpu
        Call Method    ${chrome_options}    add_argument    --start-maximized
        Call Method    ${chrome_options}    add_argument    --allow-running-insecure-content
        Call Method    ${chrome_options}    add_argument    --disable-web-security
        Create Webdriver    chrome    chrome_options=${chrome_options}

Working System Setup:

  • Python 2.7.15
  • ChromeDriver 2.22
  • Chromium 53.0.2785.92
  • robotframework-selenium2library 3.0.0
  • robotframework-seleniumlibrary 3.0.1
  • selenium 3.6.0
  • Alpine 3.4.6

Updated and Failing System Setup:

  • Python 2.7.15
  • ChromeDriver 2.43.600233
  • Chromium 70.0.3538.77
  • robotframework-selenium2library (3.0.0)
  • robotframework-seleniumlibrary (3.2.0)
  • selenium (3.141.0)
  • Alpine 3.8

Simple Robot test, open URL, enter user name and password and click login. The breaking of open browser I have not been able to get around despite the number of recommendations on adding arguments to Chrome to help. I have tried adding all of the following:

self._arguments = ['--no-sandbox','--disable-gpu', '--headless', '--disable-dev-shm-usage', 'window-size=1920,1080']

In addition to the options noted in the Create WebDriver call.

Why is Open Browser no longer working and what can I look at to figure out why the Create Web Driver will not allow good creds to auth into the site (yes, I can log in manually). 


I know there are a lot of changes to the packages and environments.  I can confirm that just updating the Chrome Driver, Chromium Browser, Selenium and Robot Selenium packages in Alpine 3.4.6 alone net the same error as noted in #1 above.  I am not sure where else to look now or how to figure out what to change.


Any help is appreciated

Anne kootstra

unread,
Nov 21, 2018, 1:39:04 AM11/21/18
to robotframework-users
Just asking the obvious question: have you tried updating to ChromeDriver 2.44? 

Kind regards,

Anne

Op dinsdag 20 november 2018 23:35:56 UTC+1 schreef Shawn Galante:

Shawn Galante

unread,
Nov 21, 2018, 11:22:34 AM11/21/18
to robotframe...@googlegroups.com
I have tried the latest 2.44 without solving the issue and I have tried to use both the chromium-browser and the google-chrome-stable browser specified in the selenium webdriver chrome options.py file.  I have a basic Docker file that runs python2.7:alpine and one that runs ubuntu:18.10 and all they do is install the following:
Alpine images installs:
apk add --no-cache udev chromium chromium-chromedriver ttf-freefont xvfb
pip install --pre --upgrade --no-cache-dir -U robotframework robotframework-seleniumlibrary selenium

Ubuntu image installs:
apt install python2.7 python-pip udev chromium-browser chromium-chromedriver xvfb
pip install robotframework robotframework-seleniumlibrary selenium

From there I can manually start the containers and shell into them and install whatever or change whatever.  I have tried to manually update and install the latest versions of ChromeDriver, changed countless chrome arguments to attempt to solve the issue but nothing gets rid of this:
WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/lib/chromium-browser/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
  (Driver info: chromedriver=2.44.609551 (5d576e9a44fe4c5b6a07e568f1ebc753f1214634),platform=Linux 3.10.0-693.17.1.el7.x86_64 x86_64)

What else can I do, even moving to Create WebDriver works but then presents me with an inability to authenticate into a basic OATH2 site even though credentials are correct the site submits them and returns an bad user name or password error message on the site which is incorrect.  What am I missing?

Anne kootstra

unread,
Nov 21, 2018, 1:52:26 PM11/21/18
to robotframework-users
In the referenced error the messages states that it expects Chrome to be here: /usr/bin/chromium-browser  is there anything in this location. An executable or a symbolic link? 

As for the auth error, that in my view is separate and likely unrelated. 

Kind regards,

Anne

Op woensdag 21 november 2018 17:22:34 UTC+1 schreef Shawn Galante:

Shawn Galante

unread,
Nov 21, 2018, 2:22:34 PM11/21/18
to robotframework-users
There is a link to the proper binary in that path yes.  Also I think this issue is directly related to the robotframework-seleniumlibrary.  I say this because once I rolled back to version 3.0.[0|1] I was able to use Open Browser without issue and the error message was gone.  This doesnt solve my issue however because a team member wants to use new Keywords in the library introduced in SeleniumLibrary 3.2

Tatu Aalto

unread,
Nov 22, 2018, 3:50:04 AM11/22/18
to shawng...@gmail.com, robotframework-users
Ugh

There are changes between 3.0 and 3.2 which are related for supporting headless Chrome and Firefox. This area has quite a lot tests which ensures that the browser should open correctly, but I have learned that it's always possible to find a corner cases which are not covered by the tests.  Therefore would it be possible get simplified example which demonstrates the problem and we all able to run? This would greatly improve the debugging possibilities from our side. Also would it be possible see to see the full stack trace, please run the test with `--loglevel trace` set from the command line. 

-Tatu 


On Wed, 21 Nov 2018, 21:22 Shawn Galante <shawng...@gmail.com wrote:
There is a link to the proper binary in that path yes.  Also I think this issue is directly related to the robotframework-seleniumlibrary.  I say this because once I rolled back to version 3.0.[0|1] I was able to use Open Browser without issue and the error message was gone.  This doesnt solve my issue however because a team member wants to use new Keywords in the library introduced in SeleniumLibrary 3.2

--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

Shawn Galante

unread,
Nov 22, 2018, 11:58:04 AM11/22/18
to robotframework-users
Using this test:
*** Settings ***
Documentation  Testing Robot in Ubuntu
Library        SeleniumLibrary
Test Teardown  Close All Browsers

*** Test Cases ***
Test Chrome
  Open Browser  http://google.com  Chrome

Test Headless Chrome
  Open Browser  http://google.com  headlesschrome

Test Chrome with CreateWebdriver
  ${chrome options} =     Evaluate    sys.modules['selenium.webdriver'].ChromeOptions()    sys, selenium.webdriver
  Call Method    ${chrome options}   add_argument    headless
  Call Method    ${chrome options}   add_argument    disable-gpu
  Create Webdriver    Chrome    chrome_options=${chrome options}
  Set Window Size    1920    1080
  Go To    https://google.com

With this Docker build:
FROM python:2.7-alpine3.8
#Needed packages to test
RUN apk add --no-cache udev chromium chromium-chromedriver ttf-freefont xvfb
#Needed robot packages
RUN pip install --pre --upgrade --no-cache-dir -U robotframework robotframework-seleniumlibrary selenium
#Embed the no sandbox and disable gpu into the chrome arguments
RUN sed -i "s/self._arguments\ =\ \[\]/self._arguments\ =\ \['--no-sandbox',\ '--disable-gpu'\]/" /usr/local/lib/python2.7/site-packages/selenium/webdriver/chrome/options.py

I get this trace output in the log.report:
TEST Test Chrome
Full Name:Test.Test Chrome
Start / End / Elapsed:20181122 11:52:11.600 / 20181122 11:52:13.596 / 00:00:01.996
Status:FAIL (critical)
Message:WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/lib/chromium-browser/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.) (Driver info: chromedriver=2.44.609551 (5d576e9a44fe4c5b6a07e568f1ebc753f1214634),platform=Linux 3.10.0-693.17.1.el7.x86_64 x86_64)
00:00:01.994KEYWORD Open Google
Start / End / Elapsed:20181122 11:52:11.601 / 20181122 11:52:13.595 / 00:00:01.994
00:00:01.993KEYWORD SeleniumLibrary . Open Browser http://google.com, Chrome
Documentation:

Opens a new browser instance to the given url.

Start / End / Elapsed:20181122 11:52:11.601 / 20181122 11:52:13.594 / 00:00:01.993
00:00:00.001KEYWORD SeleniumLibrary . Capture Page Screenshot
11:52:11.602TRACEArguments: [ 'http://google.com' | 'Chrome' ]
11:52:11.602INFOOpening browser 'Chrome' to base url 'http://google.com'.
11:52:13.525DEBUGPOST http://127.0.0.1:52399/session {"capabilities": {"alwaysMatch": {"browserName": "chrome", "platformName": "any"}, "firstMatch": [{}]}, "desiredCapabilities": {"platform": "ANY", "browserName": "chrome", "version": ""}}
11:52:13.526DEBUGStarting new HTTP connection (1): 127.0.0.1:52399
11:52:13.587DEBUGhttp://127.0.0.1:52399 "POST /session HTTP/1.1" 200 496
11:52:13.587DEBUGFinished Request
11:52:13.594FAILWebDriverException: Message: unknown error: Chrome failed to start: exited abnormally (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/lib/chromium-browser/chromium-browser is no longer running, so ChromeDriver is assuming that Chrome has crashed.) (Driver info: chromedriver=2.44.609551 (5d576e9a44fe4c5b6a07e568f1ebc753f1214634),platform=Linux 3.10.0-693.17.1.el7.x86_64 x86_64)
11:52:13.594DEBUGTraceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/SeleniumLibrary/__init__.py", line 369, in run_keyword return DynamicCore.run_keyword(self, name, args, kwargs) File "/usr/local/lib/python2.7/dist-packages/SeleniumLibrary/base/robotlibcore.py", line 102, in run_keyword return self.keywords[name](*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/SeleniumLibrary/keywords/browsermanagement.py", line 131, in open_browser ff_profile_dir, remote_url) File "/usr/local/lib/python2.7/dist-packages/SeleniumLibrary/keywords/browsermanagement.py", line 456, in _make_driver remote_url=remote, profile_dir=profile_dir) File "/usr/local/lib/python2.7/dist-packages/SeleniumLibrary/keywords/webdrivertools.py", line 58, in create_driver return creation_method(desired_capabilities, remote_url) File "/usr/local/lib/python2.7/dist-packages/SeleniumLibrary/keywords/webdrivertools.py", line 85, in create_chrome options=options) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 81, in __init__ desired_capabilities=desired_capabilities) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__ self.start_session(capabilities, browser_profile) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace)

Shawn Galante

unread,
Nov 29, 2018, 10:09:02 AM11/29/18
to robotframework-users
Ended up working with a DEV, turned out to be a defect:
https://github.com/robotframework/SeleniumLibrary/issues/1243
Reply all
Reply to author
Forward
0 new messages