Chapter 2 is the browser knowledge every locator rests on: HTML structure and the DOM, attributes, ids and classes, CSS selectors, and XPath with its axes and functions. A4Q allocates 180 of the syllabus's 1200 instruction minutes here — the second largest block after WebDriver itself, and for good reason: a test suite is only as stable as the way it finds elements.
Questions in this area give you an HTML fragment and ask which expression matches exactly one element — and only that one. It is the part of the exam where reading fast is worth more than knowing more.
Where candidates lose points:
“Matches” is not “matches uniquely”. Several options are usually valid selectors; only one hits a single element. Check the fragment for a second element that would also match.
Absolute XPath. An expression starting at /html/body/ may be correct today and is always the wrong answer when the question is about maintainability.
Multiple classes. class="btn primary" is two class names, so .btn.primary works and [class='btn'] does not.
Attribute operators and axes. Know ^=, $= and *= for generated ids, and following-sibling and ancestor::tr for walking a table from a cell to its row — the single most common table question.
Text matching. text()='Log out' is exact and whitespace-sensitive; contains() is not. Questions choose between them deliberately.
This chapter is covered most heavily (8 questions) in A4Q Selenium Tester — Mock Exam 3