Test Automation / Quiz

Selector Battle

Twenty selector-golf drills: read the DOM, hit the exact target set, and prove your locator instinct under a timer.

Difficulty
Medium
Format
Quiz
Points
150
Estimate
12 min

// MISSION BRIEF

Selector Battle

Read each HTML fragment. For the stated target, choose the CSS selector that matches exactly the intended elements. Too broad is wrong. Too narrow is wrong. The fastest sharp eye wins.

Rules of engagement:

  • The target set must be exact.
  • Prefer stable attributes, meaningful classes, and scoped descendants.
  • Watch for traps: broad classes, nested links, sibling forms, and direct-child requirements.
  • Timer is live. Best score counts.

Best score counts. Retry to climb the board.

// FIRST CONTACT

Battle teaser

Goal: Select every row of a FAILED test. <table data-qa-id="t"> <tr class="pass" data-qa-id="r1"><td>login spec</td><td>passed</td></tr> <tr class="fail" data-qa-id="r2"><td>checkout spec</td><td>failed</td></tr> <tr class="pass" data-qa-id="r3"><td>search spec</td><td>passed</td></tr> <tr class="fail" data-qa-id="r4"><td>payment spec</td><td>failed</td></tr> <tr class="skip" data-qa-id="r5"><td>report spec</td><td>skipped</td></tr> </table>

  1. Atr
  2. B.fail
  3. C.pass, .fail
  4. Dtd:last-child
Answers, scoring, hints, and the full battle stay sealed.

// SKILL TAGS

selectorscsslocatorsautomationbattlefeatured