I’m struggling with this error:
(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.)
while using selenium module on my Ubuntu-server 22.04. The thing is that the same code works fine on my local PC with the same Ubuntu version.
For avoiding trivial questions:
- driver location and binary location are correct
- I use –headless mode
- I have the same versions of google-chrome and chromedriver
Code:
# initial settings for selenium
driver_location = '/usr/bin/chromedriver'
binary_location = '/usr/bin/google-chrome'
options = Options()
options.binary_location = binary_location
options.add_argument('--headless')
service = Service(driver_location)
driver = webdriver.Chrome(service=service, options=options)
And again, I think I need somehow use the fact that this code works on my local PC. Maybe you guys can advise me what to check…
2
Answers
Replace:
with:
and execute your test.
I had the same issue with both chrome and edge in Ubuntu. I removed both chrome and edge and reinstalled edge. It could be caused by driver version.
This is what worked for me: