【问题标题】:Unable to resize the chrome window size when tests running on selenium Grid在 selenium Grid 上运行测试时无法调整 chrome 窗口大小
【发布时间】:2016-11-18 10:34:08
【问题描述】:

当测试是用在 Selenium Grid 上运行的 C# 编写时,尝试将远程 chrome 浏览器最大化到特定大小时,我遇到了一个问题。
我尝试了以下选项

  • options.AddArgument("--window-size=1920, 1080");
  • Driver.Manage().Window.Size = new Size(1920, 1080);

但是,浏览器没有最大化。

谁能帮帮我?

【问题讨论】:

    标签: c# selenium-chromedriver selenium-grid


    【解决方案1】:

    试试这个:

                    ChromeOptions options = new ChromeOptions();
                    options.AddArguments("--disable-extensions");
                    _webDriver = new ChromeDriver("c:\path"), options);
                    _wait = new WebDriverWait(_webDriver, TimeSpan.FromSeconds(10));
                    _webDriver.Manage().Window.Maximize();
    

    【讨论】:

    • 感谢您的回复,但很遗憾,它没有用。 :(
    • 确保将 _webdriver 更新为您用于驱动程序的任何内容。调试时会发生什么?
    猜你喜欢
    • 2015-06-18
    • 1970-01-01
    • 2015-07-09
    • 2016-10-24
    • 1970-01-01
    • 2012-08-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多