Get Started with Appium (Python)
This guide takes you from an empty environment to your first instrumented Appium run.
- For AI agents
- For Human
Paste this prompt into your coding agent:
Set up TestRelic analytics for my Appium pytest suite.
1. Install the plugin: pip install testrelic-appium
2. The plugin auto-activates via its pytest11 entry point — do NOT add any
conftest.py wiring. It wraps any appium.webdriver.webdriver.WebDriver found
in a test's fixtures automatically.
3. Make sure an Appium server is running (appium.io) and a device or emulator
is available.
4. Run `pytest`. Confirm test-results/testrelic-timeline.html and
testrelic-timeline.json were created.
5. Open the HTML report to verify the command timeline rendered.
1. Start an Appium server
Make sure an Appium server is running and a device or emulator is reachable (the quickstart below targets http://127.0.0.1:4723).
2. Install the plugin
pip install testrelic-appium
3. Write a test
import pytest
from appium import webdriver
from appium.options.android import UiAutomator2Options
@pytest.fixture
def driver():
options = UiAutomator2Options()
options.platform_name = "Android"
options.device_name = "emulator-5554"
options.app = "/path/to/MyApp.apk"
d = webdriver.Remote("http://127.0.0.1:4723", options=options)
yield d
d.quit()
def test_login_succeeds(driver):
driver.find_element("accessibility id", "username").send_keys("alice")
driver.find_element("accessibility id", "password").send_keys("hunter2")
driver.find_element("accessibility id", "submit").click()
assert driver.find_element("accessibility id", "welcome").is_displayed()
The driver fixture returns a plain Appium WebDriver. Because the plugin walks item.funcargs, it finds and wraps that driver for you — no extra wiring.
4. Run pytest
pytest
5. Open the report
The run writes a timeline and a self-contained HTML report:
test-results/
├── testrelic-timeline.json
└── testrelic-timeline.html
Open test-results/testrelic-timeline.html in a browser, or serve the directory with testrelic-appium serve ./test-results --open.
The quickstart targets Android via UiAutomator2Options. iOS testing additionally requires macOS with Xcode (and the XCUITest driver). The plugin captures iOS syslog, crashlog, and safariNetwork data once your iOS Appium session is running.