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.
Auto-waiting navigation
From the course: Playwright Python and Pytest for Web Automation Testing: Master Modern Web Testing with Playwright and Pytest in Python
Auto-waiting navigation
In the previous lesson, we learned about auto-weighting. That is, whenever we try to perform an action like click, Playwright performs some checks and auto-weighting along with it to perform the actual action. Now the same happens with navigation as well. That is, if we try to visit a new page or load a new page, that is using the goto method, it auto waits for certain events and by default it waits for the page to load. And we can configure that using the wait until keyword argument. So after our URL, what we can give is the wait until keyword argument. You can see it takes four events that is as strings, which is comment document or DOM content loaded, the load state, which is by default, and network idle. So here, what we can do is go through all of this and see what each performs. So we'll start with the default one, which is load state. And now to actually see what is the time difference between each of this, I will go ahead and import the perf counter. So from the built-in time…
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.