Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webdriver.io: what's the difference between the capabilities and desiredCapabilities keywords?

I'm using Webdriver.io to run UI tests in a Node environment. I'd like to run Headless Chrome and came up with the following working configuration:

{
  capabilities: [{
    browserName: 'chrome',
       args: ['--headless', '--disable-gpu']
     }
  }],
  services           : ['selenium-standalone'],
  execArgv           : ['--inspect']
}

However, I can't figure out whether capabilities is deprecated or not; I'm wondering because all the examples I see reference desiredCapabilities instead. If I use desiredCapabilities though, then Chrome runs normally, not in headless mode.

I feel like I'm missing something, but I don't know what. Is there a significant difference between the two, and is one going away?

Thanks!

like image 428
Mikael Gramont Avatar asked Nov 27 '25 11:11

Mikael Gramont


1 Answers

If you run webdriverio through the test runner (using a wdio.conf.js file), it uses capabilities.

If you run it in standalone mode (e.g. node myTest.js), it uses desiredCapabilities

like image 119
Kevin Lamping Avatar answered Nov 29 '25 08:11

Kevin Lamping



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!