Member-only story
Coding Chronicles #2 | Playwirght| Locate HTML Span Element With ID To Test The Visibility Of An Icon.
container.locator(container.locator(`span[id=span-id”]`).first();
A usual day in the life of a software programmer brings out many coding challenges. Most of these challenges need a few minutes of online search. I started a series of mini blogs dealing with some of these challenges. The complexity of these challenges will range from average to complex.
Last week, I wrote about an execution error with a Playwright test case (npx playwright test). Today, I am writing about locating an HTML span element for testing the visibility of an Icon.
Introduction
Playwright
Playwright is an open-source automation tool designed for end-to-end testing. Developed by Microsoft, Playwright supports many browsers, including Chromium, Firefox, and WebKit.
Official Documentation of Playwright — Fast and reliable end-to-end testing for modern web apps | Playwright
Locator Interface
Locators are the central piece of the Playwright’s auto-waiting and retry-ability. Locators represent a way to find element(s) on the page anytime.
