This demo framework showcases the power of Appium and WebDriver.IO in mobile testing for Android devices. It provides a comprehensive example of how to automate mobile testing using these popular tools.
For more information on using Appium with WebDriver.IO, check out the WebDriverIO Appium docs.
We need node js to download Appium beta version & drivers easily.
- Download Node Js depending on your operating system.
I Tested the following steps on Windows 11:
- Installed Adopted Open JDK: You can download and install OpenJDK from the official website: https://adoptopenjdk.net/
- To return where was the SDK installed: You can check the installation directory, usually C:\Program Files\AdoptOpenJDK\jdk-16
where java - If you want to check the java version:
java -version- Open the Environment Variables to insert the JAVA_HOME variable: Setting up Environment Variables for OpenJDK
Step 1: Access System Properties Right-click on This PC or Computer and select Properties.
Step 2: Access Advanced System Settings Click on Advanced system settings on the left side.
Step 3: Access Environment Variables Click on Environment Variables.
Step 4: Add a New System Variable Under System Variables, scroll down and find the New button. Click on the New button to add a new variable.
Step 5: Configure the JAVA_HOME Variable In the Variable name field, enter JAVA_HOME. In the Variable value field, enter the path where you installed the OpenJDK (e.g. C:\Program Files\AdoptOpenJDK\jdk-16).
Step 6: Save Changes Click OK to close all the windows.
- You can check if it was set correctly running the command:
echo $JAVA_HOME- It should return something like:
C:\Program Files\AdoptOpenJDK\jdk-16-
[Android Studio]https://developer.android.com/studio)
-
Enter the environment variables :
export ANDROID_HOME="/Users/[USER]/Library/Android/sdk"
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH- Right-click on
This PCorComputerand selectProperties. - Click on
Advanced system settingson the left side. - Click on
Environment Variables.
- Under
System Variables, scroll down and find theNewbutton. Click on theNewbutton to add a new variable. - In the
Variable namefield, enterANDROID_HOME. - In the
Variable valuefield, enter the path where you installed the Android SDK (e.g.,C:\Users[USER]\AppData\Local\Android\Sdk). - Click
OKto close the window.
- In the
Environment Variableswindow, scroll down and find thePathvariable, then clickEdit. - Click
Newand add the paths to thetoolsandplatform-toolsfolders (e.g.,C:\Users[USER]\AppData\Local\Android\Sdk\toolsandC:\Users[USER]\AppData\Local\Android\Sdk\platform-tools). - Click
OKto close all the windows.
- You can check if it was set correctly running the command:
echo %ANDROID_HOME%- It should return something like:
C:\Users\[USER]\AppData\Local\Android\Sdk- With this configured you can access the command Android Debug Bridge
adbIn order to find the correct locators to map elements, you will need to have this tool installed in your computer.
For this project you can use the following configuration:
| Server Key | Server Value |
|---|---|
| Remote Host | 0.0.0.0 |
| Remote Port | 4724 |
| Remote Path | / |
Android Desired Capabilities(Example)
| Desired Capability Key | Desired Capability Value |
|---|---|
| platformName | Android |
| platformVersion | [OS VERSION / IMAGE] |
| deviceName | [EMULATED_DEVICE_NAME] |
| app | /[PROJECT_PATH]/[APP_NAME].apk |
| appium:automationName | UIAutomator2 |
Appium is an open source test automation framework for use with native, hybrid and mobile web apps. It drives iOS, Android, and Windows apps using the WebDriver protocol.
npm install -g appium@nextCheck the appium version using
appium -vTo check if your OS meets the appium requirements, install this node package.
- Appium Doctor Package Install it using the command
npm install appium-doctor -gAnd then use the library:
appium-doctorIf you want Appium to work correctly, you need to download and have the android/ios driver in your system. Run the commands:
appium driver install uiautomator2Check the installed drivers using
appium driver listSample Application that you can use:
SauceDemo Hybrid App - React Native) - (Framework is configured to use this one)
Sauce Labs Native Sample Application
1- Run the command to create the package.json & continue with the installation process
npm init wdio .2- Using the WDIO Configuration Helper select the options you want to select. In my case I decided to use:
- On my local machine
- Mocha
- No compiler
- Spect Location: Default
- Do you want WebDriverIO to generate some test files?: No
- Reporter: Spec
- No Plugin
- Service: Appium
- Base URL: Default
- NPM Install: Yes
3- Add your tests at
'./[yourProject]/specs/**/*.js'4- Configure the app route at wdio.conf.js
- Declare where it is going to be located
const projectPath = require('path')
const androidAppPath = projectPath.join(process.cwd(), "app/android/Android-MyDemoAppRN.1.3.0.build-244.apk")- Set up the capabilities for Android(Emulator sample)
capabilities: [{
platformName: 'Android',
"appium:device-name": 'Mi_A1',
"appium:platformVersion": "9.0",
"appium:automationName": "UIAutomator2",
"appium:app": androidAppPath,
// "com.saucelabs.mydemoapp.rn": "com.saucelabs.mydemoapp.rn.MainActivity")
}]- Install Appium in your project
npm install --save-dev appium@next- Check if the drivers are still available, if not install them again:
appium driver listappium driver install uiautomator2- Run your scripts using
npx wdioif you want to run this project:
1- Install all the system requirements
2- Clone the project
3- Run: npm i
4- Download the android app and place it under desired folder
5- npx wdio
The following security vulnerabilities have been addressed via overrides in package.json:
| CVE | Package | Severity | Fixed Version | Description |
|---|---|---|---|---|
| CVE-2026-40175 | axios |
Critical | ≥1.15.0 |
SSRF / proxy bypass — cloud metadata exfiltration |
| CVE-2026-34601 | @xmldom/xmldom |
High | ≥0.9.9 / ≥0.8.12 |
XML injection via unsafe CDATA serialization |
Both overrides ensure all transitive copies of these packages resolve to patched versions.