1

Apologies if this has been answered elsewhere (I'm sure it will have been) but I've spent the past few days searching high and low, trying all the solutions I've come across.

I've been trying to automate some form completion on Chrome using Selenium and Python.
My solution works fine on a personal device but on my company machine I've been hitting some issues.

Running my test code, originally produced the "DevToolsActivePort file doesn't exist" error but I managed to get around that.
The script now opens a Chrome window but then produces an error:

selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed. (chrome not reachable) (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.)

This is whilst the Chrome window does open and remains open. Unfortunately with this being a work machine I am unable to reinstall windows or Python at this time.

I've checked the versions and everything appears to line up.

Python: 3.7.0

Selenium: 3.141.0

Chrome: 91.0.4472.114

ChromeDriver: 91.0.4472.101 (also tried other versions)

Code Used:

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument("--no-sandbox") 
options.add_argument("--disable-setuid-sandbox") 
options.add_argument("--remote-debugging-port=9222")
options.binary_location = "C:\Program Files\Google\Chrome\Application\chrome.exe"
options.add_argument("--disable-dev-shm-using") 
options.add_argument("--disable-extensions") 
options.add_experimental_option("useAutomationExtension", True) #also tried False
options.add_argument("--disable-gpu") 
options.add_argument("start-maximized") 
options.add_argument("disable-infobars")
options.add_argument("user-data-dir=C:\\Users\\UP1170\\AppData\\Local\\Google\\Chrome\\User Data")
options.add_experimental_option("detach",True)
driver = webdriver.Chrome(chrome_options=options,executable_path="C:\\Users\\UP1170\\Desktop\\chromedriver.exe")
driver.get("https://www.google.com")

This is not the full code I've developed for the automation but a test script to just try and get Chrome to open on a company windows 10 laptop.

Anyone have any ideas?

I've got a feeling it's going to be linked to a company restriction placed on my device as a similar issue occurs when I've attempted this with both Firefox and Edge.

Ozzie86_uk
  • 11
  • 1
  • Are settings: `options.add_argument("user-data-dir=C:\\Users\\UP1170\\AppData\\Local\\Google\\Chrome\\User Data")` and `driver = webdriver.Chrome(chrome_options=options,executable_path="C:\\Users\\UP1170\\Desktop\\chromedriver.exe")` matching your personal computor or was adjusted to fix your company laptop? – Prophet Aug 19 '21 at 09:02
  • Thanks for the reply. Adjusted to match the company laptop. The entire code is a redo to fix the issue. My original just calls the webdriver and uses .get() – Ozzie86_uk Aug 19 '21 at 09:12
  • If so I don't understand why have you added all these settings... – Prophet Aug 19 '21 at 09:16
  • Without these settings, I seem to get the DevToolsActivePort file doesn't exist error instead. – Ozzie86_uk Aug 19 '21 at 09:22
  • OK, I understand. Nor sure I can help here remotely. – Prophet Aug 19 '21 at 09:23
  • Thanks anyway. I've tried removing the additional settings and I get that DevToolsActivePort file error, these settings are the only way it appears to actually open Chrome. It's just odd that it opens Chrome and then tells me that Chrome is not reachable and it might have crashed but it's there and usable. – Ozzie86_uk Aug 19 '21 at 09:25

0 Answers0