简体   繁体   English

同时运行多个Selenium Chrome配置文件

[英]Running Multiple Selenium Chrome Profile Simultaneously at the same time

First, this is not a duplicate question! 首先,这不是重复的问题! Read & watch before mark as a duplicate! 在标记为重复项之前阅读并观看! This question I ask about open multiple chrome profile using selenium c# and navigate about URL, not duplicate in this thread here as you mention, Ok? 这个问题我请教一下打开多个Chrome个人资料使用硒C#和导航有关的URL,而不是在这个线程复制在这里 ,你别说,好吗? Shame on your budgets and no help! 羞耻您的预算,没有帮助!

You have no Knowledge about Selenium and I don't want your answer to get out of my question ok? 您对硒不了解,我不希望您的答案摆脱我的疑问,好吗? DebanjanB DebanjanB


I would like to run multiple Selenium Chrome Portable Profile at the same time. 我想同时运行多个Selenium Chrome Portable Profile。 I would like to run more than one instance simultaneously. 我想同时运行多个实例。

And using 并使用

Navigate().GoToUrl("http://www.somesite.com");

If just one instance of the program is running everything goes fine. 如果仅该程序的一个实例正在运行,则一切正常。 If I start a second instance while the first one is running the browser is opened but the automation doesn't start. 如果在第一个实例正在运行时启动第二个实例,则会打开浏览器,但自动化不会启动。

This error appears: 出现此错误:

ChromeDriver driver = new ChromeDriver(service, options); ChromeDriver驱动程序=新的C​​hromeDriver(服务,选项); OpenQA.Selenium.WebDriverException: 'unknown error: Chrome failed to start: exited normally (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location D:\\GoogleChromePortable\\GoogleChromePortable.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.) OpenQA.Selenium.WebDriverException:'未知错误:Chrome无法启动:正常退出(未知错误:DevToolsActivePort文件不存在)(该进程从Chrome位置D:\\ GoogleChromePortable \\ GoogleChromePortable.exe开始,因此不再运行,因此ChromeDriver假设Chrome已崩溃。)

Everything is in this video: https://www.useloom.com/share/58725b7fdbb447df86b983107c3b35cf 一切都在此视频中: https : //www.useloom.com/share/58725b7fdbb447df86b983107c3b35cf

How can I open multiple chrome profile and each profile open the URL as described in the video! 如何打开多个Chrome配置文件,每个配置文件都按视频中的说明打开URL!

I'm using C# for selenium, chrome is version 68, chromedriver 2.41 ! 我正在使用C#硒,chrome是68版本, chromedriver 2.41 I'm using a custom profile and a ChromePortable binary. 我正在使用自定义配置文件和ChromePortable二进制文件。

Thanks! 谢谢!

This is due to same user-data-dir path configured for both instance. 这是由于为两个实例配置了相同的user-data-dir路径。 The user-data directory get locked by the first instance and the second instance fails with exception as the directory is in use. 用户数据目录被第一个实例锁定,而第二个实例由于使用目录而异常失败。 The solution is to use two different user-data directory for each driver. 解决方案是为每个驱动程序使用两个不同的用户数据目录。

Please read this answer for more details. 请阅读答案以获取更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM