← back to writing
essay · /scalable-automation

Most automation breaks because it was written for a world that doesn't exist.

I wrote this after watching the same failure mode repeat across three projects: scripts that passed every staging run and broke the moment a real user touched the UI. The fix isn't better selectors. It's a different mental model.

medium · linkedin article 11 min read design patterns May 2026
read full article on medium → discuss on linkedin →
"Your script should grow with the application — not break when it does."
~40%
of automation failures trace back to selector assumptions, not logic bugs
6
patterns that eliminate the most common failure modes entirely
1
mental model that holds up across every UI framework and every team size
// a few patterns from the article
Pattern 01 · Foundation
The Scoped Action Pattern
core

The single shift that makes everything else work: stop searching globally and start anchoring to a known container first. $$('.card') finds every card on the page. container.$$('.card') finds only yours.

mental-model
Find Container // anchor first, always
Find Items // scope within that context
Select & Act // verify the side effect
Handle Errors // fail loud with full context
Pattern 05 · Waiting
Kill Static Waits. Wait for State.
common culprit

waitForTimeout(3000) is hope dressed up as engineering. The article covers how to chain visibility → enabled → position-stable waits, and how to write a diagnostic error that tells you exactly what it waited for and what the DOM looked like when it gave up — instead of just "element not found."

Anti-pattern · What to drop
Fire-and-Forget Actions
watch for this

Clicking "submit" and moving on without verifying the outcome means your test can pass green while the feature is silently broken. The fix is straightforward — but the article explains why teams skip it and how to make verification the path of least resistance.

Three more patterns in the full article.
List Container · Index Fallback · Pagination Resilience · Robust Form Filling — with code walkthroughs on Medium.
read on medium →
// linkedin

The post

Shared on LinkedIn — read the reactions and discussion thread.

open on linkedin →