QA PRACTICE•A11Y

Locator Practice HubTopics / Accessibility and testability

Lesson 18 / 20 · Intermediate

Accessibility and testability

Connect accessible markup with reliable automation.

12 min

Not completed

Concept

İyi locator çoğu zaman iyi erişilebilir markup’ın sonucudur. Label, role, name ve keyboard flow doğruysa hem screen reader hem automation daha kararlı çalışır. QA, geliştiriciden locator istemek yerine test edilebilirlik contract’ı önerebilir.

Prerequisites: Role and accessible name

Live demo

Try the locator

Scoped to lesson demo

Try the locator against the live demo.

Good

Semantik HTML, label, role ve görünür focus state iste.

Avoid

Sadece `div` + click handler ile erişilebilirliği gizleme.

Why

Test edilebilirlik ve erişilebilirlik aynı ürün sinyallerini güçlendirir.

Real-world trap

aria-label eklemek, yanlış role veya keyboard davranışını tek başına düzeltmez.

Framework comparison

Playwright

page.locator("[data-testid='a11y-demo'] input")

Selenium

driver.findElement(By.cssSelector("[data-testid='a11y-demo'] input"))

Cypress

cy.get("[data-testid='a11y-demo'] input")

Mini quiz

Label neden değerlidir?