Skip to main content
SeleniumDecoded
All Chapters Chapter 2

Locators & Navigation

Find elements with IDs, CSS selectors, XPath, relative locators, and a strategy that survives UI changes

  1. 1

    ID, Name, and Class Locators

    Master the most common and reliable element locators: ID, Name, and Class Name attributes.

    Selenium 3 & 4 Stable
  2. 2

    CSS Selectors

    Master CSS selectors for finding elements in Selenium. Learn syntax, best practices, and common patterns.

    Selenium 3 & 4 Stable
  3. 3

    XPath Basics

    Learn XPath fundamentals for locating elements when CSS selectors aren't enough.

    Selenium 3 & 4 Medium
  4. 4

    XPath Advanced Techniques

    Master advanced XPath patterns for complex element location scenarios.

    Selenium 3 & 4 Medium
  5. 5

    Relative Locators

    Use Selenium 4's relative locators to find elements based on their visual position relative to other elements.

    Selenium 4 Medium
  6. 6

    Locator Strategy Guide

    A decision framework for choosing locators that survive UI changes: test IDs, the priority order, handling dynamic attributes, text-based lookups, uniqueness checks, and the anti-patterns that make suites brittle.

    Selenium 3 & 4 Stable