Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@wdio/appium-service
Advanced tools
@wdio/appium-service is a WebdriverIO service that helps you run Appium seamlessly when running your WebdriverIO tests. It simplifies the process of starting and stopping the Appium server, making it easier to manage mobile testing environments.
Starting Appium Server
This code sample demonstrates how to start an Appium server using WebdriverIO with the @wdio/appium-service. It sets up the desired capabilities for an Android device and starts a session.
const { remote } = require('webdriverio');
const opts = {
path: '/wd/hub',
port: 4723,
capabilities: {
platformName: 'Android',
platformVersion: '9',
deviceName: 'emulator-5554',
app: '/path/to/the/app.apk',
automationName: 'UiAutomator2'
}
};
(async () => {
const client = await remote(opts);
await client.deleteSession();
})();
Stopping Appium Server
This code sample shows how to stop the Appium server after the test session ends. The @wdio/appium-service handles the stopping of the server automatically when the session is deleted.
const { remote } = require('webdriverio');
const opts = {
path: '/wd/hub',
port: 4723,
capabilities: {
platformName: 'Android',
platformVersion: '9',
deviceName: 'emulator-5554',
app: '/path/to/the/app.apk',
automationName: 'UiAutomator2'
}
};
(async () => {
const client = await remote(opts);
await client.deleteSession();
// Appium server will stop automatically after the session ends
})();
Custom Appium Server Arguments
This code sample demonstrates how to pass custom arguments to the Appium server using the @wdio/appium-service. It configures the server to run on a specific address and port, and to log output to a file.
const { remote } = require('webdriverio');
const opts = {
path: '/wd/hub',
port: 4723,
capabilities: {
platformName: 'Android',
platformVersion: '9',
deviceName: 'emulator-5554',
app: '/path/to/the/app.apk',
automationName: 'UiAutomator2'
},
services: [['appium', {
args: {
address: '127.0.0.1',
port: 4723,
log: './appium.log'
}
}]]
};
(async () => {
const client = await remote(opts);
await client.deleteSession();
})();
Appium is an open-source tool for automating mobile applications. It allows you to write tests for multiple platforms (iOS, Android) using the same API. Compared to @wdio/appium-service, Appium is the core server that @wdio/appium-service interacts with to manage mobile testing.
The wdio-selenium-standalone-service is a WebdriverIO service that helps you run a standalone Selenium server seamlessly when running your WebdriverIO tests. It is similar to @wdio/appium-service but is used for web browser automation instead of mobile app automation.
WebdriverIO is a popular testing framework for Node.js that allows you to write and run tests for web and mobile applications. While WebdriverIO provides the framework and API for writing tests, @wdio/appium-service specifically helps manage the Appium server for mobile testing.
Handling the Appium server is out of the scope of the actual WebdriverIO project. This service helps you to run the Appium server seamlessly when running tests with the WDIO testrunner. It starts the Appium Server in a child process.
The easiest way is to keep @wdio/appium-service
as a devDependency in your package.json
, via:
npm install @wdio/appium-service --save-dev
Instructions on how to install WebdriverIO
can be found here.
In order to use the service you need to add appium
to your service array:
// wdio.conf.js
export const config = {
// ...
port: 4723, // default appium port
services: ['appium'],
// ...
};
The following options can be added to the wdio.conf.js file. To define options for the service you need to add the service to the services
list in the following way:
// wdio.conf.js
export const config = {
// ...
port: 4723, // default appium port
services: [
['appium', {
// Appium service options here
// ...
}]
],
// ...
};
The path where all logs from the Appium server should be stored.
Type: String
Example:
export const config = {
// ...
services: [
['appium', {
logPath : './'
}]
],
// ...
}
To use your installation of Appium, e.g. globally installed, specify the command which should be started.
Type: String
Example:
export const config = {
// ...
services: [
['appium', {
command : 'appium'
}]
],
// ...
}
Map of arguments for the Appium server, passed directly to appium
.
See the documentation for possible arguments.
The arguments are supplied in lower camel case. For instance, debugLogSpacing: true
transforms into --debug-log-spacing
, or they can be supplied as outlined in the Appium documentation.
Type: Object
Default: {}
Example:
export const config = {
// ...
services: [
['appium', {
args: {
// ...
debugLogSpacing: true,
platformName: 'iOS'
// ...
}
}]
],
// ...
}
Note: The utilization of aliases is discouraged and unsupported. Instead, please use the full property name in lower camel case.
For more information on WebdriverIO see the homepage.
v9.5.7 (2025-01-12)
webdriverio
FAQs
A WebdriverIO service to start & stop Appium Server
The npm package @wdio/appium-service receives a total of 147,489 weekly downloads. As such, @wdio/appium-service popularity was classified as popular.
We found that @wdio/appium-service demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.