QA PRACTICE•I18N

Locator Practice HubTopics / Internationalized UI

Lesson 15 / 20 · Advanced

Internationalized UI

Build selectors that are less dependent on translated text.

10 min

Not completed

Concept

Çevrilen metne bağlı locator’lar locale değişince kırılır. Role + testid, stable aria-label veya locale-independent attribute kullan; regex yalnızca kontrollü varyasyonlarda yardımcıdır.

Prerequisites: Text and link text

Live demo

Try the locator

Scoped to lesson demo
Devam et

Try the locator against the live demo.

Good

Role + stable contract ile davranışı seç.

Avoid

Sadece İngilizce görünen metne göre global arama.

Why

Aynı test farklı dil ve bölge ayarlarında da çalışabilir.

Real-world trap

Accessible name de locale’e göre değişebilir; test id/aria contract kararını bilinçli ver.

Framework comparison

Playwright

page.locator("[data-testid='locale-action']")

Selenium

driver.findElement(By.cssSelector("[data-testid='locale-action']"))

Cypress

cy.get("[data-testid='locale-action']")

Mini quiz

Locale bağımsız locator için hangisi daha uygundur?