WebdriverIO W3C capability issue

Hello Lambdatest,

I am using WebdriverIO version 7.5.2 and facing an issue with using the google chrome options to upload an extension on to the lambda remote grid machines. Every time I use the chrome options capability, it gives me this error:

I am not able to use the extension in my tests because of this. Any help would be appreciated!

1 Like

Hi Darran,

When working on Wdio 7+ version there might be cases while using a capability with an array such as ‘goog:chromeOptions’ to upload extensions.

To bypass that you just have to declare the respective capabilities in the alwaysMatch:{} capabilities object as shown below:

capabilities: [
    {
      alwaysMatch : {                 // object to be added for wdio 7 and above

      browserName: "chrome",
      version: "88.0",
      platform : "Windows 10",
      build: "Wdio 7+ Sample ",
      
      "goog:chromeOptions": {
        extensions: [
          require('fs').readFileSync('extension.crx').toString('base64')
        ]
      }
    }
  }

After making these changes your tests should work fine and the extensions would be uploaded on the machines as well.

1 Like