How to narrow and chain your Playwright locators
Checkly
View ChannelAbout
Test and monitor your apps and APIs at scale! A modern Monitoring as Code workflow for developers: programmable, fast, reliable.
Latest Posts
Video Description
Locating elements in your end-to-end tests can sometimes be a challenge. In this video, we tackle the problem of hard-to-locate elements by chaining multiple locators using `locator().and()`. By chaining locators you'll be able to combine user-first locators with specific locators reaching for a test id or CSS class. Playwright `and()` docs: https://playwright.dev/docs/api/class-locator#locator-and Checkly Synthetic monitoring: https://www.checklyhq.com/product/synthetic-monitoring/ 0:00 Intro 0:49 Example Playwright test case 1:09 The problem of locators matching multiple elements 2:10 Chain locators with `.and()` 4:10 Run fixed test 4:40 Outro #playwright #syntheticmonitoring #monitoring
DIY Lava Lamp Must-Haves
AI-recommended products based on this video

Wellova DMSO 99.9% Pharmaceutical Grade with 99.9% Purity & Low Odor - 4oz (Dimethyl Sulfoxide) Clear Glass Bottle with Dropper

RoboSeal Rechargeable Mason Jar Vacuum Sealer for Mason Jars Wide and Regular, One Touch Vacuum Sealer for Jars, 10 Lids Included, Digital Battery Indicator, As Seen on TV

Environet Hydroponic Growing Kit, Self-Watering Mason Jar Herb Garden Starter Kit Indoor, Windowsill Herb Garden, Grow Your Own Herbs from Organic Seeds (Basil)

HJTHJT 500ML Essential Oil Diffuser: Aroma Diffuser with Remote Control for Hotel Spa Yoga Room - Humidifier with 14 Colors LED Night Light for Bath Bedroom Relaxation (Dark Black)

Pumpkin Seed Oil with Saw Palmetto Capsules | Cold Pressed, Pure Virgin Oil, Essential Fatty Acids & Phytosterols 180 Softgels, Good for hair health | Non-GMO

FYeang® Black and White Rice Exfoliant, Facial Care Essence, Essential Oil Extraction, Cleanse Skin Dead Skin Cells, Blackheads Remover for All Skin Types

Floral Beads Kit 50000pcs & 300pcs Giant Large Colorful Gel Jelly Balls, Non Toxic Beads for Vase Filler, Plant, Floating Candles, Wedding and Home Decoration




