The process started from chrome location C:\..\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed
Asked Answered
V

7

3

Chrome version: 68.0.3440.106
Chrome webdriver version: ChromeDriver 2.41.578737
Python Version : Python 3.5.2

I write this code in python:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys


o = webdriver.ChromeOptions()
o.add_argument("disable-extensions");
o.add_argument("--start-maximized");
driver = webdriver.Chrome(executable_path=r"chromedriver.exe",options=o)
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()

after few seconds chrome opened with this error:


and nothing happend till i close chrome and get this exception:

    Traceback (most recent call last):
  File ".../game.py", line 8, in <module>
    driver = webdriver.Chrome(executable_path=r"chromedriver.exe",options=o)
  File "...\Python\Python35-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 75, in __init__
    desired_capabilities=desired_capabilities)
  File "...\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 156, in __init__
    self.start_session(capabilities, browser_profile)
  File "...\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 251, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "...\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 320, in execute
    self.error_handler.check_response(response)
  File "...\Python\Python35-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited normally
  (unknown error: unable to discover open pages)
  (The process started from chrome location C:\Program Files (x86)\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
  (Driver info: chromedriver=2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 10.0.17134 x86_64)
Vada answered 24/8, 2018 at 17:37 Comment(3)
see this post: Selenium Crashing: Chrome automation extension has crashedBarde
saw, didn't helped.Vada
you are not using correct argument, use: o.add_argument("--disable-extensions");Barde
B
1

use correct argument for disabling extension:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
o = Options()
#o.add_argument("--disable-extensions"); #here
o.add_experimental_option("useAutomationExtension", false); #you can try this as well
o.add_argument("--start-maximized");
driver = webdriver.Chrome(executable_path=r"chromedriver.exe",chrome_options=o)
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()
Barde answered 24/8, 2018 at 18:2 Comment(3)
you can try one more option: o.setExperimentalOption("useAutomationExtension", false); This capability will help to not load Chrome Automation extension. I have updated my answer.Barde
still didn't work, in python is o.add_experimental_option("useAutomationExtension", False)Vada
my bad, you are right. I mixed up python and java. Btw are you still getting same error?Barde
T
1

Today I was the same trouble and I fixed using:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys


o = webdriver.ChromeOptions()
o.add_argument("disable-extensions")
o.add_argument("--start-maximized")
o.binary_location = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ## This line define path of browser. In this case, Google Chrome
driver = webdriver.Chrome(executable_path=r"chromedriver.exe",options=o)
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()
Trigonous answered 15/4, 2020 at 20:44 Comment(2)
Can you explain which part you changed to fix this issue?Diarist
Oliver, add this line: o.binary_location = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ## This line define path of browser. In this case, Google ChromeTrigonous
L
1

I recently had this issue using TeamCity, which was caused by chrome (and chromedriver) not shutting down after executing my script. inserting "taskkill /f /im chrome.exe" and "taskkill /f /im chromedriver.exe" fixed this issue.

Lounging answered 27/10, 2021 at 8:27 Comment(0)
G
0

This error message...

selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited normally
  (unknown error: unable to discover open pages)
  (The process started from chrome location C:\Program Files (x86)\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

...implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. Chrome Browser session.

Your main issue seems that the chrome binary i.e. chrome.exe and the associated files are no more available/accessible from the default location of:

C:\Program Files (x86)\Google\Chrome\Application\

The possible reasons are:


Additional considerations

  • Chrome and ChromeDriver are present in the desired location.
  • Chrome and ChromeDriver are having executable permission for non-root (non-administrator) users.
  • Upgrade Selenium to current levels Version 3.14.0.
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • (WindowsOS only) Use CCleaner tool to wipe off all the OS chores before and after the execution of your Test Suite.
  • (LinuxOS only) Free Up and Release the Unused/Cached Memory in Ubuntu/Linux Mint before and after the execution of your Test Suite.
  • If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Execute your @Test as a non-root user.
  • Run the selenium server with webdriver-manager start from the machine with the desktop (don't use a remote session to start the selenium server).
Gawlas answered 24/8, 2018 at 20:5 Comment(1)
The chrome was opened but after I close the window (after alot of time without any response but the error massage) I get this exception, your answer doesn't help me at all, but thanks for the try.Vada
A
0

In case anyone is here now, I had this same issue and I passed --no-sandbox argument and it worked. Give it a shot.

chrome_options.add_argument('--no-sandbox')
Adabelle answered 22/3, 2023 at 12:9 Comment(0)
S
0
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
o = Options()
o.add_argument('--no-sandbox')
driver = webdriver.Chrome(executable_path=r"chromedriver.exe",chrome_options=o)

It worked for me.

Snuff answered 2/4, 2023 at 7:18 Comment(1)
Answer needs supporting information Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Gamin
B
-1

We faced this issue using Java, Cucumber, Maven, Serenity, and IntelliJ. After trying everything the solution was so easy:

Just run IntelliJ as administrator.

Butternut answered 16/2, 2023 at 9:51 Comment(1)
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From ReviewEcto

© 2022 - 2024 — McMap. All rights reserved.