简体   繁体   中英

Run Firefox in headless mode using Protractor config

I have this in my Protractor config:

  multiCapabilities: [

    {
      browserName: 'firefox',
      firefoxOptions: {
        args: ['-headless']
      },
      'moz:firefoxOptions': {
        args: ['-headless']
      }
    }

  ]

unfortunately, when I launch Protractor, Firefox still runs in a headful mode. How to the heck do I tell Firefox to as headless?

I know that at the command line, the -headless option should work so.

I guess, you are missing extra hypen (-) in your config.

multiCapabilities: [
{
  browserName: 'firefox',
  firefoxOptions: {
    args: ['--headless']
  },
  'moz:firefoxOptions': {
    args: [ '--headless' ]
  }
}
]

Also your browser version should be greater than 56.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM