All right, in our last video, we saw how we could able to write a simple test using this particular
code, and we also saw how we can take a screenshot and how we run the tests and all those stuff, which
was pretty straightforward and pretty easier.
But it's also very, very painful to identify a control every time and perform an action.
And this is something very, very painful if we are going to work with a larger project.
So for that reason, that is a very, very simple record and playback tools available for many automation
testing tools which will help you or make you more comfortable to use those automation testing tools.
And playwrite is one such tool which actually has got a recording and playback kind of tool as well.
They don't call this recording and playback tool the player team.
They called us Playwrite Kellye or command line interface.
They don't really have that particular detail over here on this particular documentation.
But you can just search for playwrite Seelie and hit the enter.
You can see that they have something called a playwright Clay over here.
So if you just click this guy and if you come all the way down, you can see that it has all the details
of the particular playwright.
This is one of the handy tools that we can use to get started with playwrite and get acquainted with
playwrite and see how you can actually use a particular tool more effectively.
Are you going to do is to do an installation of playwrite clay within your code and then you can start
working with it.
So I'm just going to copy the speaker command like NPM Install hyphen the playwright Seelie, and I'm
just going to paste this guy over here.
That's it.
The installation is done and once installation is done, all you going to do is you can use this command
like NPCs, playwright Clay Cordon of the website that you want to automate.
That's it.
Once you do that, you can really, really use this particular command to start using it.
I mean, it's very, very simple and straightforward.
So I'm probably going to come and copy this whole command.
I'm not going to change anything at the moment.
Like Playwrite Zeolite Corrigin off to org.
Once I do that, you can see that it opens the Wikipedia dot org on a Chrome browser for us.
Very cool.
So once I just hover the mouse, it also shows all the locators for me like it's an input name is called
The Search and this is a button normalized dot is called a search and this is a select with an idea
of search language.
So it tells you each and every thing for you over here, which is really, really cool.
So maybe I'm just going to leave the language as English, which is cool, and then I'm going to search
for maybe Apple and one and I'm going to choose this guy one from the dropdown.
And you can see that it brings me up all the details.
And once I just hover there, it also tells the text as and one and I can just click the architecture
and just text me up over there.
And then I can see all the operation that I'm doing is actually being recorded behind the scenes.
So it automatically created the arrow function for us.
And then it tells like commands.
The browser is called Away to Chrome dot launch.
It looks as follows.
I'll take whatever that we wrote before.
It's all coming in and then it's going to create a browser of the new context.
And within the context, it is going to create like a page within the page.
It is going to go to the Wikipedia site, click that search.
It's going to fill the details over there, and then it's going to click the apple.
And one, you can see that everything is just coming in and pretty cool.
So now if I just go and close this browser over here, you can see that it just left the whole code
for us like a recorded code for us.
So we can just copy this.
I mean, the player is still ACLC.
It is a command line interface.
It's not a playwright recorder UI or something like that where you can see everything you can export
like and UI.
Probably in a few months the team is going to release like a recording and playback tool, which is
going to export the code on the different language binding that we saw before.
But as of now, it's Seelie.
And then I'm just going to say like Wiki darte, just like Wiki Dargis and I'm going to pass this cord.
You can see that.
It just brings me up all the code over here and this gives you more knowledge and information on how
to play around with this tool as well, which is really, really cool.
I mean, you can learn writing the best practice code like you need to do coding with the context and
then you need to create a page within the page.
You need to navigate something like that.
And you can also learn how the selectors are being used and how you can enter a text on a text box.
You can see that they use a full method to do that over here.
There's something called a Stinky's.
There is something called a Phil method.
So there is a click method to perform a click operation.
And you can see that the selectors are pretty straightforward.
I mean, don't worry about the task.
We're going to talk about that in our next section.
But you can see that these things are going to help you to learn playwrite more and more easily.
And everything comes in over here.
And once the whole operation is done, they are closing one by one, like from the hierarchy.
So the first they are going to close the page and then they're going to close the context and then they're
going to close the browser.
So in our last video, we didn't even close the page.
Basically, we just closed to the browser.
But they are closing like a best practice like page and then the context and then the browser.
So to run this and see what's going to basically happen, I'm going to type Naude of Wicked RJ.
So this is the way that you actually execute the code and once you hit the enter.
You can see that the browser is being spun, it's typing up, anyone is going to click that boom, I
guess it worked, but I'm not very sure if that really worked or not, because I don't see that it actually
click the text architectures and things of that nature.
But what we can do is we can try to take a screenshot or hear of Wade Page, dot a screenshot of the
part where I'm going to say Wiki Dot, PMG, save this.
Run that.
Let it go and we can see whether it really clicked this architecture as well, so if I click that,
you can see that it really clicked that architecture.
So basically this code is actually working because it was so fast we couldn't really actually see if
that really worked, which means it's working.
Yeah.
So you can see that the playwright Seelie is one of the handy tool for you to learn the playwright itself
in a more and better manner.
And these are some of the things which any automated testing tools possess, like a record and playback
tool.
And playwright actually has got one, which is really awesome.