Locators (ID, CSS, XPath) — Roadmap Step & Resources
Finding the right element reliably, and why some locator strategies are more fragile than others
- Level: intermediate
- Estimated time: 2 days
- Roadmap: SDET / Automation Testing
Before this step
Mini projects
- Write locators for 10 elements on a real page using ID, CSS selectors and XPath
Interview questions
- Why are ID-based locators generally preferred over deeply nested XPath expressions?
Study resources
- Finding Web Elements (Article) — The official Selenium documentation's reference for locator strategies.
- Selenium Locators Explained (Video) — A practical walkthrough of ID, CSS, XPath and other locator strategies.
Part of
- Web UI Automation with Selenium — section
- SDET / Automation Testing roadmap — the full learning path