WebDriverException: unknown error: DevToolsActivePort file doesn't exist while trying to initiate Chrome Browser
Update:
I am able to get through the issue and now I am able to access the chrome with desired url.
Results of trying the provided solutions:
I tried all the settings as provided above but I was unable to resolve the issue
Explanation regarding the issue:
As per my observation DevToolsActivePort file doesn't exist is caused when chrome is unable to find its reference in scoped_dirXXXXX folder.
Steps taken to solve the issue
- I have killed all the chrome processes and chrome driver processes.
Added the below code to invoke the chrome
System.setProperty("webdriver.chrome.driver","pathto\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("useAutomationExtension", false);
WebDriver driver = new ChromeDriver(options);
driver.get(url);
Using the above steps I was able to resolve the issue.
Thanks for your answers.
selenium.common.exceptions.WebDriverException: Message: unknown error: DevToolsActivePort file doesn't exist with chromium browser and Selenium Python
I solved the problem by reinstalling chromium through apt sudo apt install chromium-browser
(before that it was installed through snap). My working code looks like this
options = Options()
options.add_argument("start-maximized")
options.add_argument("disable-infobars")
options.add_argument("--disable-extensions")
options.add_argument("--disable-dev-shm-usage")
options.add_argument("--no-sandbox")
if headless:
options.add_argument('--headless')
options.binary_location = "/usr/bin/chromium-browser"
self.driver = webdriver.Chrome(options=options)
Selenium: WebDriverException:Chrome failed to start: crashed as google-chrome is no longer running so ChromeDriver is assuming that Chrome has crashed
Try to download HERE and use this latest chrome driver version:
- https://sites.google.com/chromium.org/driver/
Try this:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
d = webdriver.Chrome('/home/<user>/chromedriver',chrome_options=chrome_options)
d.get('https://www.google.nl/')
WebDriverException: Chrome failed to start: exited abnormally (unknown error: DevToolsActivePort file doesn't exist)
This is for java, but I think it should work for you to:
https://github.com/SeleniumHQ/selenium/issues/4961#issuecomment-346821657
It says that is is a permission issue. Try running your program as root.
WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally using Selenium ChromeDriver and Chrome through WebDriverManager
You need to take care of a couple of things here as follows:
You need
webdriver.Chrome()
only once. If you don't need the arguments throughOptions()
keep:driver = webdriver.Chrome(service=service)
and remove:
driver = webdriver.Chrome(ChromeDriverManager().install(),options=chrome_options)
or vice versa.
If you are executing as a non-root using
add_argument('--headless')
generally you may not even require the following arguments:add_argument('--no-sandbox')
add_argument('--disable-dev-shm-usage')
You can try to initiate the new Browsing Context i.e. google-chrome-headless using:
driver = webdriver.Chrome(service=ChromeDriverManager().install(), options=chrome_options)
Your effective code block will be:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
chrome_options = Options()
chrome_options.add_argument('--headless')
# optional
chrome_options.add_argument('--no-sandbox')
# optional
chrome_options.add_argument('--disable-dev-shm-usage')
driver = webdriver.Chrome(ChromeDriverManager().install(),options=chrome_options)
driver.get('http://192.168.15.1/me_configuracao_avancada.asp')
Note: Ensure that you have installed webdriver-manager and Chrome browser within your system before you kickoff your test execution.
Related Topics
G++ Error: Expected ; Before "It"
What's The Best Way to Move a Directory into Place in a Makefile Install
Set Preferred Listen Address in Weblogic 11G
"Sudo" Fails with "Sudo Requires a Tty" When Executed from Putty Command Line
How to Populate /Dev with a Custom Directory with Udev
Most Efficient Way to Concatenate Thousands of Files in Perl
Search Ip from a Text File in .Csv Log File, If Found Add New Column Next to It
Headless Protractor Tests Don't Plug on Xvfb
How to Write Content to File on Linux Sftp Server Using Sshclient
Few Shell Commands Doesn't Work When I Invoke a Script via Qprocess in Qt
Why Proc Process Faster Than Others
Linux History of All Commands Executed During Whole Day, Everyday