2

I am trying to run a wdio-test on saucelabs for chrome, IE and firefox.

test works fine for chrome and IE, however it fails for firefox with :

Infrastructure Error -- The Sauce VMs failed to start the browser or device.

I am using lastest version of wdio and sauce service:

  "devDependencies": {
    "@wdio/cli": "^6.1.5",
    "@wdio/cucumber-framework": "^6.1.1",
    "@wdio/local-runner": "^6.1.5",
    "@wdio/sauce-service": "^6.1.0",
    "@wdio/spec-reporter": "^6.1.5",
    "@wdio/sync": "^6.1.5",
    "chromedriver": "^81.0.0",
    "wdio-chromedriver-service": "^6.0.2"
  }

my browser config:

capabilities: [
    {
      maxInstances: 3,
      browserName: "chrome",
      browserVersion: "latest"
    },
    {
      maxInstances: 3,
      browserName: "firefox",
      browserVersion: "latest",
      platform: "windows 10",
      "sauce:options": {
        seleniumVersion: "3.14.0",
      },
    },
    {
      maxInstances: 3,
      browserName: "internet explorer",
      browserVersion: "latest"
    },
  ],

2 Answers2

1

This is an issue with how WebdriverIO and Sauce Labs handle W3C browser options. You do need to provide a sauce:options capability to use recent versions of Firefox, which would look like this:

capabilities: { 
  maxInstances: 3,
  browserName: 'firefox',
  platformName: 'Windows 10', 
  browserVersion: 'latest', 
  'sauce:options': 
    {'seleniumVersion': '3.14.0'}
}

The sauce:options specifies Sauce-only capabilities, such as which version of Selenium WebDriver to use in this case.

joshin4colours
  • 1,420
  • 3
  • 15
  • 24
  • actually, I tried this earlier both `3.14.0` and `3.11.0` but this didn't work – akshaymittal143 Apr 30 '20 at 20:00
  • ```[2-0] 2020-04-30T20:00:02.926Z ERROR webdriver: Request failed with status 500 due to Error: Infrastructure Error -- The Sauce VMs failed to start the browser or device. For more info, please check https://wiki.saucelabs.com/display/DOCS/Common+Error+Messages [2-0] 2020-04-30T20:00:02.926Z ERROR webdriver: Error: Infrastructure Error -- The Sauce VMs failed to start the browser or device. ``` – akshaymittal143 Apr 30 '20 at 20:01
0

I was able to fix it.

In order for the W3C-compliant Selenium capabilities and protocol to work, all non-standard capabilities need to be defined inside the "sacue:options" block. This includes the "build" capability. Also, to specify a platform, the capability name has been changed from "platform" to "platformName". So the capabilities should look like this:

capabilities: { 
  browserName: 'firefox',
  platformName: 'Windows 10', 
  browserVersion: 'latest', 
  'sauce:options': 
    {
    'seleniumVersion': '3.14.0',
    'build': buildName()
    }
}