Skip to main content
Ask AI

TestRelic for Appium (Python)

testrelic-appium is a pytest plugin that turns your existing Appium mobile tests into rich, shareable analytics. It records what every test did on the device — every command, gesture, screenshot, and network request — and produces a self-contained HTML report plus a JSON timeline. With an API key, the same data streams to the TestRelic cloud workspace.

Beta

testrelic-appium is currently at version 0.1.0 (Beta). The API and option set may change between minor releases.

What it captures

  • Command timeline — every Appium/WebDriver command with timing, category (find, interaction, gesture, navigation, lifecycle, context, device, keyboard, alert, screenshot, other), selector, redacted arguments, and result.
  • Device logs — Android logcat, iOS syslog and crashlog, polled in the background and sliced per test.
  • Console logs — webview/browser console via WebDriver BiDi log.entryAdded, with a polling fallback.
  • Network capture — Chrome DevTools Protocol performance logs (Android), safariNetwork (iOS), with an optional mitmproxy fallback.
  • Screenshots and video — screenshots on a configurable policy; video via Appium screen recording, falling back to adb screenrecord.
  • Assertions — named assertions through the assert_that() API, plus bare assert statements.
  • CI metadata — GitHub Actions, GitLab CI, Jenkins, CircleCI, and Bitbucket.
  • Redaction — sensitive-data redaction, including Appium-specific command-arg redaction (elementSendKeys, setValueImmediate, replaceValue).

Zero-config auto-wrap

The plugin auto-activates through a pytest11 entry point — there is no conftest.py wiring to add. On each test it walks item.funcargs and wraps any appium.webdriver.webdriver.WebDriver instance it finds. Pure-Selenium tests are never touched. If you need explicit control, a testrelic_appium_driver fixture and a wrap_driver() function are available.

Requirements

RequirementVersion
Python>= 3.9
pytest>= 7.0
Appium-Python-Client>= 4.0, < 6.0
selenium>= 4.0, < 5.0
httpx>= 0.27

An optional network-proxy extra adds mitmproxy >= 10.0 for the network fallback.

Output files

Running pytest writes a timeline and a report to your output directory:

test-results/
├── testrelic-timeline.json
└── testrelic-timeline.html

JavaScript counterpart

If your suite is written with WebdriverIO instead of pytest, use the JS/WebdriverIO Appium reporter, which captures the same kind of timeline for Node-based Appium tests.

Next steps