Dakota Bartell
Dakota Bartell

Reputation: 1

Selenium/ChromeDriver Issues

I have been using webdriver for a while but was trying to polish up some old code when this started to happen:

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 112 Current browser version is 108.0.5359.125 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

Thought that's weird, didn't realize stuff was outdated.

I checked my chrome version but it shows as 112. Found the 108 folder in my AppData, deleted it, but then things got really screw and it's not even opening (then forceclosing) a window. It just gives me this: selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed. (unknown error: DevToolsActivePort file doesn't exist) (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.)

Regardless of if the 108 file exists, manually using chrome works just fine but for some reason chromedriver gets all screwy otherwise.

I've tried uninstalling and reinstalling chromedriver, google, etc. Nothing seems to work anymore with the webdriver code and I'm not sure why.

Upvotes: 0

Views: 349

Answers (1)

Abhay Chaudhary
Abhay Chaudhary

Reputation: 2053

In ChromeOptions, it is possible to indicate a location that is not the default for the Chrome binary. can you provide the path for the chrome binary like below , pass the option to chromeDriver and try running it

For Java

  ChromeOptions options = new ChromeOptions();
  options.setBinary("/path/to/other/chrome/binary.exe");
  WebDriver driver = new ChromeDriver(options);

For Python

    from selenium import webdriver
    from selenium.webdriver.chrome.options import Options
    options = Options()
    options.binary_location = "/path/to/other/chrome/binary/chrome.exe"
    driver = webdriver.Chrome(chrome_options=options, executable_path="pathto/chromedriver.exe" )

Upvotes: 0

Related Questions