Skip to main content

Selenium With WebDriverIO 5.6.2


Run WebDriverIO 5.6.2 tests on the TestMu AI cloud grid. This guide covers setup, running a sample test, configuring capabilities, and testing locally hosted pages.

Outdated Version

This guide covers WebDriverIO 5.6.2. The current version is 8+. For the latest WebDriverIO guide, see Selenium With WebDriverIO.

Sample repo

All the code used in this guide is available in the sample repository.

Prerequisites


Complete these steps before running WebDriverIO 5.6.2 Selenium tests on TestMu AI.

  1. Create a TestMu AI account and get your username and access key from the dashboard.
  2. Install NodeJS v6 or newer from nodejs.org.
  3. Install WebDriverIO: npm install webdriverio
  4. Download Selenium JavaScript bindings from the official website.

Step 1: Clone the Sample Project


Clone the TestMu AI WebDriverIO Selenium sample repository to your local machine.

git clone https://github.com/LambdaTest/webdriverio-selenium
cd webdriverio-selenium

Install the required dependencies:

npm i selenium-webdriver
npm install

Step 2: Set Your Credentials


Set your TestMu AI username and access key as environment variables.

export LT_USERNAME="undefined"
export LT_ACCESS_KEY="undefined"

Step 3: Configure Your Test Capabilities


Update the capabilities in the config file to define the browser and platform settings.

user= process.env.LT_USERNAME || "<your username>",
key= process.env.LT_ACCESS_KEY || "<your accessKey>",

exports.config = {

updateJob: false,
user,
key,
specs: [
'./tests/specs/single_test.js'
],
exclude: [],

capabilities: [{
browserName: 'chrome',
version:"64.0",
name:"Test webdriverio",
build:"build 1",
}],
sync: true,
logLevel: 'info',
coloredLogs: true,
screenshotPath: './errorShots/',
baseUrl: '',
waitforTimeout: 100000,
connectionRetryTimeout: 90000,
connectionRetryCount: 1,
path: '/wd/hub',
hostname: 'hub.lambdatest.com',
port: 80,

framework: 'mocha',
mochaOpts: {
ui: 'bdd'
}
}
tip

Generate capabilities for your test requirements with the Capabilities Generator.

Step 4: Run the Test


Execute the test using the following command.

npm run single

Step 5: View Your Results


After running the test, view your results on the TestMu AI Automation Dashboard.

The dashboard provides:

  • Video recordings of each test session
  • Screenshots captured at each step
  • Console logs from the browser
  • Network logs for debugging
  • Detailed command logs

Run WebDriverIO 5.6.2 Tests Using Agent Skills


Use AI coding assistants to generate and run WebDriverIO 5.6.2 tests with the TestMu AI Agent Skill.

The webdriverio-skill is part of TestMu AI Agent Skills - structured packages that teach AI coding assistants how to write production-grade test automation.

Install the skill:

git clone https://github.com/LambdaTest/agent-skills.git
cp -r agent-skills/webdriverio-skill .claude/skills/

# For Cursor / Copilot
cp -r agent-skills/webdriverio-skill .cursor/skills/
tip

Install all available framework skills at once by cloning the repository directly into your tool's skills directory (e.g., .claude/skills/, .cursor/skills/).

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles