【问题标题】:chrome-driver start-maximized not working in MAC OSchrome-driver start-maximized 在 MAC OS 中不起作用
【发布时间】:2017-08-15 01:57:54
【问题描述】:

在 windows 操作系统中,浏览器在以下配置下完美启动。但在 MAC chrome 浏览器中并没有完全最大化。

我的配置文件:

config.framework = 'jasmine2';
config.allScriptsTimeout = timeout;
config.getPageTimeout = timeout;
config.jasmineNodeOpts.isVerbose = true;
config.jasmineNodeOpts.defaultTimeoutInterval = timeout;
config.specs = [
    'qa/**/*Spec.js'
];

config.multiCapabilities = [{
    browserName: 'chrome',
    shardTestFiles: true,
    maxInstances: 17,
    'chromeOptions': {
        'args': ['start-maximized']
    }
}];

环境详情:

  • Chome 浏览器 57.0.2987.110
  • ChromeDriver 2.28.455520
  • 量角器版本 5.1.1
  • npm 版本 3.10.10
  • 节点版本 v6.10.0

【问题讨论】:

    标签: google-chrome automation protractor selenium-chromedriver


    【解决方案1】:

    您也可以在 chrome 选项中添加 start-fullscreen 参数,而不是使用 browser.driver.manage().window().maximize()。 我遇到了同样的问题,这在 Mac 上解决了。

       chromeOptions: {
        args: [
            '--start-fullscreen'
        ]
      }
    

    希望对你有帮助。

    【讨论】:

      【解决方案2】:

      您能否在onPrepare() 中添加以下代码以最大化浏览器而不是依赖于 chrome args 并查看是否有效。

       onPrepare: function() {
              browser.driver.manage().window().maximize();
             }
      

      【讨论】:

      • 是的,我知道,我们目前正在使用 onPrepare 来最大化浏览器窗口。但想知道为什么它在 MAC 中不起作用。
      • 哦,好吧!明白了 .. 添加了与 chromeDriver 相关的标签,因为这可能是 chromium 团队的兼容性问题。还建议向 Chromium 团队提出请求以获得更好的帮助。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-14
      • 1970-01-01
      相关资源
      最近更新 更多