Rayrun
← Back to videos

Playwright Framework #3 | Multiple ENV with different locators | Playwright Tutorial - Part 82

In this video, we'll learn how to handle multiple env that have different selectors for the same element.

The video is a tutorial on how to handle multiple environments with multiple selectors in Playwright, a JavaScript library for automating web browsers. The presenter explains that the video focuses on a real-world scenario where the selectors may change in different environments. He demonstrates three methods for handling this: using unique XPaths, using multiple selectors separated by commas, and using OR-based text paths. He also briefly mentions using a JSON file to store selectors, but concludes that it may be more complex to maintain. The presenter provides code examples and demonstrates running tests in both staging and development environments. He also mentions using a TypeScript configuration file to handle compile-time errors caused by undefined variables. The video concludes by showcasing an alternative approach using the Page Object Model design pattern to store selectors within page objects.

Related Videos

#16 - ARIA and how Playwright is making use of it to identify UI controls?
#16 - ARIA and how Playwright is making use of it to identify UI controls?
Create feature, steps & config | Playwright & Cucumber - Typescript | Part 1
Create feature, steps & config | Playwright & Cucumber - Typescript | Part 1
Playwright - Set timeout, parallelisation and retries directly in your test files
Playwright - Set timeout, parallelisation and retries directly in your test files
Working with multiple elements in Playwright Test (NodeJS)
Working with multiple elements in Playwright Test (NodeJS)
TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.