How to integrate using Appium Node?
How to Integrate Appium (Node) with Genymotion?
To run Appium tests using Node.js on Genymotion virtual devices (Desktop or SaaS), simply follow some simple configuration steps. Below, we describe the most common scenarios:
---
## 1️⃣ Genymotion Installation and Configuration
| Type | Steps | Notes |
|------|--------|-------------|
| **Genymotion Desktop** | 1. Download and install the latest version (Windows/macOS/Linux) from the official website.
2. Open the emulator and create a *Virtual Device* (you can choose the latest Android image). | Genymotion Desktop does not work on Windows 7. |
| **Genymotion SaaS** | 1. Create an account on
2. On the dashboard, start one or more virtual devices (you can set the number of instances). | SaaS devices are accessible via `adb` on port `localhost:XXXXX` (the port number varies). |
---
## 2️⃣ Install Node.js Dependencies
```bash
# 1. Create a project (if it does not exist yet)
npm init -y
# 2. Install Appium and WebdriverIO libraries (or pure Webdriver)
npm install --save-dev appium webdriverio
```
> **Tip**: If you want to use WebdriverIO, just install the package `@wdio/appium-service`.
---
## 3️⃣ Connect Appium to Genymotion
### 3.1. Using Genymotion Desktop
```js
// appium.config.js (for WebdriverIO) or in your test script
const wdio = require('webdriverio');
const opts = {
path: '/wd/hub',
port: 4723,
capabilities: {
platformName: 'Android',
platformVersion: '11.0', // or the version of your Virtual Device
deviceName: 'Genymotion', // free name
udid: 'emulator-5554', // usually the ID of your emulator
app: '/path/to/your/app.apk',
automationName: 'UiAutomator2',
}
};
async function main () {
const client = await wdio.remote(opts);
// ... your tests
await client.deleteSession();
}
main();
```
- **Note**: On Genymotion Desktop, the emulator starts `adb` automatically. You can use `adb devices` to verify the ID (`emulator-5554` or similar).
### 3.2. Using Genymotion SaaS
1. **Start devices via gmsaas CLI**
```bash
gmsaas start --udid 1 --device-name "Pixel_5" --count 2
```
(See the complete documentation at https://genymotion.com/blog/tutorial)
2. **Get the `udid`**
SaaS devices receive `udid` in the format `localhost:PORT`. Use the port number that appears in the CLI output.
3. **Test with Appium**
```js
const opts = {
path: '/wd/hub',
port: 4723,
capabilities: {
platformName: 'Android',
deviceName: 'GenymotionSaaS',
udid: 'localhost:5555', // SaaS port
app: '/path/to/your/app.apk',
automationName: 'UiAutomator2',
}
};
```
> **Reference Link**: Tutorial “Parallel tests with Appium and Genymotion SaaS” –
---
## 4️⃣ Run the Tests
```bash
# If using WebdriverIO
npx wdio run wdio.conf.js
```
To run parallel tests (multi-instance) with SaaS, simply create multiple session objects, each pointing to a different `udid` (`localhost:5555`, `localhost:5556`, etc.). Genymotion SaaS allows rapid scaling.
---
## 5️⃣ CI Integration (optional)
- **CircleCI / GitHub Actions**: use the Docker image `genymotion/genymotion:latest` and follow the tutorials “Mobile Automated Tests with CircleCI and Genymotion SaaS” (
- **Bitrise / Jenkins**: there are specific tutorials on the website, such as “Use Bitrise with Genymotion SaaS” and “