I checked the versions on a different machine and saw that this combo worked: # Below combo works ![]() I then downgraded Chrome and ChromeDriver to 1.74 but still faced the same error. Versions at the time of the initial error: # Below combo does NOT work After trying all sorts of solutions on this thread, it finally occurred to me that the Chrome version might not be compatible with the Selenium version. Seleniumn and Chrome were working fine until a few days ago and I started getting this missing DevToolsActivePort issue. Self.driver = webdriver.Chrome(chrome_options=chrome_options, desired_capabilities=capabilities)įor me, the root issue was that the google-chrome/chromedriver version were not compatible with the Selenium version. from selenium import webdriverįrom import WebDriverException It solved the issue I was having not elegantly but it works. If it hits the Webdriver exception it waits ten seconds and tries again. Unable to resolve the issue, in Python I wrapped the driver = webdriver.Chrome() in a try.except block in setUp() in my test case class that all my tests are derived from. On average one of every few hundred tests would fail, then the next test would run fine. ![]() This error has been happening randomly during my test runs over the last six months (still happens with Chrome 76 and Chromedriver 76) and only on Linux. WebDriver driver = new ChromeDriver(opt) tExperimentalOption("useAutomationExtension", false) tExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation")) Opt.setBinary("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe") //chrome binary location specified here Java Solution: tProperty("", "C:\\Utility\\BrowserDrivers\\chromedriver.exe") Options.add_experimental_option('useAutomationExtension', False)ĭriver = webdriver.Chrome(options=options, executable_path=r'C:\path\to\chromedriver.exe') Options.add_experimental_option("excludeSwitches", ) Options.add_argument("-disable-dev-shm-usage") #overcome limited resource problems Options.add_argument("-no-sandbox") #bypass OS security model Options.add_argument("-start-maximized") #open Browser in maximized mode Options.binary_location = "C:\\path\\to\\chrome.exe" #chrome binary location specified here Python Solution: from selenium import webdriverįrom import Options In case you are using a Chrome executable in a non-standard location you have to override the Chrome binary location as follows: ChromeDriver expects you to have Chrome installed in the default location for each system as per the image below:ġFor Linux systems, the ChromeDriver expects /usr/bin/google-chrome to be a symlink to the actual Chrome binary. Your main issue is the Chrome browser is not installed at the default location within your system. implies that the ChromeDriver was unable to initiate/spawn a new WebBrowser i.e. : Message: unknown error: Chrome failed to start: crashed (The process started from chrome location /opt/google/chrome/google-chrome is no longer running, so chromedriver is assuming that Chrome has crashed.) I have the latest chrome version and chromedriver installed.Īfter trying solution I am getting the following error. (The process started from chrome location /opt/google/chrome/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) (unknown error: DevToolsActivePort file doesn't exist) I get the following error: : Message: unknown error: Chrome failed to start: crashed from selenium import webdriverĭ = webdriver.Chrome('/home/PycharmProjects/chromedriver') I've also tried Firefox but the browser instance just doesn't launch. Recently I switched computers and since then I can't launch chrome with selenium.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |