如果仍然存在此问题,则会发生错误,因为每次运行测试时您都会打开chrome浏览器的全新实例,从而触发EULA。如果您将默认的chrome配置文件复制到您选择的自定义位置,然后将“
–user-data-dir = yourcustomlocation”标志添加到ChromeOptions,则可以绕过EULA并打开现有的配置文件。
ChromeOptions crOptions = new ChromeOptions();crOptions.AddArgument(@"--user-data-dir=C:custom location"); return new ChromDriver(crOptions);



