Published: April 8, 2026
Automation First App Design Framework & Best Practices
A concept promoting how developers can design their apps to be automation-friendly from day zero – a tester’s perspective.
Introduction
As an automation tester, I’ve spent countless hours wrestling with applications that seemed deliberately designed to resist automation. Brittle selectors that break with minor UI tweaks, components without identifiable properties, and complex workflows hidden behind unclear states—these are the daily frustrations we face.
But here’s the thing: most of these challenges are preventable. When developers design applications with automation in mind from the start, testing becomes faster, more reliable, and significantly more maintainable.
This isn’t just about making our jobs easier—it’s about delivering higher-quality software faster.
This article shares practical recommendations that every application developer should follow to make their applications “automation ready.”
Make Elements Identifiable and Stable
The Problem:
Many apps rely solely on CSS class names or generated IDs that change with every build. Automation frameworks like Selenium, Playwright, and Appium depend on locators (unique identifiers) to interact with elements.
What Developers Should Do:
- Add
data-testidattributes to interactive elements (buttons, inputs, forms, links) - Keep these IDs stable across releases—treat them like public APIs
- Avoid relying only on dynamic class names or XPath positions
Real Example:
// ❌ BAD - Changes frequently
<button className="btn-primary-v2 btn-submit-form">
Submit
</button>
// ✅ GOOD - Stable identifier for testers
<button data-testid="form-submit-button" className="btn-primary-v2">
Submit
</button>
Submit
Why This Matters:
When you add data-testid, testers can reliably locate elements using page.locator('[data-testid="form-submit-button"]') in Playwright or find_element(By.CSS_SELECTOR, '[data-testid="form-submit-button"]') in Selenium.
Use Semantic HTML and Proper Label Associations
The Problem:
Generic <div> and <span> and elements without labels make it nearly impossible for testers to understand the purpose of controls and for accessibility tools to function correctly.
What Developers Should Do:
- Use semantic HTML elements:
<button>,<input>,<label>,<form> - Associate labels with inputs using
<label for="inputId"> - Use
aria-labeloraria-labelledbyfor complex components
You Might Also Like
Automation First App Design Framework & Best Practices
A concept promoting how developers can design their apps to…
But Where Are You Going to Run All of Those Tests?
Something interesting is happening in QA teams right now. AI…
Virtual vs Real Devices: What Actually Matters in Mobile Testing
If you’ve spent any time testing mobile apps, you already…