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.
What is sync and async?
From the course: Playwright Python and Pytest for Web Automation Testing: Master Modern Web Testing with Playwright and Pytest in Python
What is sync and async?
When we started out, I mentioned about the two types of API Playwright has that is Synchronous and Asynchronous. Till now we have used the Synchronous API, but in this lesson we'll learn about the Asynchronous API. But before doing so, what's actually the difference between Synchronous and Asynchronous? Well, here's the answer. Until now, we have not done any heavy computations or programs finished in mere milliseconds. And this is really a bare bone example of the same. That is, we create an argument whose value is banana or get a pig. And then our function takes that banana, does something with it, and then returns a value. And then we just print out that value. As you can see, the return value is printed on the terminal, and the same can be visualized as this. That is, Python is an interpreter language, so programs are executed line by line. Here each line or expression depends on the previous expression. That is, we can't call the function without first of all defining that…
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.