WebDriverException:未知错误:尝试启动Chrome浏览器时DevToolsActivePort文件不存在 [英] WebDriverException: unknown error: DevToolsActivePort file doesn't exist while trying to initiate Chrome Browser
问题描述
我正在尝试使用URL启动chrome,浏览器启动,此后它什么也不做.
I am trying to launch chrome with an URL, the browser launches and it does nothing after that.
1分钟后我看到以下错误:
I am seeing the below error after 1 minute:
Unable to open browser with url: 'https://www.google.com' (Root cause: org.openqa.selenium.WebDriverException: unknown error: DevToolsActivePort file doesn't exist
(Driver info: chromedriver=2.39.562718 (9a2698cba08cf5a471a29d30c8b3e12becabb0e9),platform=Windows NT 10.0.15063 x86_64) (WARNING: The server did not provide any stacktrace information)
我的配置:
- Chrome浏览器:66
- ChromeBrowser:2.39.56
PS 在Firefox中一切正常
P.S everything works fine in Firefox
推荐答案
更新:
我能够解决问题,现在我可以使用所需的网址访问chrome.
I am able to get through the issue and now I am able to access the chrome with desired url.
尝试提供的解决方案的结果:
我尝试了上面提供的所有设置,但无法解决问题
I tried all the settings as provided above but I was unable to resolve the issue
有关该问题的说明:
根据我的观察,当chrome无法在scoped_dirXXXXX文件夹中找到其引用时,导致DevToolsActivePort文件不存在.
As per my observation DevToolsActivePort file doesn't exist is caused when chrome is unable to find its reference in scoped_dirXXXXX folder.
为解决该问题而采取的步骤
- 我杀死了所有chrome进程和chrome驱动程序进程.
-
添加了以下代码以调用chrome
- 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.
感谢您的回答.
这篇关于WebDriverException:未知错误:尝试启动Chrome浏览器时DevToolsActivePort文件不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!