Slove unknown error: DevToolsActivePort file doesn’t exist – Selenium issue with Chrome Browser

Selenium Chrome Browser

I am facing the below issue when trying with chrome browser, tried many different options but didn’t work. Please scroll below for stack trace.

Error:
Exception in thread “main” org.openqa.selenium.WebDriverException: 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.)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:48’
System info: host: ‘BLRWX11704’, ip: ‘10.31.70.202’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_151’
Driver info: driver.version: ChromeDriver

Selenium issue with Chrome Browser

Please suggest how to resolve this.

  • Please find below details. Here is the details on the issue I am facing .
  • OS – Windows 10
  • Java – 64 bit JDK 1.8.0_241 and JRE 1.8.0_241
  • Eclipse Photon IDE
  • selenium – 3.141.59
  • Chrome Browser Version – 81.0.4044.113 (Official Build) (64-bit)
  • Chrome Driver Version – 81.0.4044.69

Solution fix this error:

Make new Function to creat WebDriver, not call WebDriver in the same function.

private IWebDriver ExcuseBrowser()
{
ChromeOptions options= new ChromeOptions();
if (File.Exists(“C:\Program Files (x86)\Google\Chrome\Application\Chrome.exe”))
{
options.BinaryLocation = “C:\Program Files (x86)\Google\Chrome\Application\Chrome.exe”;
}
options.AddArgument(“–disable-gpu”);
options.AddArgument(“–log-level=3”);
options.AddArgument(“–test-type”);
options.AddArgument(“–disable-default-apps”);
options.AddArgument(“–disable-volume-adjust-sound”);
options.AddArgument(“–mute-audio”);
options.AddArgument(“–disable-blink-features=AutomationControlled”);
options.AddArgument(“–no-sandbox”);
options.AddArgument(“–disable-dev-shm-usage”);
options.AddExcludedArgument(“enable-automation”);
options.AddAdditionalCapability(“useAutomationExtension”, false);
options.AddUserProfilePreference(“credentials_enable_service”, false);
options.AddUserProfilePreference(“profile.password_manager_enabled”, false);
ChromeDriverService chromeDriverService = ChromeDriverService.CreateDefaultService();
chromeDriverService.HideCommandPromptWindow = true;
return new ChromeDriver(chromeDriverService, options);
}

And Call IWebDriver in Action Function

private void Action(){
IWebDriver driver = ExcuseBrowser();
if (driver == null) return;
.
.
.<continue code>
}

Subscribe
Notify of
guest
0 Bình luận
Cũ nhất
Mới nhất Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x