0

I want to launch Chrome as real browser, with Selenium.

I want to use Chrome extensions, so I want to launch a real browser instead of headless Chrome.

On Mac, this code will successfully launch the Chrome browser

# Selenium ruby
options = Selenium::WebDriver::Chrome::Options.new
::Selenium::WebDriver.for :chrome, options: options

However, when I run the same code on Ubuntu, I get an error.

# error
unknown error: Chrome failed to start: exited abnormally. (Selenium::WebDriver::Error::UnknownError)
  (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.)

When I tried to call the command directly to chrome, I got the following error.

$ google-chrome
No protocol specified
[16445:16445:0220/022600.429383:ERROR:browser_main_loop.cc(1438)] Unable to open X display.

Please Help me.

  • Does this answer your question? [WebDriverException: unknown error: DevToolsActivePort file doesn't exist while trying to initiate Chrome Browser](https://stackoverflow.com/questions/50642308/webdriverexception-unknown-error-devtoolsactiveport-file-doesnt-exist-while-t) – K. B. Feb 20 '21 at 07:53
  • https://stackoverflow.com/a/61043049/6793637 – PDHide Feb 20 '21 at 09:07

0 Answers0