To run visual tests on an Android app with Appium, drive the app to a known screen, capture a screenshot, and compare it with an approved reference image. Appium’s Images plugin provides three different comparisons: whole-image similarity, template search inside a screenshot, and feature matching for images that may be transformed. Choose the mode for the question your test asks, and set acceptance criteria for your app rather than treating a plugin default as a universal threshold.
What an Appium visual test checks
A visual assertion adds an image comparison to an ordinary Appium test. The test creates an Android session, performs interactions until the target screen appears, captures the rendered screen, and compares that image with a reference chosen by your team. A passing result means the comparison met the rule your test defines; it does not by itself prove that every aspect of the screen is correct.
Appium’s ecosystem documentation lists UiAutomator2 as a maintained driver for Android native, hybrid, and web automation. It also lists Appium Inspector, which can issue commands and show app hierarchies and screenshots while you develop a test. Use Inspector to identify and explore a screen; make screenshot capture and comparison part of the test flow you want to run repeatedly.
Set up an Android Appium session
Install and start the components
Use an Appium server, the maintained UiAutomator2 driver, and an Appium client for your programming language. Install and start the driver according to the Appium ecosystem documentation, then start the server and connect your client to it. Client setup and method names vary by language and client version, so follow the examples for the client you selected rather than assuming one client’s syntax applies to all.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11#1 Best Overall
- 【Strong Adsorption】The inspiration of the silicone phone suction case comes from the adhesive force of the octopus. Each suction cup phone mount is 3.15 inches long and 2.17 inches wide, with 24 independent suction cups providing a stronger and more stable suction force, so you don't have to worry about your phone falling during use.
- 【Back of Phone Suction Grip】Remove the adhesive film on the phone suction cup and stick it on the phone case. You can then fix the phone on any smooth surface, which is very convenient. (The phone suction cup cannot be removed and reused after being attached to the phone case. It is recommended to attach it to a regular phone case, not a valuable one.)
- 【Widely Used】Our non-slip silicone phone sticky grip mount attaches to almost any flat phone case and make it compatible with common mobile phones such as iPhone and Android.You can shoot, watch videos or video calls in the kitchen, gym, dance studio, bathroom and other places.
- 【Capture the Wonderful Picture】Whether you are a TikTok creator or just like to share videos and photos, this phone suction cup can help you hands-free capture wonderful videos and photos for sharing with friends.
- 【Note】You can fix the phone suction cup on a smooth surface such as a mirror or glass. If necessary, wipe the suction cup with a damp cloth to obtain stronger suction. Before releasing your hand, make sure the phone is firmly fixed. (Not applicable to rough walls, wooden surfaces, and other uneven surfaces)
Set the session capabilities
When written explicitly as W3C capabilities, Appium-specific capability names use the appium: namespace. The key capabilities for a basic Android session are:
appium:automationName: set toUiAutomator2to select the Android automation driver.appium:app: provide the path to an installable application when the session should install and launch that app.appium:udid: provide the device identifier when you need to select a particular Android device. Use it when targeting a specific device; it is not a requirement to buy hardware for every test setup.
Appium’s session capabilities documentation explains capability namespacing and common app, device, and driver capabilities. The exact client code for creating a session depends on the client. Configure the app path and target environment using that client’s documented session examples.
Make the screen repeatable before capturing it
A meaningful comparison requires the test to reach the intended screen under comparable conditions. Build the navigation and data setup into the test, and wait until the target state is visible before capturing. Appium’s image comparison endpoint does not automatically normalize app state or remove dynamic content.
- Control content that changes independently of the layout, such as time-sensitive text or remote data, when that content is not what the test is checking.
- Use the same app state, screen, and target-device configuration for a given baseline. If different devices render different layouts, maintain suitable references or choose a comparison that tests the invariant you care about.
- Keep approved reference images under version control and make baseline changes a deliberate review decision. Avoid replacing the reference automatically whenever a test fails.
Choose the right Images plugin comparison
The Appium Images plugin exposes the POST /session/:sessionId/appium/compare_images endpoint. It accepts a comparison mode and two base64-encoded images, with optional mode-specific parameters. The modes answer different questions; a whole-screen regression check and an “is this icon present?” check should not automatically use the same method or cutoff. See the Images plugin endpoint documentation for parameters and response details.
Rank #2
- SUPERIOR COMFORT — Unlike traditional circular ear buds, the design of EarPods is defined by the geometry of the ear. Which makes them more comfortable for more people than any other ear bud–style headphones.
- HIGH-QUALITY AUDIO — The speakers inside EarPods have been engineered to maximize sound output and minimize sound loss, which means you get high-quality audio.
- BUILT-IN REMOTE — EarPods with USB-C plug also include a built-in remote that lets you adjust the volume, control the playback of music and video, and answer or end calls with a pinch of the cord.
- COMPATIBILITY — Works with all devices that have a USB-C port.
- INTEGRATED MICROPHONE — A built-in microphone precisely captures your voice while you’re on the phone, taking a FaceTime call, or summoning Siri — so you’re always heard loud and clear.
| Mode | Use it to ask | Image relationship | Result to evaluate |
|---|---|---|---|
getSimilarity |
How similar are these two complete images? | The images must have equal dimensions. | A similarity score. |
matchTemplate |
Does this smaller reference appear inside the larger screenshot, and where? | A template image is searched for within another image. | A match rectangle and score. The mode supports a threshold, multiple matches, and optional visualization. |
matchFeatures |
Can corresponding visual features be matched despite image changes? | Useful when images may be rotated, scaled, or otherwise modified. | Feature matching using configurable OpenCV feature-detector and descriptor-matcher options. |
Whole-screen regression: getSimilarity
Use getSimilarity when both screenshots have equal dimensions and a whole-image score is relevant to the test. Decide what score is acceptable for that screen and test objective; the score is an input to your assertion, not a universal pass/fail rule.
Find a smaller visual target: matchTemplate
Use matchTemplate to look for a smaller reference, such as an icon, within a larger screenshot. The endpoint reports a rectangle and score, so the test can check both whether a match was found and where it occurred. Appium documents scores from 0.0 through 1.0 and a default threshold of 0.5. That threshold is a parameter default, not an endorsed cutoff for every app or visual target.
Match transformed content: matchFeatures
Use matchFeatures when the visual content may be rotated, scaled, or otherwise modified. The plugin documents options for OpenCV feature detectors and descriptor matchers. This mode is for matching visual features under transformation, not a substitute for an equal-size whole-screen comparison when the whole screen is what you need to validate.
Build the test flow and define failure behavior
The exact client wrapper depends on the Appium client you use. The following sequence maps the documented session capabilities and image-comparison endpoint into a test without implying a client-specific, ready-to-run code sample:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #3
- Secure Hold: Our PopSockets adhesive phone grip gives your cell phone a secure, comfortable hold in hand to help prevent drops while texting, taking photos, or scrolling on the go. Designed to stick firmly to most phone cases and devices.
- Hands-Free Made Easy: Easily turn your PopSocket into a phone stand to prop up your phone anywhere, perfect for watching videos, video calls, or following recipes. A must-have phone holder that keeps your device secure and ready for anything.
- Compatibility: Works with all phones, tablets, and Kindles. Sticks best to smooth, hard plastic cases and may not adhere to silicone or textured cases. Easily swap your PopTop to change up your style.
- Black PopSockets: Simple, refined, and endlessly versatile. A timeless essential for any phone.
- Travel Must-Have for People On the Go: A must-have travel accessory for flights, flying, airports, air travel, airplanes, planes, international trips, cruises, and long travel days. Key gadget for your airport haul, travel accessories and must-haves.
- Create a session using
appium:automationNameset toUiAutomator2, the app to test, and the intended device configuration. - Navigate through the app and wait until the screen’s visual state is ready.
- Capture the current screenshot and load the approved reference image.
- Send both base64-encoded images to
POST /session/:sessionId/appium/compare_imageswith the mode and any relevant mode-specific options. - Apply your test’s acceptance rule to the returned score or match information.
- When useful, retain the current screenshot and comparison visualization as failure artifacts so you can investigate a mismatch.
For a similarity score, choose and document a threshold based on the screen and the test’s purpose. For template matching, decide whether the match score and rectangle satisfy the assertion; do not rely on the documented default threshold as if it were calibrated for your app. Inspect returned comparison data and optional visualizations when a result is unexpected.
Keep baselines and results maintainable
- Name and organize reference images by the screen and app state they represent, and tie them to the device configuration used to produce them.
- Review changed baselines before accepting them. A legitimate UI change may require an update, but a failed comparison should not silently approve a new reference.
- When device rendering or layout differs, decide whether to keep separate references or assert a narrower invariant with an appropriate comparison mode.
- Save useful failure artifacts, such as the current screenshot and available comparison visualization, to make it easier to tell a genuine UI regression from a state or rendering difference.
Or skip the browser setup
For website screenshots rather than Android app tests, ScreenshotNeo is a website screenshot API and MCP server. One GET request returns an image or PDF; its screenshot features are not a replacement for Appium’s Android app automation or the Images plugin’s comparison modes.
For example, this cURL request captures a web page as WebP:
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 documentation for API details. ScreenshotNeo accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents using Claude, Cursor, or another MCP client. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.
Recommended Free Tools
Sign up for 1,000 free screenshots a month—no card required.
Rank #4
- [360 ° Flexible Rotation Design] Comes with a rotatable lanyard ring that supports 360 ° free rotation, effectively solving the problem of twisted and tangled lanyards
- [Wide compatibility] The ultra-thin 0.02-inch design does not block the charging port at all, and both wired and wireless charging can be used directly without removing the pad. Compatible with most smartphones such as iPhone, compatible with various wristbands, lanyards, crossbody straps, and keychains
- [Durable and Portable Material] Premium rust-resistant stainless steel material with good flexibility, which not only avoids scratching the phone case, but also has excellent anti rust and anti fading performance
- [Multi scenario Practical] Paired with a lanyard or wristband, hands-free use can be achieved. The phone is within reach and not easily dropped, ideal for daily commuting and outdoor activities. Suitable for full coverage phone cases, does not support half coverage phone cases
- [Quality Service] If you find any damage or other issues with the product upon receipt, please contact us immediately. We will handle it quickly
Troubleshooting visual test failures
The session does not start or selects the wrong device
Check that the Appium server and UiAutomator2 driver are installed and available, that the capability uses appium:automationName, and that appium:app points to the intended installable app. If a particular device is required, set the correct appium:udid. Consult your chosen client’s capability examples if the session request is rejected.
getSimilarity cannot compare the images
Confirm that the current and reference images have equal dimensions, as required by this mode. Also check that both images represent the intended screen and comparable device configuration before changing the acceptance rule.
matchTemplate does not find the expected target
Verify that the reference template is the target you intend to find and that it appears in the screenshot. Review the returned score and rectangle, and use the optional visualization to diagnose the match. Change the threshold only after deciding what score is meaningful for this specific target; the plugin’s default is not a universal standard.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →The comparison is inconsistent between runs
Check whether the test reached the same screen state and whether dynamic content changed. Wait for the intended state to appear and control changing content that is outside the visual behavior under test. If the target devices render differently, use device-specific baselines or test a visual invariant that should remain stable.
Best Value
- 【PKYAA Double Sided Silicone Suction Phone Case Mount】PKYAA With Double Sided 40 Strong and Reliable individual suction cups, PKYAA provides a thicken and upgraded universal silicon suction mount for your phone.
- 【Friendly to Content Creators】If you are a content creator or an online influencer, you can create videos anywhere with this suction mount completely hands free with this silicone cell phone mount for cases.
- 【HANDS-FREE & Adhere to Mirrors】This Double Sided silicone suction phone case mount allows you to stick your phone to the mirror easily. No longer holding your phone in one hand to watch video tutorials while making up.
- 【Strong Grip on the Smooth Surface】You can easily hang your phone anywhere with a smooth surface. All you do is you clean off your phone and smooth surface. It is STURDY and it not only sticks to mirrors, it also sticks to windows, it sticks to refrigerators, tiles and other clean, flat surfaces.
- 【Press Down Firmly Every 30 Minutes】Use your palm or fingers to press the phone down firmly and check it's secure before letting go. Apply even pressure for a few seconds to allow the suction cup to adhere properly. To maintain the grip and prevent accidental falls, it's a good practice to periodically reapply pressure to the suction cup.
Performance, reliability, and cost considerations
The documented comparison endpoint requires image data and returns comparison results; the reviewed Appium documentation does not establish universal execution-time, reliability, or infrastructure-cost figures for this workflow. In practice, plan for the time and storage needed to capture images, run comparisons, and retain useful failure artifacts. Keep test scope targeted: compare screens or elements that answer a defined quality question, and avoid treating every pixel difference as a meaningful regression without reviewing the app state and device conditions.
Frequently Asked Questions
Does Appium compare screenshots automatically?
No. The test must capture or load the images, call the Images plugin comparison endpoint, and apply its own assertion to the result.
Can I use the Images plugin comparison modes for native Android apps?
Yes. The Images plugin comparison endpoint can be used in an Appium workflow with an Android session, including one driven by UiAutomator2.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteDo I need a physical Android phone?
No. A physical device is optional; use `appium:udid` when you need to target a particular device in your test environment.
Quick Recap
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.

