I've spent several days trying to solve this issue I'm encountering with the following code:
caps = Selenium::WebDriver::Remote::Capabilities.chrome(
"chromeOptions" => {
:args => ['--user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36 LegalMonsterNoBlock"']
}
)
driver = Selenium::WebDriver.for :remote, url: selenium_host, :desired_capabilities => caps
driver.get(url)
I'm trying to run a test that calls this method. The test runs fine. It opens up Chrome runs the test, but whenever I reach the part of my application that calls the above method, the test fails with the following error:
Minitest::UnexpectedError: Selenium::WebDriver::Error::UnknownError: unknown error: Chrome failed to start: crashed
(chrome not reachable)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: '7a6aaccda364', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.121-linuxkit', java.version: '1.8.0_232'
Driver info: driver.version: unknown
remote stacktrace: #0 0x0040004b6479 <unknown>
My setup:
selenium-webdriver
version 3.142.3I have tried several things already:
--headless
, --no-sandbox
options to args
: args => ['--headless', '--no-sandbox' ...
Selenium::WebDriver::Chrome.path = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
and Selenium::WebDriver::Chrome.driver_path="/path/to/chrome_driver_binary/chromedriver"
)Any other experiencing such issues?
Go to system preferences, and you will see a 'security & privacy' option. Click into it and there should be a button that says 'allow and open anyways'. If it doesn't, try opening chrome driver again, wait for the error to pop up and then go to the system preferences again. Hope it helps.
Through WebDriver, Selenium supports all major browsers on the market such as Chrome/Chromium, Firefox, Internet Explorer, Edge, Opera, and Safari.
Now we need to move ChromeDriver somewhere that Python and Selenium will be able to find it (a.k.a. in your PATH ). The easiest place to put it is in C:\Windows . So move it there!
It turned out that it is my docker image, that does not support the arm64-architecture, so it was this step:
Running a docker selenium/standalone-chrome-debug:3.141.59-zinc
.
There was no issue if I disabled the part of the tests that used the docker container. I imagine this is no possible for everyone, but lets hope that there'll be a selenium image that will support arm64 architecture soon.
See Selenium issue here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With