Selenium / Scenario
The Locator Audit
Four locators from a real page object, four different time bombs. Audit them like the maintenance bill depends on it, because it does.
- Difficulty
- Medium
- Format
- Scenario
- Points
- 150
- Estimate
- 13 min
// MISSION BRIEF
Your Mission
You inherit LoginPage.java from a contractor who has left the building. The tests pass today. Your job is to spot which locators survive the next sprint and which detonate on the first UI tweak.
Review the page object and the page's HTML, then judge each locator. Decisions are weighted.
// FIRST CONTACT
Battle teaser
First artifact
LoginPage.java (locators)
The absolute XPath for emailField will break when:
- AOnly when the input itself is deleted
- BANY ancestor structure changes, a wrapper div, a reordered sidebar, a new banner above main, because every step of the path is a dependency
- CNever, absolute paths are the most precise option
Answers, scoring, hints, and the full battle stay sealed.
// SKILL TAGS
seleniumlocatorspage-objectsmaintainabilitycode-review