Module R
Locator Challenges
Real-world DOM patterns that often break naive selectors. Practice writing robust locators here.
Stable IDs ✓
Easy mode — every element has a clean id and data-testid.
Dynamic IDs ⚠️
IDs regenerate on every page load. Use text or data-stable.
Current dynamic suffix: zr3plu · stable: data-stable
Duplicate IDs (anti-pattern) ⚠️
Three buttons all share id="duplicate". Locate by index or context.
Identical siblings
Same tag, no IDs, no classes — pick by index/position.
- Item one
- Item two
- Item three
- Item four
Deeply nested DOM
Element is 8 levels deep — XPath challenge.
No attributes — text only
No id/class/data — locate by visible text.
Hidden vs visible
Three "Submit" buttons, only one is visible.
Overlapping z-index
Invisible overlay covers the button. Click intercepted.