Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Selenium-尝试使用特定profil启动多个实例时出现异常_C#_Selenium_Selenium Chromedriver - Fatal编程技术网

C# Selenium-尝试使用特定profil启动多个实例时出现异常

C# Selenium-尝试使用特定profil启动多个实例时出现异常,c#,selenium,selenium-chromedriver,C#,Selenium,Selenium Chromedriver,我需要启动几个Chromedriver实例,并使用一个特定的chrom配置文件,对所有实例都是一样的。 我对他的初审没有异议。 但当我尝试创建一个新实例时,例外情况是: [2928:8456:0419/220244.606:ERROR:cache_util_win.cc(21)] Unable to move the cache: Access is denied. (0x5) [2928:8456:0419/220244.608:ERROR:cache_util.cc(138)] Unable

我需要启动几个
Chromedriver
实例,并使用一个特定的chrom配置文件,对所有实例都是一样的。 我对他的初审没有异议。 但当我尝试创建一个新实例时,例外情况是:

[2928:8456:0419/220244.606:ERROR:cache_util_win.cc(21)] Unable to move the cache: Access is denied. (0x5)
[2928:8456:0419/220244.608:ERROR:cache_util.cc(138)] Unable to move cache folder C:\Users\Name\AppData\Local\Google\Chrome\User Data\Profile 1\ShaderCache\GPUCache to C:\Users\Name\AppData\Local\Google\Chrome\User Data\Profile 1\ShaderCache\old_GPUCache_000
[2928:8456:0419/220244.618:ERROR:disk_cache.cc(184)] Unable to create cache
[2928:8456:0419/220244.619:ERROR:shader_disk_cache.cc(606)] Shader Cache Creation failed: -2
Opening in existing browser session.
另外,如果我创建了多个没有指定概要文件的实例,那么我没有问题

我不想使用多选项卡方法,因为我尝试过,每次在选项卡之间切换时都会设置焦点

我的c#代码:

ChromeDriver chromeDriver = null;
var options = new ChromeOptions();
options.AddArguments("user-data-dir=C:\\Users\\Name\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 1");
chromeDriver = new ChromeDriver(options);