【问题标题】:intern chromeOptions.args window-size seemingly not working实习生 chromeOptions.args 窗口大小似乎不起作用
【发布时间】:2016-05-17 22:39:13
【问题描述】:

我需要一个 capabilities.js 文件,其中包含我的实习生套件的对象,以便我可以指定用于各种测试的环境。这是我的默认 chrome:

chrome: {
    browserName: 'chrome',
    chromeOptions: {
      args: [
        // 'start-maximized',
        'window-size=1024x768'
      ]
    }
  }

据此,我希望environments: [caps.chrome] 之类的东西可以打开一个 1024x768 的浏览器窗口。我需要以每个环境的方式指定窗口大小。 (另外,start-maximized 不起作用——尽管我确实设置了几个移动模拟器并且运行良好)。

【问题讨论】:

  • 感谢您发布此问题,因为它帮助我找出了传递 chromeOptions 参数的正确方法。

标签: intern


【解决方案1】:

我确实发现了这似乎暗示它不适用于 Mac。谁能确认一下?

但是,问题中链接的问题已经关闭了一段时间。

Arguments not being applied to Google chromedriver in Selenium with python

【讨论】:

    【解决方案2】:

    我使用这些配置来控制 windows 上的窗口大小,应该也可以在 Mac 上工作。

    "chromeOptions": {
      "args": [
        "--window-size=800,600"
      ]
    
    "chromeOptions": {
      "args": [
        "--start-maximized"
      ]
    

    【讨论】:

      猜你喜欢
      • 2011-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-28
      • 2012-03-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多