Skip to main content
Ask AI

Get Started with Appium Analytics

Install @testrelic/appium-analytics in your WebdriverIO + Appium project and start capturing Android and iOS test analytics in minutes.

Requirements

RequirementMinimum version
Node.js18 (Appium 3.x requires ≥ 20.19)
WebdriverIO9.0.0
Appium3.x
Android driverUiAutomator2 (for Android testing)
iOS driverXCUITest on macOS 13+ with Xcode 15+
iOS requirement

iOS testing requires macOS 13+ with Xcode 15+. iOS tests cannot run on Windows or Linux.


Set up with an AI assistant

Copy any prompt below and paste it into your AI coding assistant. Each prompt is self-contained.


Full setup (one prompt, does everything)

AI Prompt — Full Appium setup
Set up @testrelic/appium-analytics in this WebdriverIO project:

1. Run: npm install @testrelic/appium-analytics
2. Run: npm install --save-dev webdriverio @wdio/reporter
3. Open (or create) wdio.conf.ts and add:
- Import TestRelicService from '@testrelic/appium-analytics/service'
- Import TestRelicReporter from '@testrelic/appium-analytics'
- Add TestRelicService to the services array with options:
includeDeviceLogs: true, includeNetworkLogs: true, screenshotOnEvery: 'failure'
- Add TestRelicReporter to the reporters array with options:
outputPath: './test-results/testrelic-timeline.json', openReport: true
- Add an onComplete hook that calls: await TestRelicReporter.finalize(process.cwd())

Show me the complete updated wdio.conf.ts.

Step-by-step prompts

Step 1 — Install packages:

AI Prompt — Step 1: Install
Run the following in my project terminal:
npm install @testrelic/appium-analytics
npm install --save-dev webdriverio @wdio/reporter

Step 2 — Configure wdio.conf.ts:

AI Prompt — Step 2: Configure WDIO
Update my wdio.conf.ts to include @testrelic/appium-analytics.

Add these imports at the top:
import { TestRelicService } from '@testrelic/appium-analytics/service';
import { TestRelicReporter } from '@testrelic/appium-analytics';

Add to services:
[TestRelicService, {
includeDeviceLogs: true,
includeNetworkLogs: true,
screenshotOnEvery: 'failure',
}]

Add to reporters:
[TestRelicReporter, {
outputPath: './test-results/testrelic-timeline.json',
openReport: true,
}]

Add the onComplete hook:
async function onComplete() {
try {
await TestRelicReporter.finalize(process.cwd());
} catch (err) {
process.stderr.write('[TestRelic] Finalization failed: ' + err + '\n');
}
}

Show me the complete updated file.

Step 3 — Run the tests:

AI Prompt — Step 3: Run tests
Show me how to start the Appium server and run my WebdriverIO tests.
My WDIO config file is wdio.conf.ts.

iOS capability swap

AI Prompt — iOS capabilities
Update the capabilities in my wdio.conf.ts to target an iOS simulator:
platformName: 'iOS'
'appium:automationName': 'XCUITest'
'appium:deviceName': 'iPhone 15'
'appium:platformVersion': '17.0'
'appium:app': path to my .app bundle

Show me the updated capabilities block.

Common setup errors

Cannot find module '@testrelic/appium-analytics/service' Ensure you installed the package: npm install @testrelic/appium-analytics. The /service subpath export requires version ≥ 1.0.0.

Error: UiAutomator2 driver not found Run appium driver install uiautomator2 and verify with appium driver list --installed.

SessionNotCreatedException: An unknown server-side error occurred The Appium server is not running or is not reachable on port 4723. Ensure appium --address 127.0.0.1 --port 4723 is running before starting your tests.

TestRelicReporter.finalize is not a function Ensure the onComplete hook calls TestRelicReporter.finalize(). Without this call, any pending cloud uploads will not be submitted.

Device logs are empty on iOS iOS device log capture requires the safariConsole or syslog log source. Ensure your device is unlocked and the app is foregrounded during the test.


What to do next

Loading chart…