Skip to main content

Webdriver.io Starter Code

You can use any Webdriver.io test framework to run tests using Continuous Testing Cloud.
After setting up your local environment, you can easily integrate your test with the Cloud by using this config file. 

Webdriver.io Config File Example

exports.config = {
runner: 'local',
hostname: 'cloud.experitest.com',
protocol: 'https',
port: 443,
path: '/wd/hub',

specs: [
'./*.js'
],
capabilities: [{
'experitest:accessKey': '<ACCESS_KEY>', //Or userName, password and projectName if needed
platformName: 'android',
'appium:udid': '<Device-Udid>', //Optional
'appium:appiumVersion': '1.22.2',
'experitest:testName': 'Appium WebdriverIO native test', //Optional
}],
mochaOpts: {
ui: 'bdd',
timeout: 60000
},
}

To use Continuous Testing additional capabilities, use this format:

'experitest:testName' : 'here is the test name',

To use Appium capabilities, use this format:

'appium:udid' : 'Device ID',

These capabilities can be used when creating the Driver:

Capability NameMeaningMandatoryDefault Value
usernameName of cloud user with which to execute the testYes
passwordPassword of cloud user with which to execute the testYes
projectNameName of the project to useOnly if the cloud user is



associated with more



than one project
accessKeyThe accessKey of cloud user with which to execute the test.



This can be used instead of username&password&projectName
No
newSessionWaitTimeoutTimeout in seconds to wait when trying to create a new sessionNo300
newCommandTimeoutTimeout in seconds to wait between commandsNo60
generateReportWhether to generate a report or notNoTRUE
testNameName of the test to be shown in Cloud UI and ReportNoAuto-generated
reservationDurationTime in minutes for which to reserve the deviceNo240 (4 hours)
takeScreenshotsEnable or disable taking screenshots for a report



False improves running performance.
NoTRUE
platformNameiOS/AndroidYes