"unknown error: DevToolsActivePort file doesn't exist" error is displayed in console on executing test in Chrome browser

Hi All,

I have a Automation framework and i am able to execute test in Firefox browser. Sudden, i got requirement to run test in Chrome browser.
I have put Chrome driver and update driver class with following code:

String chromeDriverPath = "Path/chromedriver.exe";
System.setProperty("webdriver.chrome.driver", chromeDriverPath);
WebDriver driver = new ChromeDriver();

But when i execute test case, i got below error message:
org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn’t exist.

Can anybody help me to resolve the issue? Thanks in advance.

from github, try chrome_options.add_argument('--no-sandbox').
Found this by googling the error message…

This error message show that the ChromeDriver was not able to initiate a new Chrome Browser session.

If you update you code to initiate a new Chrome Browser session then update using below code:

ChromeOptions options = new ChromeOptions();
options.addArguments("–no-sandbox");
options.addArguments("–disable-dev-shm-usage");
options.setExperimentalOption(“useAutomationExtension”, false);
WebDriver driver = new ChromeDriver(options);

This error probably caused as DevToolsActivePort file wasn’t exist in machine is caused the error when chrome is unable to find its reference in folder.

In top software testing companies, we use both FF and Chrome browsers for running the automation suites. So, it is best recommended to use multiple browsers for running the suites. If our scripts are running in multiple browser then it will be like that of cross-browser testing.

Hope the solution resolves your issue. Please let me know if you need any further assistance.

1 Like

Thank you for solution. It resolved my issue.

1 Like