Pythonanywhere | Selenium Chrome - selenium

I do it with the same code. Also add no --no-sandbox.
But not working.
I get this one:
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed
(chrome not reachable)
(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.42.591071 (0b695ff80972cc1a65a5cd643186d2ae582cd4ac),platform=Linux 5.4.0-1038-aws x86_64)

In general, when you are getting a crash starting Chrome on PythonAnywhere, it's because you have been leaving processes running by not properly closing the browser in your code. Search for "selenium" on the PythonAnywhere help pages for example code that properly closes Chrome and also shows parameters that you should use.

Related

unknown error: Chrome failed to start: exited normally. (unknown error: DevToolsActivePort file doesn't exist)

I have been trying to figure out an issue I have been experiencing with Selenium + Chrome driver since mid-November where when it tries to start Chrome it gives the following error:
Exception calling ".ctor" with "2" argument(s): "unknown error: Chrome failed to start: exited normally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location C:\Program Files\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)"
The issue just started happening and no updates were made to Chrome, the Chrome driver, or even the Selenium web driver. I have tried to update to the latest versions of Chrome (currently Version 108.0.5359.99 (Official Build) (32-bit)), Chrome Driver (108.0.5359.71), and Selenium Web Driver (C# 4.7.0) but the issue persists.

Selenium error WebDriverException: Message: unknown error: Could not remove old devtools port

Currently I am facing this issue on selenium chrome with python 2.7
WebDriverException: Message: unknown error: Could not remove old devtools port file. Perhaps the given user-data-dir at /path/to/folder/ is still attached to a running Chrome or Chromium process
I check on that folder, the folder is empty. Can someone explain to me what happen?

How to start Chrome in a real browser with Selenium

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.

Jenkins can't launch real browser on Ubuntu 16.04

I've selenium script which launches chrome browser, goes to a website and does basic checks.
When I tried running same script locally through jenkins I got error
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.33.506092 (733a02544d189eeb751fe0d7ddca79a0ee28cce4),platform=Linux 4.13.0-17-generic x86_64)
This is resolved by Unknown error: Chrome failed to start: exited abnormally
I'm confused why Jenkins can't launch real chrome browser on Ubuntu ?
Because Jenkins server normally does not have a graphical subsystem installed in the operating system. When a real browser (or any app) tries to create a window that fails.
You will need to run your tests on Jenkins using a headless browser - one that does not need a graphical subsystem. Chrome-headless is currently the preferred option, replacing the now abandoned PhantomJS.

Chrome driver exception on Jenkins

I have selenium 2.53.1.jar, platform-Windows, Java- 1.8, chrome = 52.0, chrome-driver.exe-2.23.
I am seeing the following message when trying to run Night watch test on Jenkins.
org.openqa.selenium.WebDriverException: unknown error: unable to
discover open pages (Driver info: chromedriver=2.23.409699
(49b0fa931cda1caad0ae15b7d1b68004acd05129),platform=Windows NT
6.3.9600 x86_64)
Please note that the test is running correctly from the command line- all paths given are same as in the Jenkins job.
I also tried a previous version 2.22 of Chrome driver. Still see the same error.
Test is running correctly on FF.
Even I'm getting the same error. Maybe you can try putting sand-box for chrome. Maybe that might help you out temporarily.