Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. #324

Open
abirlal opened this issue Jan 18, 2021 · 7 comments

Comments

@abirlal
Copy link

abirlal commented Jan 18, 2021

After Selecting BROWSER=chrome getting error. Need help on it


Visit Google | FAIL |
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/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

Thanks in advance..!!

@ppodgorsek
Copy link
Owner

Do the logs show any specific message detailing the problem?
You can view the logs by following the Troubleshooting section in the README.

@ppodgorsek
Copy link
Owner

What is the status of this issue? Has it been resolved and can it be closed?

@mikevromen
Copy link

mikevromen commented May 3, 2021

Having the same issue, log folder stays empty.

Fixed it by making sure to chmod +x the .sh files

@Abdulhakimsg
Copy link

Abdulhakimsg commented Jun 23, 2022

Hey all

Unfortunately I'm also encountering the same issue on both browser library and selenium library. The error above occurs only if browser chosen is chrome. Firefox works fine for both libraries.

Browser Library
image

Selenium Library
image

I built the docker image and ran the container on an M1 ARM Macbook Pro. So far this this the only machine that i've tested on and most of my friends and work mates also use this machine so i'm not able to test this out on a x86/linux/amd64 machine.I would appreciate if anyone could take the time to let me know if they are also facing the same issue as well!

I've already tried changing the shm-size to a larger value as well.

I am hoping to completely rely on docker fully and not have to install any dependencies locally on my machine.

Any help, explanation and advice would be appreciated! I've been thinking about this problem for days now.

@ppodgorsek
Copy link
Owner

Do the Chrome logs show any specific message detailing the problem? Could you post them here please?
You can view the logs by following the Troubleshooting section in the README.

@Abdulhakimsg
Copy link

Abdulhakimsg commented Jul 1, 2022

Thank you for your reply @ppodgorsek. Hoping this would help those who encounter this issue as well.

So i've managed to make it work. The issue lies with webdriver not being able to communicate with chrome as i'm running an M1 Arm mac. You cannot use the official selenium or chrome image. you have to use the arm64 compatible image from the link below

To solve this, what i did was to run a standalone seleniarm-chrome docker container

# in shell/terminal

# Run Selenium Server with Chromium in standalone mode
docker run --name seleniarm-chromium --rm -it -p 4444:4444 -p 5900:5900 -p 7900:7900 --shm-size 3g seleniarm/standalone-chromium:latest

After wards in my test, i have a condition that if i'm running my test locally on chrome, i will connect to that arm64 chromium selenium server. Else, i'll just rely on firefox running in the docker container.

// test.robot

*** Settings ***
Library			SeleniumLibrary

*** Variables ***
${BROWSER}    %{E2E_BROWSER}
${ENV}    %{APP_ENV}

*** Test Cases ***
Determine mode
	IF	"${BROWSER}" == 'chrome' and "${ENV}" == 'testing'
        ${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
        ${options}    Call Method     ${chrome_options}    to_capabilities
        ${orig timeout} =	Set Selenium Timeout	15 seconds
        Open Browser    https://www.google.com    browser=${BROWSER}    remote_url=http://172.17.0.2:4444     desired_capabilities=${options}
	ELSE
        Open Browser    https://www.yahoo.com		${BROWSER}
	END

Capture SS
    Capture Page Screenshot
    Close Browser
# in shell/terminal
#Run e2e test
docker run --rm --platform linux/amd64 --name e2e-test --env-file .env.testing \
-v `pwd`/e2e/reports:/opt/robotframework/reports:Z \
-v `pwd`/e2e:/opt/robotframework/tests:Z \
ppodgorsek/robot-framework:latest

This whole M1 Arm mac unable to run webdriver/chromium issue is documented in the links below

This workflow is working for me. Would it be possible for users to choose to download selenium NOT using the official docker image but from the docker-seleniarm image instead?

@leiforion
Copy link

A few notes for those that run into this, and clarifications from what are above:

  • ARM Mac (M1, M2- and presumably future Chipsets) will not work properly, even if when on docker locally. I had to use a remove server.
  • If you are using selenium 4.0+ you may run into this issue depending on what you are trying to do and with what stack. I found that I had to move to an earlier release to get my code working properly.

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants