Appium test coverage
Appium test coverage for the backend your mobile app depends on
CoverOps shows what your Appium suite exercises where most of the logic lives: the backend services your app calls. Agents in those services record the code a mobile run executes, for the whole suite with no change to the app, and per test when your app's test build sends the test's name. App code on the device is not measured; keep the platform's own instrumentation (JaCoCo on Android, Xcode on iOS) for that.
By the CoverOps team · Last updated
Why teams choose CoverOps for Appium test coverage
Backend coverage of everything your mobile suite exercises
Line-level coverage of the APIs and services your app calls, measured while the Appium suite runs, with no change to the app and no agent on the device.
Works with the Appium client you already use
Verdicts and retries come in through the JUnit 5, TestNG, pytest, WebdriverIO and Robot Framework integrations, and any other runner can post them to the Results API.
Catch API changes no mobile test reached
Run the changed-code gate against the mobile run and see which backend lines of a change the mobile pass executed, before the release goes out.
Flaky tests caught, not hidden by retries
Passes on retry, different results on one commit and flips on a branch are all counted, flips per branch, and a confirmed flake can be quarantined so it stops blocking builds.
Cloud, self-hosted or air-gapped
Use the hosted service in AWS Frankfurt, or run CoverOps in your private cloud, on your own servers or fully offline.
ISO/IEC 27001, 27701 and ISO 9001
Certified to ISO/IEC 27001:2022, ISO/IEC 27701 and ISO 9001. SOC 2 Type 2 is coming soon.
Two different questions under one search
Most answers to "Appium code coverage" are about the app itself: build an instrumented APK with a receiver that writes the coverage file, run the suite on an emulator or rooted device, pull the file off and turn it into a report; or, on iOS, switch on Xcode's coverage settings and collect the profile files the app writes. Appium itself is black-box: it drives the UI and sees nothing of the code.
The second question is what those mobile tests exercise on the server. For most apps, the checkout rules, the account logic and the integrations live in the APIs the app calls, not in the app. A mobile regression that passes says nothing about which of those paths it reached. That is the question CoverOps answers, and it answers it with the same agents and runs as for web and API tests.
How it works with Appium
- Run the backend services the app calls in your test environment with the CoverOps agent for their language: Java, .NET, Node.js, Python, Go or PHP. Nothing is installed on the device or in the app.
- Before the suite, open a coverage monitoring window, from the dashboard or from the pipeline with a write-scoped API token. Agents join it on their next poll (every 30 seconds by default), so wait one cycle before the first test.
- Run the Appium suite with its runner plugin and
COVERAGEOPS_RUN_KEYset to the window's key, so the verdicts land beside the coverage. JUnit 5 and TestNG (Java), pytest (Python) and WebdriverIO (JavaScript) report verdicts with attempts; Robot Framework's listener does too. - Stop the window when the suite ends. The result is what the whole Appium run reached on every service with an agent, with the suite's verdicts.
# a write-scoped API token from Team → API tokens; the token's active project
KEY=$(curl -s -X POST "$COVEROPS/v1/workspace/campaign" \
-H "Authorization: Bearer $COVEROPS_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"label":"appium-nightly"}' | jq -r .runKey)
sleep 30 # agents join on their next poll
COVERAGEOPS_RUN_KEY="$KEY" mvn test # JUnit 5 / TestNG Appium suite
curl -s -X POST "$COVEROPS/v1/workspace/campaign/stop" \
-H "Authorization: Bearer $COVEROPS_API_TOKEN"An AI assistant connected over MCP can do the same with the start_coverage_monitoring and stop_coverage_monitoring tools.
Per test: what it takes
Per-test attribution needs the test's name on each request the app sends: the X-CoverageOps-Test and X-CoverageOps-Run headers (or W3C baggage). A native app's HTTP client does not add them, and CoverOps ships nothing for the app. Where it can work:
- Your app's test build adds the headers itself, from a value the Appium test passes in (a launch argument, for example). This is code you write in the app; the header contract is documented.
- A proxy in front of the test backend adds the headers for the test that is running. Again, something you run, not something CoverOps provides.
- Web contexts: tests of a mobile browser or a WebView can set the
covctxcookie through the WebDriver session, as Selenium tests do, where the driver supports cookies in that context. - API calls the test makes itself, to set up data for example, carry the headers from the runner plugin (
currentHeaders(),coverops.headers(),coverOpsHeaders()).
What you get
What the mobile suite reached on the backend
Line and method coverage of every service the app called during the window, merged across replicas, with the source line by line and the suite's verdicts beside it.
A changed-code check on backend changes
coverageops gate --run-key <window key> asks how many of the backend lines a change touched the mobile run executed, so an API change that no mobile test reached is visible before release.
Flaky mobile tests, from their verdicts
Retries reported by the runner plugins and results that flip on one branch or commit feed the Flaky tests page, which needs verdicts, not coverage.
Dead code in the APIs
Over a window and an environment, the backend methods that were loaded and that nothing, mobile or otherwise, ever executed.
What is measured, and what is not
Measured
- Lines and methods of the backend services the app calls, on any service with a CoverOps agent; branches on Java and Node.js.
- The Appium suite's verdicts and retries, through the JUnit 5, TestNG, pytest, WebdriverIO and Robot Framework integrations.
- Per test, only when each request carries the test's name (see above).
Not measured
- App code: no agent runs on the device or inside the app, so there is no Kotlin, Java, Swift, Objective-C, React Native or Flutter coverage. Use the platform's own instrumentation for that.
- Which test reached what, by default: a monitoring window counts everything the agents see while it is open, other traffic on that environment included. Use a dedicated environment if that matters.
- Test selection for app changes: CoverOps has no footprint of app code, so a change to the app gives it no evidence to skip any Appium test, and without per-test footprints every test runs.
Frequently asked questions
Can CoverOps measure code coverage of my Android or iOS app?
No. CoverOps has no on-device or in-app agent. For app-code coverage, instrument the app build: JaCoCo on Android (Appium's Android coverage guide describes it), Xcode's code coverage on iOS. CoverOps measures the backend services the app calls.
Why is Appium backend coverage per suite and not per test?
Because the requests come from the app on the device, not from the test. A browser test can set a cookie and an API test can set headers, but a native app's HTTP client sends neither unless its test build is changed to. Without the test's name on the request, the agents can only file the coverage under the run or window.
Which Appium client languages work?
Any, for the backend measurement, because nothing runs in the test process. For verdicts there are plugins for JUnit 5 and TestNG (Java), pytest (Python), WebdriverIO (JavaScript) and Robot Framework; other runners post results through the Results API.
Is CoverOps a good fit for selecting which mobile tests to run?
Only for backend changes, and only with per-test attribution. For changes in the app itself it has no coverage to go on. A selection tool that learns from test history rather than coverage may suit a mobile suite better; our comparison pages say where.
Keep reading
Related pages
In the documentation
- Coverage monitoring: start, stop and resume windows
- How CoverOps measures: test context and runs
- API and MCP: tokens and tools
- Quality gates
The documentation is in English.
See what your mobile suite reaches on the backend
Bring the API your app calls to a demo; we show what one Appium run executes in it, and where per-test attribution would need work on your side.