Skip to main content
🏠Documentation|WebDriver IO

Last updated on : 09 Jan 2026

WebdriverIO

Overview

WebdriverIO is a custom implementation of Selenium's W3C WebDriver API, written in JavaScript and packaged into npm. This TypeScript implementation provides type safety and enhanced developer experience while running on Node.js for powerful automation of both web applications and native mobile apps on iOS and Android platforms.

Key Features:

  • TypeScript support for type-safe test development
  • Supports both web and native mobile app automation
  • Built on W3C WebDriver API standards
  • npm package management with Node.js runtime
  • Integrates seamlessly with Pcloudy for cloud-based mobile testing
  • Dynamic test naming and build configuration
  • Automated app upload capabilities

Prerequisites

Before setting up WebdriverIO with TypeScript for mobile testing, ensure you have:

  1. Node.js - Version specified in .nvmrc file (use nvm for version management)
  2. NPM - Node Package Manager installed on your machine
  3. TypeScript - Installed as part of project dependencies
  4. Pcloudy Account - Active account with valid credentials
  5. API Access Key - Available in your account profile or Quick Actions tab
  6. Mobile App - Your Android (.apk) or iOS (.ipa) application file ready for upload or already uploaded to Pcloudy

Setup Instructions

1. Set Node Version

Use the Node version specified in the project's .nvmrc file:

nvm use

2. Install Dependencies

Install all project dependencies including TypeScript and WebdriverIO:

npm install

3. Configure Test Environment

Edit the config/config.json file with your credentials and settings. The sample below shows the basic structure—refer to the Capability Generator page for a complete customized configuration tailored to your needs:

A. Update Credentials

Java
"pcloudy:options": 
{
"pCloudy_Username": "your-email@example.com",
"pCloudy_ApiKey": "your-api-access-key"
}

Configuration Parameters:

  • Pcloudy_Username: Your registered email address
  • Pcloudy_ApiKey: Your API access key (found in account profile or Quick Actions tab)

B. Configure Application Settings

Option 1: Use Uploaded App (if uploadApp is false):

"Pcloudy_ApplicationName": "YourAppName.apk"

Provide the exact filename of your app already uploaded to Pcloudy.

Option 2: Upload App Dynamically (if uploadApp is true):

Ensure AppPath points to a valid local .apk or .ipa file:

"AppPath": "path/to/your/app.apk"

C. Configure Test Name and Build (Optional)

If dynamicName or dynamicBuild is false, provide static values:

"appium:name": "SomeTestName",
"appium:build": "SomeBuildID"
note

Dynamic values will override these static configurations if enabled.

Running Tests

Execute Test Suite

Open the terminal in your project directory and execute:

npm run wdio

This command will launch the WebdriverIO TypeScript test suite on mobile devices in the Pcloudy cloud.

Configuration Notes

  • All configurations are loaded from config/config.json
  • Dynamic test name and build ID will override static values if dynamicName or dynamicBuild is set to true
  • Upload failure handling: If uploadApp fails, the WDIO run will abort to prevent invalid app configuration
  • Type safety: TypeScript ensures configuration and test code are type-checked at compile time

Troubleshooting

Common Issues:

  • Authentication failed - Verify your username and API key are correct in the configuration file
  • App not found - Ensure the app is uploaded and filename matches exactly, or check AppPath if uploading dynamically
  • Device not available - Check device name spelling or try a different device
  • Node version mismatch - Run nvm use to switch to the correct Node version
  • Dependencies not installed - Run npm install to ensure all packages including TypeScript are installed
  • Upload failed - Verify AppPath points to a valid .apk or .ipa file and file exists
  • TypeScript compilation errors - Check your tsconfig.json and ensure all types are properly defined

Additional Resources

Did this page help you?