From the course: Playwright Python and Pytest for Web Automation Testing: Master Modern Web Testing with Playwright and Pytest in Python
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Playwright auto-waiting
From the course: Playwright Python and Pytest for Web Automation Testing: Master Modern Web Testing with Playwright and Pytest in Python
Playwright auto-waiting
Playwright has a very cool feature known as auto-weighting. And we've been using the same for the past few lessons without even realizing it. Auto-weighting ensures that every element is actionable before performing any action on the same. Simply put, if we want to click a button, Playwright ensures that the button is attached to the DOM that is in the document or our website. It is visible, it is enabled, and it is stable. And that means it's not moving around or having any animations. And finally, for our specific click action, it makes sure that the element is clickable, which means it is receiving pointer events. Back in VS Code, I have a sample script in which we will test the same. So here you can see I have just launched a Chromium browser which is in the headed mode and the slow-mo as 500 times. I have a new page which goes to our bootswatch.com and there I have selected a simple primary button and the first instance of the same and I have gone ahead and clicked it. We can…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.