October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Mountain View desk6 min

How to Run Visual Tests on Android Apps with Appium

Add screenshot-based assertions to Android Appium tests, choose between whole-image similarity, template matching, and feature matching, and keep baselines reliable.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run an Android visual test by driving the app to a known screen with Appium, capturing a screenshot, and comparing it with an approved reference image using Appium’s Images plugin. Choose the comparison mode according to what you need to verify: overall similarity, a smaller image’s presence, or a match that tolerates transformations. The plugin’s defaults are parameters—not universal pass criteria.

What an Appium visual test checks

A visual assertion adds an image comparison to a regular Appium test. The test creates a session, performs the interactions needed to reach a target screen, captures the rendered state, then checks that image against a reference baseline your team has reviewed and approved.

As an Amazon Associate I earn from qualifying purchases.

Appium’s Images plugin provides the comparison endpoint; it does not define your baseline approval process or automatically make app state consistent. Treat baseline naming, storage, review, and the pass/fail rule as parts of your test design. The endpoint is documented as POST /session/:sessionId/appium/compare_images. It accepts a comparison mode, two base64-encoded images, and optional mode-specific options. Appium documents the Images plugin endpoint and its options.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set up an Android Appium session

Appium lists UiAutomator2 as a maintained driver for Android native, hybrid, and web automation. Install and start Appium, install the UiAutomator2 driver, and use the client library selected by your project. Client syntax differs, so follow the examples for your chosen client rather than assuming capabilities are constructed identically everywhere. See Appium’s ecosystem listing.

#1 Best Overall
Sale
Samsung Galaxy A17 5G Smart Phone 128GB US 1 Yr Manufacturer Warranty Black
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

When explicitly writing Appium-specific capabilities, use the appium: namespace. The common capabilities below identify the automation driver, an installable app, and—if needed—the particular Android device:

  • appium:automationName: set to UiAutomator2 to select the Android driver.
  • appium:app: provide the path to an installable application when the session should install that app.
  • appium:udid: provide a device identifier when the test must target a particular device. It is useful for selecting physical hardware, but a physical phone is not required for every test environment.

These capabilities do not by themselves make screenshots comparable across runs: device configuration and app state still matter. Appium explains capability namespacing and these common capabilities in its Session Capabilities documentation.

Rank #2
Tracfone Motorola Moto G 2025, 64GB, Saphire Blue (Locked to
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Tracfone plan required, activating is easy, just 3 steps.
  • DISPLAY: Immersive viewing on a 6.7-inch super-bright 120Hz display with powerful stereo speakers and Bass Boost for cinematic entertainment.
  • CAMERA SYSTEM: Advanced 50MP Quad Pixel camera captures sharp, detailed photos and videos in any lighting condition
  • PERFORMANCE: Lightning-fast 5G connectivity paired with a powerful processor and RAM Boost for smooth multitasking.
  • BATTERY LIFE: Long-lasting 5000mAh battery with TurboPower charging technology delivers hours of power in minutes.

Make the screen repeatable before capturing

  1. Establish the same starting state. Reset or seed app data as appropriate, and use the same login, navigation path, and relevant settings on each run.
  2. Control unrelated changing content. Where possible, stabilize remote data, rotating promotions, timestamps, or other content that is not the visual behavior under test. Appium does not automatically normalize dynamic content or mask it for image comparisons.
  3. Wait for the intended state. Wait for a meaningful UI condition that signals the target screen is ready, rather than relying only on an arbitrary pause. Capture after transient loading or animation has settled if those effects are not what the test is checking.
  4. Capture and retain evidence. Keep the current screenshot when a comparison fails; retaining the returned comparison information or visualization can help distinguish a layout change from an unstable test.

During test development, Appium Inspector can issue commands manually and display app hierarchies and screenshots. That can help you identify the route to a screen and the UI condition that indicates it is ready; it does not replace repeatable setup in the automated test. See Appium’s ecosystem documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the comparison mode for the assertion

Mode Best fit What it returns or expects Important limit
getSimilarity Checking overall similarity between a current screenshot and a baseline. A similarity score. The images must have equal dimensions. Decide what score is acceptable for this screen and test objective; there is no universal cutoff established by the plugin documentation.
matchTemplate Checking whether a smaller reference image, such as an icon, appears within a larger screenshot. A match rectangle and score; options include a threshold, multiple matches, and visualization. The documented score range is 0.0 through 1.0; the documented default threshold is 0.5. That default is not a recommendation for every app.
matchFeatures Matching images that may be rotated, scaled, or otherwise modified. A feature-based match using configurable OpenCV feature-detector and descriptor-matcher options. Choose it when the assertion needs to tolerate image transformation, not as a synonym for whole-screen similarity.

The modes answer different questions. A whole-screen regression check asks how similar two complete images are; an icon-presence check asks where a smaller target occurs; a transformed-image check asks whether recognizable features still match. Appium documents their behavior and options in the Images plugin endpoint reference.

Rank #3
Sale
Samsung Galaxy A17 5G Smart Phone 128GB, US 1 Yr Manufacturer Warranty Blue
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

Build the comparison and pass/fail rule

The exact client wrapper depends on your Appium client. The following language-neutral workflow shows the documented inputs and the decisions the test must supply; it is not a tested, copy-paste client implementation.

  1. Create a UiAutomator2 session with the app and intended Android target.
  2. Navigate to the screen and wait until its visual state is ready.
  3. Capture the current screenshot and load the approved expected image.
  4. Send both images, base64 encoded, to POST /session/:sessionId/appium/compare_images with the selected mode and any relevant options.
  5. Assert against the returned score or match information using a threshold chosen for this specific visual question.
  6. On failure, preserve the current screenshot and, when useful, the plugin’s comparison visualization for diagnosis.

For getSimilarity, determine the acceptable score by considering what changes matter to the screen under test; the plugin documentation does not prescribe a universal acceptance value. For matchTemplate, you may set the threshold, request multiple matches, or request a visualization. If you leave the threshold unspecified, the documented default is 0.5, within a score range of 0.0 to 1.0. Review the actual comparison result rather than treating that default as proof that a match is meaningful. For matchFeatures, select detector and matcher options that suit the expected transformation and image content.

Rank #4
Sale
Samsung Galaxy S26 Ultra, Unlocked Android Smartphone, 512GB, Black
  • PRIVACY DISPLAY: Automatically hide your screen from those beside you. The built-in privacy display can be preset¹ to turn on when receiving notifications, typing passwords, or using specific apps
  • TYPE IT IN. TRANSFORM IT FAST: Enhance any shot in seconds on your smartphone by using Photo Assist² with Galaxy AI.³ Add objects, restore details, or apply new styles by simply typing or tapping
  • NIGHTS, CAPTURED CLEARLY: From gigs to city lights, record and capture moments after dark with clarity using Nightography so your photos and videos stay crisp and clear on your Samsung Galaxy
  • MAKE IT. EDIT IT. SHARE IT: Turn everyday moments into something personal with creative tools built right into your mobile phone, whether it’s a special contact photo, custom wallpaper, an invitation or more⁴
  • HELP THAT KEEPS UP: Stay in the moment while Now Nudge with Galaxy AI helps you respond faster and stay organized with smart suggestions⁵ that appear exactly when you need them on your phone

Keep baselines useful over time

  • Version baseline images alongside the test code or in a controlled artifact store, and identify each with the screen and relevant app/device configuration.
  • Review baseline changes deliberately. Do not replace the approved reference automatically every time a test fails; doing so can turn regressions into accepted output without review.
  • If device size, density, or rendering changes the layout, maintain separate appropriate baselines or choose an assertion that checks the invariant you actually care about.
  • When a test is flaky, first check state setup, readiness conditions, and dynamic content before loosening a comparison threshold.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting common failures

  • The session does not start or the wrong automation driver is selected: confirm the UiAutomator2 driver is installed and that the session uses appium:automationName with the value UiAutomator2.
  • The app is not installed or the intended device is not selected: check the appium:app path and, when targeting a specific device, the appium:udid value. Capability syntax and setup details can vary by client.
  • getSimilarity cannot compare the images: confirm that the screenshot and baseline have equal dimensions. If they do not, capture under a consistent configuration or use a mode that fits the actual assertion.
  • matchTemplate finds no match: verify that the reference crop is present and corresponds to the current UI, then inspect the screenshot and comparison visualization. A threshold that is too strict can reject a real match; one that is too permissive can accept an irrelevant one.
  • The visual assertion fails intermittently: make navigation and data deterministic, wait for a meaningful ready condition, and control unrelated changing content. A more permissive score is not a substitute for stable test state.
  • A baseline changes on a different device: check whether the layout or rendering differs for that target. Use target-specific references when the expected pixels differ, or assert against a feature that should remain invariant.

Or skip the browser setup

Appium is the right route for testing Android app screens through an app automation session. For website captures in a browser, ScreenshotNeo offers a separate screenshot API and MCP server for developers. A single GET request can return an image or PDF; its clean-shot options accept cookie and consent banners before capture and remove more than 60 known consent platforms, newsletter popups, and chat widgets, with each step configurable. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status. Its MCP server exposes take_screenshot, get_page_info, and capture_pdf for AI agents.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Example cURL request for a website screenshot (replace the URL with the page you want to capture):

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. ScreenshotNeo is not a replacement for an Appium session or an Android app visual test; it is an option when the target is a web page. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Learn about ScreenshotNeo or sign up for 1,000 free screenshots a month, with no card.

Quick Recap

Best Value
Tracfone Moto g Play 2024 Prepaid Phone with a 1-Yr Plan Included
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Activating is easy, just 3 steps.
  • ACTIVATION Promotion: Includes 1500 min, 1500 texts & 1500 MB Data + add more as you need it
  • CAMERA SYSTEM: 50MP Quad Pixel camera. Capture sharper, more vibrant photos day or night with 4x the light sensitivity.
  • PERFORMANCE: Blazing-fast Qualcomm performance. Get the speed you need for great entertainment with a Snapdragon 680 processor and 4GB of RAM.
  • 64GB built-in storage. Get plenty of room for photos, movies, songs, and apps. Made for US

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.