What you'll learn:
- Build stable and readable XPath and CSS locators for test automation
- Locate complex and dynamic web elements using advanced XPath techniques
- Write clean CSS selectors and understand when to use CSS vs XPath
- Debug, fix, and improve broken or flaky locators using Chrome DevTools
XPath and CSS locators are the core skills behind reliable UI test automation. Flaky tests, unstable selectors, and “element not found” errors almost always come from poor locator strategy.
In this course, you’ll learn how to build stable XPath and CSS locators for real web applications using Chrome DevTools. The focus is practical: how to read the DOM, understand element relationships, and create selectors that work in Selenium, Playwright, and modern automation frameworks.
You’ll start with locator fundamentals and quickly move into real XPath and CSS patterns used in production test automation:
XPath syntax, predicates, and relative paths
XPath functions like text(), contains(), starts-with(), and not()
XPath axes for locating elements relative to other elements
CSS selectors, attribute matching, combinators, and pseudo-classes
XPath vs CSS: when to use each and why
Debugging and fixing broken locators in DevTools
This course avoids auto-generated selectors and teaches you how to design clean, readable, and maintainable locators that survive UI changes. Every XPath and CSS selector is tested directly in the browser before being used in automation.
Who this course is for:
QA engineers, SDETs, and test automation engineers
Selenium and Playwright users
Developers writing or reviewing UI tests
Anyone struggling with flaky tests caused by bad locators
By the end of the course, you’ll be able to read any DOM, choose the right locator strategy, and write reliable XPath and CSS selectors with confidence.