1
00:00:00,450 --> 00:00:05,430
Right now, last video, we saw how we could able to debug and this is something I told you, that very,

2
00:00:05,430 --> 00:00:11,880
very handy working with the weight mechanism, what I'm going to do is I actually want to wait for the

3
00:00:11,880 --> 00:00:18,430
login button to appear and then perform a click operation if the login button is available.

4
00:00:18,540 --> 00:00:24,390
So for doing that, I'm just going to do an inspect over here and probably do something like this.

5
00:00:24,780 --> 00:00:29,630
And instead of the type I submit, I'm just going to make this type of maybe hidden.

6
00:00:29,850 --> 00:00:34,980
And you can see that once I do the hidden, that particular button is actually gone from here, basically

7
00:00:35,370 --> 00:00:37,550
disappeared or hidden, basically.

8
00:00:38,880 --> 00:00:45,840
And then we'll try to see if the logging operation is going to be performed for some reason.

9
00:00:45,870 --> 00:00:48,240
This is not going to be because I should be there.

10
00:00:48,540 --> 00:00:48,990
Yeah.

11
00:00:49,500 --> 00:00:57,570
And now I'm just going to put a breakpoint here on maybe I don't want to put a breakpoint.

12
00:00:57,570 --> 00:01:00,930
I can point to the employee list and just run that.

13
00:01:01,560 --> 00:01:03,900
And you can see that the court has been.

14
00:01:04,860 --> 00:01:12,900
Executed until the password, and now it is waiting for the login button to appear from this particular

15
00:01:13,440 --> 00:01:20,670
in this particular DOM element, so you can see that the automatic reading is now in action.

16
00:01:20,940 --> 00:01:24,000
So it's just waiting for the particular button to be up here.

17
00:01:24,090 --> 00:01:28,950
So once I change the type of submit, it should perform a logging operation.

18
00:01:28,960 --> 00:01:35,310
But for some reason it didn't, because I actually made two changes like test is I just changed that

19
00:01:35,310 --> 00:01:38,010
particular text over here at the moment just now.

20
00:01:38,250 --> 00:01:39,840
So I'm probably going to stop this.

21
00:01:39,840 --> 00:01:42,900
I just forgot because the last lecture we were trying to use this guy.

22
00:01:43,440 --> 00:01:50,820
So I'm just going to just remove this, make it more better instead of, you know, jeopardizing this

23
00:01:50,820 --> 00:01:51,690
particular text.

24
00:01:52,200 --> 00:01:55,260
So I'm just going to run this in a preview.

25
00:01:55,260 --> 00:01:56,050
More right now.

26
00:01:56,880 --> 00:01:58,440
Let's see how it actually works.

27
00:02:00,090 --> 00:02:00,720
Just cool.

28
00:02:01,620 --> 00:02:02,820
On debunk this again.

29
00:02:04,050 --> 00:02:06,040
And you can see that it just clicked, which is pretty cool.

30
00:02:06,420 --> 00:02:14,010
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

31
00:02:14,550 --> 00:02:16,650
in a preview mode.

32
00:02:21,800 --> 00:02:25,580
And now, before clicking this, I'm going to inspect this element.

33
00:02:28,450 --> 00:02:36,670
And I'm just going to move this to hiden, you can see the burden has been gone and now I'm just going

34
00:02:36,670 --> 00:02:41,050
to run this and you can see that it's still waiting for the control to be clicked.

35
00:02:41,470 --> 00:02:44,750
And now if I change from hiden to probably submit.

36
00:02:44,770 --> 00:02:50,440
So once I do that, you can see that instantly click the control and then it is going to wait for the

37
00:02:50,440 --> 00:02:55,480
employee list to be clicked in that particular breakpoint, which is pretty cool, right?

38
00:02:55,510 --> 00:03:01,990
I mean, this proves the point that the automatic rating mechanism of the playwright is already there

39
00:03:01,990 --> 00:03:04,320
in action and it is already working for us.

40
00:03:04,330 --> 00:03:10,510
I mean, we don't really have to explicitly tell that wait for this particular employee list to appear

41
00:03:10,510 --> 00:03:11,110
or something like that.

42
00:03:11,110 --> 00:03:13,430
But we can still do all those things over here.

43
00:03:13,450 --> 00:03:18,500
I mean, we can do something like wait, page, dot, and then there is something called us, wait for

44
00:03:18,500 --> 00:03:20,680
a selector and then we can tell that.

45
00:03:21,190 --> 00:03:31,270
Can you wait for this particular text like employee list to be appeared before you perform the operation?

46
00:03:31,270 --> 00:03:35,060
For me, like clicking the particular text box, you can do that as well.

47
00:03:35,410 --> 00:03:42,250
So if you just try to loops like that, if you try to run them, you can see that the particular weight

48
00:03:42,250 --> 00:03:44,160
is going to be going to happen.

49
00:03:44,170 --> 00:03:48,820
I mean, you don't really notice that because automatic weight is already there in place and that's

50
00:03:48,820 --> 00:03:51,790
going to be working for you in behalf of you.

51
00:03:52,000 --> 00:03:54,630
So you don't really have to worry about that, which is pretty cool.

52
00:03:55,030 --> 00:03:59,410
I mean, this is the way that you can actually use the very first letter to perform the operations.

53
00:03:59,410 --> 00:04:02,290
And those things works pretty much as expected.

54
00:04:02,530 --> 00:04:09,010
And similarly, you can wait for the navigation to happen, like wait for the DOM to be lowered or something

55
00:04:09,010 --> 00:04:09,460
like that.

56
00:04:09,910 --> 00:04:11,050
You can do that as well.

57
00:04:11,050 --> 00:04:17,920
So you just put a braises over here and then just put like something like to wait until once you do

58
00:04:17,920 --> 00:04:23,890
that and once you put a in and put a single card, you can see that the intelligence brings in and then

59
00:04:23,890 --> 00:04:28,780
it's going to tell you that either wait for the DOM content to be loaded or wait for the load even to

60
00:04:28,780 --> 00:04:31,850
be fully complete are the item to be complete or something like that.

61
00:04:31,870 --> 00:04:36,670
So once you select maybe the network, which means all the calls are going to be complete or something

62
00:04:36,670 --> 00:04:37,040
like that.

63
00:04:37,480 --> 00:04:44,260
So once you do that, it is going to be waiting for the call to be completed and then perform the operation.

64
00:04:44,830 --> 00:04:52,390
And similarly, you can also wait for a text to be appeared on a page or in the DOM element, and then

65
00:04:52,690 --> 00:04:55,360
you can perform the rest of the operation, something like that.

66
00:04:55,630 --> 00:04:57,100
You can do that as well.

67
00:04:57,130 --> 00:05:05,710
So, for example, if you just do a weight off P dart weight for function where you can actually write

68
00:05:05,710 --> 00:05:12,160
a function for that event to be happened, this particular function is going to be very helpful while

69
00:05:12,160 --> 00:05:19,200
you try to perform a weight for the windows in the text to be certain size or something like that.

70
00:05:19,210 --> 00:05:22,270
So those are something that you can do over here as well.

71
00:05:22,540 --> 00:05:27,400
I mean, you can do or maybe you can wait for a miracle to be complete or something like that.

72
00:05:27,400 --> 00:05:33,970
You can write your own little weight and then you can see if that particular Nethercott is fully resolved.

73
00:05:34,540 --> 00:05:39,880
So I could probably see that this particular snippet from the documentation looks very, very handy.

74
00:05:40,120 --> 00:05:42,460
And I just wanted to show, like, how it actually works.

75
00:05:42,460 --> 00:05:49,990
So you can just type a script, something like window dot in a text, which is going to be less than

76
00:05:50,650 --> 00:05:55,900
one hundred or maybe greater than that, because we are not going to be resolving on the mobile view

77
00:05:55,930 --> 00:05:56,440
at the moment.

78
00:05:56,710 --> 00:06:03,790
So I'm just going to do this one and then I'm going to say the weight of the watchdog.

79
00:06:04,510 --> 00:06:08,920
So this way it's going to wait for this particular watchdog to be fully resolved or something like that.

80
00:06:09,250 --> 00:06:13,570
So if I just try to execute this code, so anyways, our code is going to be working.

81
00:06:13,570 --> 00:06:16,810
But website, it's not in a text, it's the innervate.

82
00:06:17,440 --> 00:06:21,670
If I try to run that, you can see that actually for the inner text, if I just typed it was actually

83
00:06:21,670 --> 00:06:22,390
not working.

84
00:06:22,600 --> 00:06:25,120
And once I do that, it is actually working fine.

85
00:06:25,120 --> 00:06:30,040
I mean, basically our world is always going to be greater than a hundred, is not going to be less

86
00:06:30,040 --> 00:06:31,090
than one hundred anyways.

87
00:06:31,330 --> 00:06:33,790
So you can see that it is working fine, which is pretty cool.
