Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Udemy

XPath and CSS Locators for Test Automation

via Udemy

Overview

Build stable XPath and CSS selectors using DevTools for Selenium, Playwright, and modern web apps

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.

Syllabus

  • Introduction | XPath locators for Selenium
  • XPath basics | XPath locators for Selenium
  • Advanced XPath | XPath locators for Selenium
  • Pros and Cons of XPath | XPath locators for Selenium

Taught by

Dmitry Shyshkin

Reviews

4.6 rating at Udemy based on 4838 ratings

Start your review of XPath and CSS Locators for Test Automation

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.