Making Your Appium Tests Fast and Reliable, Part 4: Dealing With Unfindable Elements

January 23, 2026 · 11 min read · Tool Comparison

HeadSpin Platform
Automated & amp; manual testing made leisurely through information science insights.
Differentiating capabilities:
  • Blanket end-to-end automation of QA process
  • Comparative analysis of app execution against peers
  • Uninterrupted monitoring of app performance using synthetic information for higher availability of apps
  • Easy-to-use developer friendly platform
cloudtest go
Affordable Real Device Testing for Emerging Teams
cloudtest go
Low-priced Existent Device Testing for Digital Enterprises
cloudtest go
The Ultimate Solution for a Powerful Blend of Functional & amp; Performance Testing!
cyol
TEM
New
Centralized mobile test execution in cloud
cyol
Enhance Your Accessibility Testing With HeadSpin
cyol
Automate camera-based testing

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

retail

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

Making Your Appium Tests Fast and Reliable - Part 4Making Your Appium Tests Fast and Reliable - Part 4

Making Your Appium Tests Fast and Reliable, Part 4: Dealing With Unfindable Elements

Published on
June 20, 2018
Updated on
Published on
May 31, 2022
Updated on
 by 
 Jonathan LippsJonathan Lipps
Jonathan Lipps
This article is the 4th in a multi-part series on test swiftness and reliability, invigorate by a webinar I afford on the same subject (you canwatch the webinar here). You might also want to check out,, and.

One of the sad truisms of mobile testing is that we can & # x27; t invariably get what we want. The stack is so complex, the tools so nascent, that we are often in a view of get to try weird hacks just to get our test to work. Appium does everything it can to canonize the nigh reliable weird hack as official endpoint, so you can just go about your day writing straightforward Appium client codification. But sometimes, the world doesn & # x27; t cooperate.

One common occurrent in this category is when an element is intelligibly visible on the screen, and yet can not be found. You & # x27; ve printed out the page germ. You & # x27; ve gone search in Appium Desktop, and sure enough, there & # x27; s no sign of the component! Why could this be? There are a number of reasons, but usually it has to do with how your app is developed. For iOS and Android, Appium is fundamentally at the mercifulness of the automation engines it progress on (XCUITest and UiAutomator2, respectively). These engines use the accessibility layer of the OS to determine which elements are available for mechanization. Oftentimes, apps which employ custom UI components have drop to register these custom components with the approachability service. This means that said element are essentially inconspicuous from the perspective of XCUITest/UiAutomator2, and hence un-automatable from the perspective of Appium.

If this line your trouble, and if you hold the ability to vary the app beginning codification (or can convince someone else to), the solution is really pretty straightforward: simply become on availability for your custom UI controls! Both Apple and Google mention how in their Dr., but it & # x27; s easy to see why a developer might forget to do this, since it doesn & # x27; t affect the functionality of the app. Anyway, you can check out the proficiency at these tie:

If changing the app code isn & # x27; t an option, or if there is some other reason that your element is not findable (for example, React Native doing something goofy when you set your factor & # x27; s position toabsolute), you might need to pull out the big artillery. (Sorry, that sound wild: I should say, you might need to pull out the big keyboard! Because coding happens on keyboards!) Regardless of metaphor, what am I referring to? Tapping by coordinates. That & # x27; s correct: with Appium you can always tap the screen at any x/y position you like, and the tap will (/should) work. If the UI control you are targeting is underneath, the net result will be the same as having called afindElementcommand and so callingclick()on the result object.

There & # x27; s a problem, though, which is that tapping by coordinate is notoriously brittle -- -hence why my suggestions on how to do it right are showing up here, in our series on test speed and dependableness. But maiden, why is tapping by coordinates brittle? For all the same reasons XPath is plausibly not a full locater strategy, and more

  • Different versions of your app might put the element in a different place on screen
  • Different dynamic data on the blind might shove the element around even within the line of a individual automation session
  • Different screen size might make the element fall under a different coordinate

One tantalizing solution would be to detect the constituentvisually, signification by comparison with a credit image. In fact, Appium can do this! But it & # x27; s pretty new and innovative, and will be the subject of a future Appium Pro edition once all the piece are firmly in place.

In the meantime, a maiden pang at do tip at a coordinate more reliable would be to control our coordinate itself is dynamically calculated found on conditions. For example, if we know that our app renders in completely the same proportions across different screen sizing, we can lick the last problem in the list above by storing coordinates as percentages of screen breadth and tiptop in our code, kinda than storing actual x and y values. Then we determine the specific coordinates for a given test run only after making a call todriver.manage () .window () .getSize (), so we can become the percentages backwards into coordinates.

This is a good starting, but it still doesn & # x27; t facilitate us in the event where the element might have move around for a variety of reason. Another idea is to chance the coordinates of your unfindable element via mention to an element whichis findable.

The key insight of this tactic is that it & # x27; s frequently the example that the position of the coveted ingredient is always fixed in relationship to some early element, which may be base utilise the normalfindElementmethods. We can use the size and position of the citation element to calculate absolute coordinates for the desired element. Of course, you & # x27; ll have to discover your app & # x27; s pattern close to determine which features of the reference component are useful. For example, you might decide that the desired element is always 20 pixels to the right of the cite element. Or, it could be halfway between the right edge of the reference element and the right edge of the screen. Using a combination of the reference element & # x27; s bounds and the screen dimensions, pretty much any position for your desired element can be point dynamically and dependably.

Let & # x27; s take a look at a concrete example usingThe App. Currently, the initial screen of The App looks like this:

The app

In reality, I can find all the elements I care about via Accessibility ID. But let & # x27; s act that the & quot; Login Screen & quot; list point is not approachable, and I can & # x27; t see it in the hierarchy at all. What I & # x27; m going to do is garner info about the element right below it (& quot; Clipboard Demo & quot;), and use that to tap the Login Screen element dead center. I will rely on the facts I know about my app, which is that & quot; Login Screen & quot; is a list point of the same dimensions as & quot; Clipboard Demo & quot;, and appears directly before it in the list. All I need to do, then, is find the centre of & quot; Clipboard Demo & quot;, and then subtract the height of the list item, and I & # x27; ll have the coordinate for the centre of & quot; Login Screen & quot;. Basic math, flop? So let & # x27; s have a face at the codification (which acquire we & # x27; ve gotdriver and wait objects all ready for us):

// first, find our cite constituent WebElement ref = wait .until (ExpectedConditions.presenceOfElementLocated (referenceElement)); // get the position and dimensions of the reference factor, and find its center point Rectangle rect = ref.getRect (); int refElMidX = rect.getX () + rect.getWidth () / 2; int refElMidY = rect.getY () + rect.getHeight () / 2; // set the midway point of our desired ingredient; we cognise it is one row above the // reference element so we simply have to deduct the height of the reference element int desiredElMidX = refElMidX; int desiredElMidY = refElMidY - rect.getHeight (); // perform the TouchAction that will tap the craved point TouchAction action = new TouchAction < > (driver); action.press (PointOption.point (desiredElMidX, desiredElMidY)); action.waitAction (WaitOptions.waitOptions (Duration.ofMillis (500))); action.release (); action.perform (); // finally, verify we made it to the login blind (which means we did so tap on // the desired element) wait.until (ExpectedConditions.presenceOfElementLocated (username));

This is a direct implementation of what I phrased in words above. The important command are of course the commands for getting the boundary of the quotation element(element.getRect ()), and the commands for setting up an AppiumTouchActionto natively tap on a coordinate. There are a few line responsible for this latter function, but they & # x27; re straightforward: press on a coordinate, wait for 500ms, and release. That & # x27; s it!

Happily, this proficiency is cross-platform, so the above codification will run on both the iOS and Android versions of my app without limiting. And it is relatively robust and reliable. It will never be as reliable as tick on an ingredient found by Accessibility ID, of course, because in that case we have a guarantee of calling an underlying tap method on a platform-specific element reference. In most suit, that element reference will subsist even if the app is reorganized spatially. But if we are forced out into the cold dark, beyond all ability to find elements, then the technique discuss hither will help you at least retain a modicum of sanity.

If you & # x27; re concerned in a runnable example showing the above code working on both iOS and Android, simplycheck out the codification for this edition! And check backwards presently for the up-to-the-minute in this mini-series on hurrying and reliability.

Author & # x27; s Profile

Jonathan Lipps

LinkedIn
Author & # x27; s Profile

Piali Mazumdar

Lead, Content Marketing, HeadSpin Inc.

Piali is a dynamic and results-driven Content Marketing Specialist with 8+ eld of experience in crafting engage narratives and market collateral across diverse diligence. She excel in collaborating with cross-functional teams to acquire innovative content scheme and deliver compelling, authentic, and impactful content that resonate with target audiences and enhances brand genuineness.

LinkedIn

Making Your Appium Tests Fast and Reliable, Part 4: Dealing With Unfindable Elements

4 Parts

regression intelligence blog
-

Regression Intelligence hardheaded usher for advanced exploiter (Part 3)

Coming Soon
Regression Intelligence practical guide for advanced users
-

Regression Intelligence practical guidebook for advanced users (Part 4)

Coming Soon

Discover how HeadSpin can empower your business with superior essay capabilities

Our Platform enables you to:
accelerate time-to-market
Accelerate time-to-market, gaining a competitive edge
faster development cycles
Boost developer/QA productivity with faster development cycles
automated buil-over-build regression testing
Automate build-over-build regression testing for consistent results
gain better visibility into functional & performance issues
Gain better profile into functional and performance issues
reduce mean time
Reduce mean time to identify/resolve during test, QA, and production
evaluate audio, video & qoe
Evaluate sound, video, and content quality of experience (QoE) effortlessly
The trusted choice for spherical endeavour
Adobe
Hargreaves Lansdown
Truecaller
Crazylabs
Nedbank
Numeracle
Veryon
Close

Discover how HeadSpin can empower your concern with superior testing potentiality

Our Platform enables you to:
accelerate time-to-market
Accelerate time-to-market, gaining a competitive edge
faster development cycles
Boost developer/QA productiveness with quicker development cycles
automated buil-over-build regression testing
Automate build-over-build regression testing for consistent results
gain better visibility into functional & performance issues
Gain better visibility into functional and execution topic
reduce mean time
Reduce mean time to identify/resolve during test, QA, and production
evaluate audio, video & qoe
Evaluate audio, video, and content quality of experience (QoE) effortlessly
The trusted choice for global enterprises
Close

Discover how HeadSpin can empower your business with superior testing capabilities

Our Platform enables you to:
accelerate time-to-market
Accelerate time-to-market, acquire a private-enterprise edge
faster development cycles
Boost developer/QA productivity with quicker development round
automated buil-over-build regression testing
Automate build-over-build regression try for ordered results
gain better visibility into functional & performance issues
Gain best profile into functional and performance issues
reduce mean time
Reduce mean clip to identify/resolve during trial, QA, and production
evaluate audio, video & qoe
Evaluate sound, video, and contented calibre of experience (QoE) effortlessly
The trusted pick for global enterprises
Close

Connet Now

Wipro LogoVMLYR Logo
Close
Book a Meeting
Products
footer down arrow
Solutions
footer down arrow
Industries
footer down arrow
Features
footer down arrow
Support
footer down arrow
Resource Center
footer down arrow
Why Choose HeadSpin?
footer down arrow
Copyright © 2026 HeadSpin, Inc. All Rights Reserved.

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free