Good
Strict mode hatasını scope, role/name veya filter ile çöz.QA PRACTICE•STRICT
Lesson 9 / 20 · Intermediate
Diagnose ambiguous matches before an action fails.
12 min
Not completed
Playwright strict mode tekil hedef ister. Actionability; visible, enabled, stable ve receives-events kontrollerini kapsar. Çok eşleşme, overlay veya animasyon nedeniyle tıklama başarısız olabilir.
Prerequisites: Role and accessible name
Live demo
Try the locator against the live demo.
Strict mode hatasını scope, role/name veya filter ile çöz.`.first()` ekleyerek yanlış hedefi sessizce seçme.Testin gerçekten doğru kontrolü kullandığını garanti edersin.
Bir locator’ın eşleşmesi, action’ın başarılı olacağı anlamına gelmez.
page.locator("[data-testid='strict-demo'] button:nth-of-type(2)")driver.findElement(By.cssSelector("[data-testid='strict-demo'] button:nth-of-type(2)"))cy.get("[data-testid='strict-demo'] button:nth-of-type(2)")