Hi, guys, welcome back to Section two.
My name is Karthick and I am from Israel Automation Dotcom, and you are in the scores into increased
automation with playwrite.
In our last section we discussed about an introduction to playwrite.
We saw how we can install playwrite, how we can play around with playwright, with playwright Seelie,
and also we compared playwright with puppeteer.
And we saw how the history and evolution of playwright happened and stuff.
But in this section we are going to start making ourselves more comfortable and strong with the basics
of playwrite so that we can be more comfortable to work with some of the advanced concepts later in
this course.
So this section is all about a basic building block of playwrights.
So that's what we'll be focusing on.
So the first and foremost important thing about playwright is the concepts of Browser's Browsr context
page and frames.
So these are the four most important concept that we really need to know while we talk about playwright.
So if you remember, if you already have some experience on selenium or Cyprus, let's take selenium,
for example.
The most important thing that we always try to do in selenium is we always do what is called the driver.
Driver is called the new chrom driver or Firefox's driver or IHI driver or something like that.
So that's what we always do.
And using this driver object, we try to perform something like Find Elements by XPath, our constructors
and things of that nature.
So there was only one option that we create and then we start working with it.
And once we call this the driver, driver is equal to new chromed driver.
It is going to invoke and a whole new browser for you.
And it gives you all the ability that you can do something like navigating to the page and then perform
an action on that particular page and stuff.
So that's what that particular line of code actually does.
But here in playwrite, it's a bit different.
Basically, we always try to invoke what is called as a browser.
If you remember in our last video, we called something called as chromium dot launch that actually
invoked what is called as a browser.
And within that particular browser, we invoked what is called as a [REMOVED].
And it can be a page.
It can be a frame if you want to.
You can do whatever you want to and then you can basically work with it.
Basically what you call a page.
It is like a type that you invoke within a browser.
So if you call a page, there's basically a tab within the browser.
But if you remember well, we launched the browser for the first time.
It is a bit slower because you are invoking a whole browser while you tried to run that particular operation,
which is very costly operation.
And if you're going to run the same test, like many times with different pages or you're going to do
the same test with different screen resolutions and things of that nature, if you invoke browser each
and every time, it's going to slow up your machine a lot, which certainly does at the moment.
I mean, if you call the driver drivers got a new chrome driver, it's always going to bring up the
whole full blown browser for you.
And that's what this operation is going to do for you as well.
And that's why in playwright or puppeteer, the team actually has what is called as a browser context.
So this browser context is basically like an context within the existing opened browser.
So if you open a Chrome browser within the Chrome browser, you can create what is called as a browser
context, which is like a lightweight context of the particular browser, but it is more like an incognito
context of the browser.
So whatever the main browser actually has got is not going to be impacted to this particular browser
context.
So if you open, let's say on this particular page of the browser, you open like automation, that
in browser context it doesn't even care about that because it is like a separate Incognito section.
And the browser context also has what is called US pages and frames and things of that nature.
So that's what is this particular whole journey of the browsers browser context page and frames is all
about.
And that's how it's been designed in playwrite.
And that's exactly what we'll be discussing in a couple of this video in the section.
And then following that, we'll be talking about selectors and how to work with selectors.
What are the different weighting mechanisms available and how the audio it actually works and things
of that nature.
So these are some of the most building block things that we really need to know about what we talk about
playwrite itself.