不显示命令提示符窗口

时间:2019-12-04 13:57:26

标签: c# selenium-webdriver selenium-chromedriver

我使用C#硒Webdriver 3.141 + chromedriver v78.0.3904.10500

我想显示以前的命令提示符窗口,但现在根本不显示

我发现HideCommandPromptWindow中的DriverService选项应该可以更改此行为,但是我仍然没有显示命令提示符窗口

var driverService = ChromeDriverService.CreateDefaultService();
driverService.HideCommandPromptWindow = false;
IWebDriver driver= new ChromeDriver(driverService, ChromeOptions);

private static ChromeOptions ChromeOptions
{
  get
  {
    var options = new ChromeOptions();

    options.AddArguments("chrome.switches",
      "--disable-extensions "
      + "--disable-extensions-file-access-check "
      + "--disable-extensions-http-throttling "
      + "--disable-infobars "
      + "--enable-automation "
      + "--start-maximized "
      + "--disable-notifications ");

    return options;
  }
}

0 个答案:

没有答案