【问题标题】:Selenium start chrome hidden C# [duplicate]Selenium 启动 chrome 隐藏 C# [重复]
【发布时间】:2016-06-08 09:39:45
【问题描述】:

我想隐藏启动 Chrome。我使用的是 2.21.0 版的 Web 驱动程序。

我试试这个:

ChromeOptions options = new ChromeOptions();
optionsChrome.AddArgument("--log-level=3");
IWebDriver driver = new ChromeDriver(options);

ChromeDriver(options); 有问题

字段初始值设定项不能引用非静态字段、方法或 属性 Form1.Options

如果可能的话,我希望完全隐藏启动 chrome,我该怎么做?

【问题讨论】:

  • 这与硒无关。您不能在字段初始化程序中引用任何字段。改用构造函数。请参阅您帖子上方的重复问题。

标签: c# google-chrome selenium selenium-webdriver


【解决方案1】:

这可能对您的搜索有所帮助。看起来它对 Firefox 的显示比对 Chrome 的显示更多,但它可能会有所帮助。 Can Selenium Webdriver open browser windows silently in background?

虽然ChromeDriver console application hide,这个看起来更接近您正在寻找的东西。

https://sqa.stackexchange.com/questions/2768/how-to-start-a-selenium2-webdriver-window-in-background

【讨论】:

    猜你喜欢
    • 2019-01-09
    • 2019-06-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-02
    相关资源
    最近更新 更多