Test Automation / Quiz

Selectors Under Fire

Test ids, semantic roles, text, and structural paths: ranking selector strategies by how gracefully they die when the UI changes.

Difficulty
Easy
Format
Quiz
Points
100
Estimate
9 min

// MISSION BRIEF

Your Mission

Every selector is a bet about what will not change. Structural paths bet on the DOM tree. Text bets on copywriting. Test ids bet on team discipline. Semantic roles bet on the app staying accessible.

This quiz ranks those bets, framework-agnostic: the same logic drives Playwright, Selenium, Cypress, and Appium suites.

Speed bonus active.

// FIRST CONTACT

Battle teaser

Which selector survives the most kinds of change?

  1. AThe button's current visible text, always
  2. BA dedicated test id (or a semantic role + accessible name), because both are explicit contracts rather than rendering accidents
  3. Cdiv.container > div:nth-child(3) > button.primary
  4. DAn auto-generated class like .css-1x8v2ab
Answers, scoring, hints, and the full battle stay sealed.

// SKILL TAGS

test-automationselectorslocatorsmaintainabilitye2e-testing