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
  7. 7

    Working with Web Tables

    Read and iterate HTML tables in Selenium: find rows by cell text, map columns by header name, handle pagination, and verify sorting without brittle XPath.

    Selenium 4 Stable
  8. 8

    Locating Dynamic Elements

    Handle dynamic IDs and generated classes in React, Angular and Vue apps: data-testid strategy, partial matching, stable anchors, and locator patterns to avoid.

    Selenium 4 Stable