XPath and CSS Locators for Test Automation (Udemy.com)
Build stable XPath and CSS selectors using DevTools for Selenium, Playwright, and modern web apps
Created by: Dmitry Shyshkin
Last updated January 2026
What you will 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
How it compares
Against the other 108 rated Udemy courses in Selenium on CourseDuck:
- Rating4.6 out of 5higher than 79% of them
- Reviews4,990#12 of 109 by number of reviews
- Length4.7 hoursshorter than 74% of them
- Last updatedJanuary 2026more recently than 78% of them
Course Description
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.
Instructor Details
- 4.6 Rating
4,990 Reviews
Dmitry Shyshkin
Hi, I’m Dmitry Shyshkin, a test automation architect and educator with over 15 years of real-world experience in automation engineering.
I currently work as a Principal Software Development Engineer in Test, where I design and maintain scalable automation frameworks for complex web, API, and end-to-end systems. My background is strongly hands-on and architecture-focused—everything I teach is based on how automation works in real companies, not simplified demos.
I’ve been teaching on Udemy since 2018 and have helped 100,000+ students across 9 in-depth courses covering Selenium, RESTAssured, Java, Python, XPath, and modern test automation practices. My courses are structured, practical, and designed to give you skills you can apply immediately at work.
I continuously update my content to reflect current tools, best practices, and industry expectations, so you’re learning approaches that are relevant today—not outdated theory.
Whether you’re starting your automation journey or looking to level up professionally, my goal is to help you build confidence and strong, real-world automation skills.
More courses by Dmitry Shyshkin
Selenium WebDriver with Java: AI-Powered Test Automation (2026)
4.6 (20,271 Reviews)
Provider: Udemy
Time: 16.6h
$89.99
Advanced Selenium WebDriver with Java and TestNG (2025)
4.6 (4,217 Reviews)
Provider: Udemy
Time: 4.7h
$10.99
REST Assured. API test automation for beginners (2024)
4.5 (2,546 Reviews)
Provider: Udemy
Time: 3.2h
$11.99
Advanced Selenium testing framework with Java (2025)
4.5 (666 Reviews)
Provider: Udemy
Time: 3.3h
$69.99
Python: The Complete Guide for Software Testers (2023)
4.6 (459 Reviews)
Provider: Udemy
Time: 8.5h
$19.99
More Selenium courses
Appium Mobile Automation - Android & iOS + Frameworks + CICD (2024)
4.7 (2,620 Reviews)
Provider: Udemy
Time: 40h
$84.99
Learn Selenium with Python, PyTest & Frameworks (2025)
4.7 (2,394 Reviews)
Provider: Udemy
Time: 46.7h
$79.99
Selenium WebDriver 4, Cucumber BDD, Java & More! (2025)
4.7 (2,145 Reviews)
Provider: Udemy
Time: 10.1h
$84.99
Java Design Patterns & Devops to build Selenium Framework (2022)
4.7 (917 Reviews)
Provider: Udemy
Time: 7.2h
$59.99
Selenium Python with Behave BDD(Basic + Advance + Architect) (2026)
4.7 (735 Reviews)
Provider: Udemy
Time: 24.1h
$74.99
Selenium Webdriver with Java & TestNG Testing Framework (2026)
4.7 (460 Reviews)
Provider: Udemy
Time: 11h
$11.99
Reviews
By Sara Bartha on 11/14/2020
It was a very interesting course, I have learned a lot. Dimitry explains everything very nicely so I can easily understand them.
By Aremu Ayo on 11/7/2020
easy to understand and it is applicable
By Jemma McCreesh on 11/7/2020
Very good explanations and demonstrations throughout.
By Csaba Hari on 11/7/2020
Greatly explained everything to know about xpaths in a very short amount of time. If you want to learn everything to know about xpaths in 3 hours this is the course for you.
By Greigh MacMichael on 11/7/2020
I wish the resources had some notes, although I did make my own on the way.
By Naeem Akram on 10/25/2020
This is a good course about a very specific topic. I like it.
By Ashwin Bala on 10/18/2020
Very clear and simple
By Tomasz Weiss on 10/16/2020
Zainteresowa mnie. Dobra jako nagrania. :)
By Dmitry Vlasenka on 9/26/2020
This is awesome. The giving information is so valuable. The structure and teaching style is convenient and easy to get properly. 100 % recomend.
By Pavan on 9/23/2020
It is really good and understood all the concepts very quickly
By Brigitta van Rensburg on 9/18/2020
I really enjoyed the course it was very insightful. Just check your videos as some start off very blury at the beginning of each course. Thank you.
By Lucky Jain on 9/7/2020
Thank you so much. Course was good :)
Quality Score
No CourseDuck member has rated this course yet. Taken it? Give each part a thumbs up or down.
Overall Score : 92 / 100












