Right now, last video, we saw how we could able to debug and this is something I told you, that very,
very handy working with the weight mechanism, what I'm going to do is I actually want to wait for the
login button to appear and then perform a click operation if the login button is available.
So for doing that, I'm just going to do an inspect over here and probably do something like this.
And instead of the type I submit, I'm just going to make this type of maybe hidden.
And you can see that once I do the hidden, that particular button is actually gone from here, basically
disappeared or hidden, basically.
And then we'll try to see if the logging operation is going to be performed for some reason.
This is not going to be because I should be there.
Yeah.
And now I'm just going to put a breakpoint here on maybe I don't want to put a breakpoint.
I can point to the employee list and just run that.
And you can see that the court has been.
Executed until the password, and now it is waiting for the login button to appear from this particular
in this particular DOM element, so you can see that the automatic reading is now in action.
So it's just waiting for the particular button to be up here.
So once I change the type of submit, it should perform a logging operation.
But for some reason it didn't, because I actually made two changes like test is I just changed that
particular text over here at the moment just now.
So I'm probably going to stop this.
I just forgot because the last lecture we were trying to use this guy.
So I'm just going to just remove this, make it more better instead of, you know, jeopardizing this
particular text.
So I'm just going to run this in a preview.
More right now.
Let's see how it actually works.
Just cool.
On debunk this again.
And you can see that it just clicked, which is pretty cool.
So what I'm going to do is I'm going to put a breakpoint in here next time and I'm just going to run
in a preview mode.
And now, before clicking this, I'm going to inspect this element.
And I'm just going to move this to hiden, you can see the burden has been gone and now I'm just going
to run this and you can see that it's still waiting for the control to be clicked.
And now if I change from hiden to probably submit.
So once I do that, you can see that instantly click the control and then it is going to wait for the
employee list to be clicked in that particular breakpoint, which is pretty cool, right?
I mean, this proves the point that the automatic rating mechanism of the playwright is already there
in action and it is already working for us.
I mean, we don't really have to explicitly tell that wait for this particular employee list to appear
or something like that.
But we can still do all those things over here.
I mean, we can do something like wait, page, dot, and then there is something called us, wait for
a selector and then we can tell that.
Can you wait for this particular text like employee list to be appeared before you perform the operation?
For me, like clicking the particular text box, you can do that as well.
So if you just try to loops like that, if you try to run them, you can see that the particular weight
is going to be going to happen.
I mean, you don't really notice that because automatic weight is already there in place and that's
going to be working for you in behalf of you.
So you don't really have to worry about that, which is pretty cool.
I mean, this is the way that you can actually use the very first letter to perform the operations.
And those things works pretty much as expected.
And similarly, you can wait for the navigation to happen, like wait for the DOM to be lowered or something
like that.
You can do that as well.
So you just put a braises over here and then just put like something like to wait until once you do
that and once you put a in and put a single card, you can see that the intelligence brings in and then
it's going to tell you that either wait for the DOM content to be loaded or wait for the load even to
be fully complete are the item to be complete or something like that.
So once you select maybe the network, which means all the calls are going to be complete or something
like that.
So once you do that, it is going to be waiting for the call to be completed and then perform the operation.
And similarly, you can also wait for a text to be appeared on a page or in the DOM element, and then
you can perform the rest of the operation, something like that.
You can do that as well.
So, for example, if you just do a weight off P dart weight for function where you can actually write
a function for that event to be happened, this particular function is going to be very helpful while
you try to perform a weight for the windows in the text to be certain size or something like that.
So those are something that you can do over here as well.
I mean, you can do or maybe you can wait for a miracle to be complete or something like that.
You can write your own little weight and then you can see if that particular Nethercott is fully resolved.
So I could probably see that this particular snippet from the documentation looks very, very handy.
And I just wanted to show, like, how it actually works.
So you can just type a script, something like window dot in a text, which is going to be less than
one hundred or maybe greater than that, because we are not going to be resolving on the mobile view
at the moment.
So I'm just going to do this one and then I'm going to say the weight of the watchdog.
So this way it's going to wait for this particular watchdog to be fully resolved or something like that.
So if I just try to execute this code, so anyways, our code is going to be working.
But website, it's not in a text, it's the innervate.
If I try to run that, you can see that actually for the inner text, if I just typed it was actually
not working.
And once I do that, it is actually working fine.
I mean, basically our world is always going to be greater than a hundred, is not going to be less
than one hundred anyways.
So you can see that it is working fine, which is pretty cool.