selenium-chromedriver - 如何通过 Selenium 4 运行特定的浏览器?
问题描述
你能帮我吗?
我应该使用“Selenium 4.0.0-beta2”,但我无法运行自定义驱动程序和自定义浏览器
我的 3.14 解决方案(效果很好):
ChromeOptions options = new ChromeOptions();
options.BinaryLocation = @"c:\Temp\MySpecificBrowser.exe";
new ChromeDriver(@"c:\Temp\chrome_driver_path", options);
我的 4.0 beta 解决方案:
var service = ChromeDriverService.CreateDefaultService(@"c:\Temp\chrome_driver_path", @"c:\Temp\MySpecificBrowser.exe");
var driver = new ChromeDriver(service);
我的自定义浏览器已打开,但出现错误:OpenQA.Selenium.WebDriverException: 'Cannot start the driver service on http://localhost:5055/'
我的解决方案不正确还是 Selenium 4 beta 的缺陷?
解决方案
推荐阅读
- terraform - 在 aws_iam_policy_document 中使用值列表中的值创建多个语句 (TF 1.13)
- javascript - 即使弹出窗口关闭,如何使 chrome 扩展脚本仍然有效?
- c# - 如何根据单个 ASP.NET Core 应用程序中的内容动态更改 OpenID 配置?
- python - 如何在实用程序节点之间获取属性的动画曲线?
- javascript - Redux - 调度动作(onClick 事件)
- karate - 空手道中的 Swtich 浏览器
- vue.js - Vue 将组件 1 中的数据传递给组件 2 中的方法
- flutter - 在将数据从 API 加载到 Flutter 中的 ListView 时加载微调器
- r - 如何根据值和积分该值的微积分结果填充新数据框?
- typescript - TypeScript 不推断特定类型