Quest to solve the XPath Problem in Mobile Test Automation

I’m a mobile developer with over 10 years of experience. I’ve led engineering teams at Appunfold, which was acquired by UserIQ, and later at Jiny, which was acquired by Whatfix. In both journeys, I saw firsthand how much pressure teams face to ship high-quality mobile apps across multiple platforms — Native Android, iOS, React Native, Xamarin, Ionic — you name it.
But one thing consistently slowed us down: Testing.
We invested in Appium, set up test frameworks, and wrote automation scripts to validate features across all these platforms. But even with all that effort, every small UI change meant hours of rewriting and debugging brittle XPath selectors. Every release introduced breakages. Every redesign threw test stability out the window.
Our automation became a burden rather than an asset. We knew this wasn’t scalable. And worse, skipping those fixes meant shipping bugs to production. That’s when we asked ourselves: Is this just our problem, or does the industry feel the same?
We decided to reach out and speak to 50+ people in the mobile testing and QA space. What we learned shaped everything that followed.
This blog is not about criticizing XPath as a technology. It’s about understanding why XPath, in the way it’s used today in mobile testing, causes instability, pain, and technical debt. More importantly, it’s about how these deep-rooted problems shaped the origin of Finalrun.
1. Brittle and Unstable XPaths: Death by UI Change
This was the most common pain point we heard. Every UI update — big or small — has the potential to break a test. That’s because XPath selectors are tightly coupled to the app’s structure, not its intent.
“DOM structure changes, XPath changes” — Jyothi Yadav, QA Lead at Thomson Reuters
“Flaky Tests. XPath and locator issues. Test maintenance.” — Piyush Sharma, LeadSDET at Gojek
“Locator changes due to UI restructuring frequently break existing tests.” — Anurag Sinha, QA Manager at Hotstar
When tests fail after every sprint, confidence in automation drops. Teams stop trusting their pipelines. Manual QA fills the gap. And automation becomes something people stop investing in.
2. Dynamic UIs Break XPath
Modern mobile apps are highly dynamic — elements appear or shift based on scroll position, data state, and user interaction. XPath expressions, which rely on static structure, don’t survive in this environment.
“Duplicate XPaths: Multiple elements with similar identifiers cause random clicks.” — Sharathchandra Singireddy, SDET at MPL
“Scroll handling and element identification on long, dynamic screens are major pain points.” — Avanti, QA Manager at LeapFinance
“Struggle with locator stability, especially for icon-only buttons or SVG elements.” — Punit, QA Lead at Flobiz
Testers described scenarios where XPath pointed to the wrong icon after layout changes, or missed interactable elements because they hadn’t yet been rendered or scrolled into view.
3. No Good Locators? XPath Becomes the Default Crutch
We discovered that teams don’t choose XPath out of preference, it’s often the fallback when developers don’t expose testable attributes like IDs or content descriptions.
“No ID in web-based UI element — will be difficult to test.” — Ramesh Hosamani, QA Principle Lead, Akamai Technologies
In other words, XPath isn’t the root problem, it’s a symptom of a deeper collaboration gap between dev and QA. Without clean, unique locators, testers are forced to reverse-engineer brittle paths through the UI.
These aren’t just minor inconveniences, they’re structural problems. When locators break, trust in automation breaks. When automation becomes hard to debug, it gets deprioritized. And when test maintenance takes longer than writing the feature, teams stop scaling.
This is why we started Finalrun, not to patch over these issues, but to build a fundamentally better foundation for UI automation. One that makes tests:
Predictable across app updates
Easy to write and debug
Consistent across iOS and Android
We believe that automation should mirror how users actually see and interact with the UI — not how the view hierarchy happens to be structured at runtime.
Related articles
If you want to know how we are achieving 99% accuracy UI automation with finalrun. Read the following articles:
The future of UI Element Targetting: Finalrun Identifiers beats Xpath
📅 Book a Demo
See how FinalRun fits into your existing workflow with a live Demo.
Subscribe to my newsletter
Read articles from Finalrun directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
