So as you remember in our earlier videos, what we are trying to do, a simple playwrite Kly operation,
the playwright Seelie actually taught us a lot of Selecter strategy automatically already.
As you can see what I tried to perform from a click operation, it is trying to identify a control.
Using the cassette recorder like input name is equal to search.
Similarly will perform a full operation.
It is going to perform the same element and then it is trying to perform a full Senate thing.
But it's going to enter some value like Apple and one on their particular input control and similarly
where they perform a operation like clicking the text.
It is also doing a clicking of the text, something like this.
So these are some of the things which already playwrite zeolite taught us while it's trying to do a
record operation for us.
And the better way to learn these locate our strategy is to directly work on a application which is
like to super simple, to identify something like that and then start working with it, which gives
you even more comfort when you start working with it.
So, for example, if I am probably going to go to one of the application like that, I always use while
automating an application is going to be the app Dorsami dot com.
So yeah, I've done so many com this website.
So this is a very, very super simple spinet application.
And you can see that if I just hoer to control it ornamentals that it can be identified using a text
is equal to login.
So this is very, very easy.
I mean, this tool which generated by the playwright Seelie is very, very handy that it's going to
tell you like what it is going to record, what even it's going to perform an operation there.
So we are going to perform a click operation.
So once I do a click, you can see that it is going to automatically record us.
Page click text is equal to log in over here and that's what it did, actually perform a click operation.
And then what I hold to the username, it is going to automatically tells me that is going to be an
input name is equal to username and this guy is basically an input name is equal to password.
So before you and I go further, I can try to identify the same control using another browser's probably.
So if I just open my Chrome browser here and if I just navigate the app dot Saami dot com, maybe the
login page and if I just click go to the inspect element over here and if I go to the console, probably
you can see that the name is called the user name, which we already know, and it is an input control.
So if I want to select with the selector, if I just put a dollar and if I just put input of name is
equal to the user name, you can see that this particular username control is being selected for us,
which is pretty cool.
So this is exactly what the playwright is going to tell us as well.
So it's actually teaching us like how or which control that we need to use for performing the operation.
So these are some of the coolest thing which these tools are coming up with right now, like helping
us to also learn the selector ID and these things also enhances as the way that we can use the perfect
control way of identifying a particular control.
So you can see that I'm just going to do that.
And if I want to perform, I click operations.
So it's going to tell me that there is an input pipe is equal to submit.
Basically, there is no other unique identifier to identify the speaker control.
And that's why it is telling me that I would submit itself is more than enough.
So I'm going to perform a click operation.
It's going to do that an employee list.
We know that it's going to be taking the text because this is the only unique way of identifying.
So I'm just going to select that and it's going to perform the rest of the operation.
You can see that if I'm going to go to the benefit, it is not just selecting the text as a benefit.
Rather, it is also taking the table role as three table data as six, and then it is going to normalise
the space for benefit.
So it knows that this is a table GUI and benefits are that are like duplicated of benefits, like duplicate
benefit text available everywhere.
So if I just choose one benefit, then it's not going to perform a click operation because there are
multiple same text available.
So uniquely identify the particular control using the table, raw table data and then the hyperlink
a off the benefit.
So which is pretty cool.
So this is something the tool is already helping us to teach the better way of identifying a locator.
And similarly, if I go to that particular text box, it knows that the name of the text box is a search
term.
It's very easy to identify or work with locators while working with a very simple control, probably.
But if the application is quite complex, probably if it is it has a dynamic control types, then probably,
yes, it is going to be a bit.
The key to identifying those areas and again, there are always a better way to work with those controls
and playwright can easily do that.
I mean, while we talk about different control types in our next lecture, we'll talk about that even
more detail while working with some complex controls.
But yes, this is something which you can see that this is very, very easy to identify and work with.
And Playwrite is already helping us to do that.
And if I try to perform a create new and if I, let's say, put an admin up as a name and salary and
duration worked grade order it at auto dot com, something like that.
And if I had to create a that is created and if I perform a delicate operation, you can see that this
is going to perform it and it's going to be a type of button as well like that.
And it is gone.
And then I'm going to perform a logoff and then I can just close this guy.
So this way you can see that everything is being recorded for us.
Like what?
Our operation that we are doing.
And the recording is going to be working as well if you try to execute that.
So this is pretty cool.
I guess this recording and playback operation, which we are doing with a playwright, not only performs
the recording playback, but it also teaches us like how we should be able to identify, control and
work with that particular control.
So if I just try to put a year, I guess I just pace this guy.
You can see that everything is coming up for us.
I'm just going to say this.
And if I just do a nod in a dark place and if I hit the enter, so whatever operation that we just performed,
it is going to exactly do the same operation for us pretty instantly.
You can see that everything is done super quick and these locators are just working fine.
So these things are going to be very, very helpful for us when we work with an organization where we
need to automate a lot of test cases and test scenarios so we can just use this cli generate the code,
copy paste the code.
And if we think that some of the controls are not identified properly, then we can use our coding technique
to identify the people controlling them.
What better way?
But yes, this is the most, easiest way that we can work with.
And the next thing they wanted to talk about was actually the scissors extension, like the visible
text options.
Like I was talking about the input of the name as let's say, if I just go all the way down here, you
can see that a clicking a submit operation for the login button.
So instead of doing that way, I can also identify the bigger control using the text as a login.
So you can see that this guy.
So if I want to perform a click operation is in the login button text, then probably I can do that
as well.
So if I just do a, uh, input of text and if I just do, probably I'm just going to use the double
this time and then I'm just going to go log in something like that so I could be able to identify the
same control using input of the text.
So this is an extension of the CSIS, which is going to be helpful for us to identify the control using
the text as well.
So you can see that it just worked without any problem.
And we can also give some spaces in here.
And this text is automatically going unresolved because the spaces or any leading or trailing spaces
available on the text is going to be resolved by the success.
And you can see that just working fine out any problem as well.
So these are pretty cool if you try to probably do something like a space and a capital A and now if
you try to run this test.
You can see that it's still working fine, I mean, it just works fine without any problem.
There is also another way, something like dust is so this is going to do the exact same operation.
But over here, it is not recommended to use the text is extensibility because text itself is going
to take care of all the spaces and the I text like that.
But let's say if I just remove this eye completely from here and then if I try to run that this particular
test should definitely fail because there is no such text available like log in, something like that.
I mean, it's I'm going to do a condensed operation.
It is going to do it contains operation a bit, but it is not like ignoring the full control with a
different text altogether.
So you can see that this particular test is actually going to fail.
And you can see that the test has not given up so quickly without telling that the login button is not
there.
Something like that is just waiting for the timeout to happen.
And then it is going to give you an error.
You can see that the waiting for three thousand millisecond exceeded and then the timeout happened and
the test card failed.
So these are some of the cool things which playwrite automatically have like an automatic automatic
weighting mechanism.
So I mean, we'll talk about the automatic reading mechanisms and stuff in our later lectures of this
course.
But yes, this is something that you need to know when you talk about the selectors.
And yes, these are something which is already available in playwrite by default.
Talk about working with different controls in our next lecture.