
Create an engaging start that focuses on students’ pains and outcomes first, then briefly introduce yourself and the course structure
Give concrete, practical instructions on how to follow the course, practice effectively, and use support/resources
Define locators and their role in identifying elements on a webpage
Overview of locator strategies supported by automation frameworks
Explain why we focus on these two in this course
Teach students how to quickly test XPath and CSS locators using Chrome DevTools
Introduces the concept of XPath and its role in locating elements in web pages
Teaches key building blocks and relationships within an XML/HTML document
Demonstrates the difference between absolute and relative paths, and why relative paths are preferred
Covers the syntax structure and attribute-based targeting
Clarifies how these symbols define context and hierarchy
Explains indexing and selecting multiple matches
Introduce and demonstrate most used XPath functions
Teach how the . operator works compared to text()
Show how AND, OR, and grouping increase precision
Cover wildcard usage and resilient locators for dynamic UIs
Set expectations for what “advanced” means, and when to use these skills in real projects
Explain hierarchical navigation using parent, child, ancestor, and descendant
Cover sibling-based navigation for elements on the same level
Teach building powerful relative paths that connect multiple elements logically
Explain the union operator (|) to locate multiple elements with one XPath
Dedicated lecture for locating SVGs and namespaced XML nodes
Teach deep DevTools workflows for unstable or changing pages
Set expectations and explain why CSS selectors are important
Define CSS selectors and explain their syntax and structure
Teach how to locate elements using attributes and partial matches
Explain how to target elements precisely using combinations
Explain what makes CSS selectors “advanced” and why these concepts matter in automation
Teach how sibling combinators describe horizontal relationships between elements
Explain how structural pseudo-classes target elements by their position inside a parent.
Teach two advanced CSS pseudo-classes that are practical in automation: :has() and :not().
Teach strategies to build CSS selectors that remain stable when page attributes, structure, or order change
Set context for the comparison. Explain why understanding both helps write flexible, maintainable locators.
Explain when XPath is the best locator choice and when it becomes problematic.
Explain where CSS selectors shine and where they reach their limits in automation.
Direct, scenario-based comparison to guide real-world decisions.
Explain how frameworks implement XPath and CSS differently.
Explain where and why locator strategies fail or require special handling.
Consolidate key lessons from both locator types
This lecture teaches students how to correct bad DevTools auto-generated locators.
In this lecture, we will practice debugging and fixing broken locators.
This lecture is our final locator challenge for the course.
Briefly remind students what they achieved, highlight a few core principles, suggest next steps, and close the course with thanks and a pointer to the bonus lecture
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.