1
00:00:00,240 --> 00:00:04,380
All right, so in this section, we have been learning some of the tips and tricks of how to work with

2
00:00:04,380 --> 00:00:08,660
some of the most common operation that we should be doing in our automation testing.

3
00:00:08,700 --> 00:00:10,680
I mean, we will be encountering most of the time.

4
00:00:10,980 --> 00:00:16,410
But this is something like a painting that I wanted to show you, which the team in the playwright actually

5
00:00:16,890 --> 00:00:19,090
showed me while they released this new feature.

6
00:00:19,110 --> 00:00:20,560
So I just wanted to show you as well.

7
00:00:20,850 --> 00:00:26,520
So this is nothing but the way that you can work with the different browser same time and you can take

8
00:00:26,520 --> 00:00:28,110
a screenshot of all the browsers.

9
00:00:28,140 --> 00:00:29,540
So this is pretty cool.

10
00:00:29,550 --> 00:00:31,500
I mean, I just wanted to show you how it actually works.

11
00:00:31,500 --> 00:00:38,010
So I'm just going to name this file as maybe screenshot for all browser dodgier, something like that.

12
00:00:38,280 --> 00:00:41,980
And over here, you're going to take all the screenshots for all the browsers.

13
00:00:42,000 --> 00:00:47,250
So if I remember in our earlier video, we were trying to do something like this to get all the play

14
00:00:47,250 --> 00:00:47,550
right.

15
00:00:47,820 --> 00:00:56,430
And then we need to create the arrow function, which is going to be something like this.

16
00:00:57,750 --> 00:01:02,220
And over here, we try to write all the codes for a single browser or something like that.

17
00:01:02,230 --> 00:01:05,370
So we always try to write the code for a single browsers.

18
00:01:09,480 --> 00:01:10,890
Maybe I'm just going to copy this.

19
00:01:11,840 --> 00:01:12,770
Over here.

20
00:01:15,500 --> 00:01:18,140
And then I'm going to go over here, I'm going to pace it.

21
00:01:18,170 --> 00:01:19,560
So this is how we used to do it.

22
00:01:19,580 --> 00:01:20,900
So this is, what, a single browser?

23
00:01:20,900 --> 00:01:21,130
Right.

24
00:01:21,410 --> 00:01:26,250
But this time, I'm actually going to do a operation for multiple browsers.

25
00:01:26,270 --> 00:01:29,550
I'm going to do something like a looping because it's going to be for multiple browser.

26
00:01:29,570 --> 00:01:35,750
We need to somehow loop for all the browser to be launched and then perform the operation.

27
00:01:35,750 --> 00:01:37,950
Like what our operation that we are trying to do over here.

28
00:01:38,330 --> 00:01:46,040
So I'm just going to write a for loop here where I'm just going to say consed off the browser type.

29
00:01:48,210 --> 00:01:53,670
Off, so this is like an area that I'm going to be iterating, so I'm just going to say chromium.

30
00:01:54,010 --> 00:02:01,230
So these are the same concerns that we try to always invoke, like Firefox.

31
00:02:01,860 --> 00:02:04,530
And I think it's Web kit.

32
00:02:04,800 --> 00:02:09,230
And after that, I'm just going to open the loop over here.

33
00:02:09,840 --> 00:02:15,520
And then once it is invoked, we also need to do the launch operation.

34
00:02:15,840 --> 00:02:20,580
So far, the launch operation, what I'm going to do probably I'm just going to cut this cord and I'm

35
00:02:20,580 --> 00:02:22,270
going to pasted over here.

36
00:02:23,040 --> 00:02:28,770
So for that for the launch operation, instead of passing the Firefox straight away or here, what I'm

37
00:02:28,770 --> 00:02:32,460
going to do is I'm just going to pass the browser type.

38
00:02:32,700 --> 00:02:35,910
So this prototype, because it is an array, is going to always iterate.

39
00:02:35,910 --> 00:02:41,310
I mean, get the value one by one for each and every browser like Chromium, first Firefox, next Web

40
00:02:41,330 --> 00:02:42,810
kit like that.

41
00:02:43,050 --> 00:02:46,230
I was going to take and run the test for us on that particular browser.

42
00:02:46,470 --> 00:02:53,310
And we can also probably take a screenshot for all these these browsers and we can see how it's actually

43
00:02:53,310 --> 00:02:53,970
going to look like.

44
00:02:54,270 --> 00:03:02,730
So I'm probably going to change this guy to this, which is going to have the example browser type start

45
00:03:02,850 --> 00:03:03,920
being something like that.

46
00:03:04,110 --> 00:03:04,520
Yeah.

47
00:03:04,770 --> 00:03:07,010
So that's going to take the screenshot for us.

48
00:03:07,260 --> 00:03:12,180
We'll just run this like a fun code basically, which is going to do this for us.

49
00:03:12,520 --> 00:03:16,620
So I'm just going to do a node screenshot for all browser Dargis.

50
00:03:17,700 --> 00:03:22,680
And you can see that it's opening the first browser, which is the Chrome browser, obviously, and

51
00:03:22,680 --> 00:03:24,180
it's going to take a screenshot for that.

52
00:03:24,330 --> 00:03:29,910
And then it's opening the Firefox browser for me in the other window, though, and just took the screenshot

53
00:03:29,910 --> 00:03:30,350
as well.

54
00:03:30,720 --> 00:03:33,180
And then it should open a Web browser.

55
00:03:33,600 --> 00:03:39,750
This is for the first time, but actually looking for the Web browser on a Mac, you can see that the

56
00:03:39,750 --> 00:03:44,400
Web kit is actually opening and it should navigate as well.

57
00:03:45,030 --> 00:03:46,740
So what's happening with the apple in one?

58
00:03:46,740 --> 00:03:49,020
It's pretty slower with the web get.

59
00:03:49,870 --> 00:03:56,200
And it's actually not doing anything at the moment, I'm not sure maybe it's broken, so you can see

60
00:03:56,200 --> 00:04:01,930
that it is kind of not responsive at the moment, but you can see that it actually takes the screenshot

61
00:04:01,930 --> 00:04:08,440
of these two Browsr for some reason, the website is not launching for me on this one.

62
00:04:08,710 --> 00:04:13,480
But if you tried running it on me, then machines other than opinion, one discourse should work fine

63
00:04:13,480 --> 00:04:17,590
for you because I'm definitely sure that the web get was in my Windows machine.

64
00:04:18,100 --> 00:04:24,160
So even in my older Mac twenty eighteen edition sow discord was working fine over there.

65
00:04:24,160 --> 00:04:29,380
But for some reason it's not working for me on the apple and one, maybe it's a limitation or I don't

66
00:04:29,380 --> 00:04:30,310
know what is that reason.

67
00:04:30,520 --> 00:04:37,810
But yes, this code should definitely work on all the different browsers and it should be working as

68
00:04:37,810 --> 00:04:38,410
expected.

69
00:04:38,660 --> 00:04:43,990
So I'm just trying to run this again, just maybe it's not working for the first time.

70
00:04:45,100 --> 00:04:49,030
So Firefox opened and then the Web get not just not working.

71
00:04:49,180 --> 00:04:49,800
That's all right.

72
00:04:50,140 --> 00:04:51,890
So, yeah, but you got the idea, right.

73
00:04:51,910 --> 00:04:55,570
So this is how we can actually work with the different browsers and see how it actually works.
