# WebdriverIO

Last updated on : 09 Jan 2026

Overview

WebdriverIO is a custom implementation of Selenium's W3C WebDriver API, written in JavaScript and packaged into npm. It runs on Node.js and provides a powerful automation framework for both web applications and native mobile apps on iOS and Android platforms.

### Key Features:

- Supports both web and native mobile app automation
- Built on W3C WebDriver API standards
- JavaScript-based testing with npm package management
- Runs on Node.js for cross-platform compatibility
- Integrates seamlessly with Pcloudy for cloud-based mobile testing
- Supports Allure reporting for comprehensive test results

## Prerequisites

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

1.  Node.js - Version 16 or above recommended
2.  NPM - Node Package Manager installed on your machine
3.  Java - Required for Allure report generation (optional)
4.  Pcloudy Account - Active account with valid credentials
5.  API Access Key - Available in your account profile or Quick Actions tab
6.  Mobile App Upload - Your Android (.apk) or iOS (.ipa) application uploaded to Pcloudy via the web interface

## Setup Instructions

1. Create Project Structure

Create a test folder and set up the project:

```java
mkdir webdriverio-test
cd webdriverio-test
```

2. Install WebdriverIO

Install WebdriverIO and initialize the configuration:

```java
npm install webdriverio
```

Run the WDIO command to generate the configuration file:

```java
wdio
```

3. Install Project Dependencies

If cloning an existing project, install all dependencies:

```java
npm install
```

4. Configure Test Environment

Edit the wdio.android.conf.js file with your credentials. The sample below shows the basic structure—refer to the Capability Generator page for a complete customized configuration tailored to your needs:

```java
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)

Optional Device Selection Capabilities (choose one):

- Option 1: Pcloudy_DeviceManufacturer - Select by manufacturer (e.g., "Samsung")
- Option 2: Pcloudy_DeviceVersion - Select by OS version (e.g., "12.0")
- Option 3: Pcloudy_DeviceFullName - Select specific device (e.g., "SAMSUNG_GalaxyS21_Android_12.0.0")

## Running Tests

Execute Test Suite

Open the terminal in your project directory and execute:

```java
wdio wdio.android.conf.js
```

Or use the npm script:

```java
npm run wdio
```

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

## Allure Report Generation (Optional)

### Prerequisites for Allure Reports

Ensure Java is installed and environment variables are properly configured.

Generate and View Report

After test execution, generate the Allure report:

```java
allure generate [allure_output_dir] && allure open
```

Replace 
[allure_output_dir] with the directory where Allure results are stored (e.g., allure-results).

## 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 in configuration
- Device not available - Check device name spelling or try a different device
- Node version mismatch - Ensure Node.js version 16 or above is installed
- Dependencies not installed - Run npm install to ensure all packages are installed
- Allure report not generating - Verify Java is installed and environment variables are set

### Additional Resources

- Complete sample project and documentation: Pcloudy GitHub Repository
- Support: support@pcloudy.com
