1
00:00:00,180 --> 00:00:05,310
All right, so this is the same project that we are talking about in our Section one while we're talking

2
00:00:05,310 --> 00:00:09,810
about the playwright, playwright, Kellyann and stuff, and in this video, we're going to start working

3
00:00:09,810 --> 00:00:12,880
with some of the basic building blocks to understand things more clearer.

4
00:00:13,260 --> 00:00:17,890
So I guess we already know about the browser a lot because it's pretty straightforward.

5
00:00:18,180 --> 00:00:24,310
So if you create a chromium dot launch, then it's going to launch the browser as the chromium browser.

6
00:00:24,660 --> 00:00:28,290
So if you're going to run a Firefox browser, you can do that as well.

7
00:00:28,530 --> 00:00:36,360
So let me call this as like a browser dot JS and I'm just going to do the exact same code that we discussed

8
00:00:36,360 --> 00:00:37,000
over here.

9
00:00:37,350 --> 00:00:43,020
So let me just copy this just to save some time and I'm going to go to the browser Dages.

10
00:00:43,020 --> 00:00:44,110
I'm going to pass it over here.

11
00:00:44,220 --> 00:00:50,340
So instead of the chromium here, let's say I'm going to use Firefox, I'm just going to change this

12
00:00:50,340 --> 00:00:51,210
to Firefox.

13
00:00:51,240 --> 00:00:52,290
I'm just going to copy this.

14
00:00:52,620 --> 00:00:53,960
I'm going to pass it over here.

15
00:00:54,060 --> 00:00:55,050
I'm going to save this.

16
00:00:55,410 --> 00:01:02,100
And if I try to run this particular test, let's say create new integrated terminal and I'm going to

17
00:01:02,100 --> 00:01:06,230
do a node of browser Dargis.

18
00:01:06,240 --> 00:01:11,970
And if I hit enter, you should see this time it is not going to launch the chromium browser.

19
00:01:12,180 --> 00:01:14,970
Rather, this can launch a Firefox browser.

20
00:01:14,980 --> 00:01:19,260
You can see that it is quite quiet lawyer like for the first time when it is launching.

21
00:01:19,830 --> 00:01:21,210
That took a lot of time.

22
00:01:21,630 --> 00:01:23,420
But it is launching, right?

23
00:01:23,430 --> 00:01:24,620
I mean, it's working fine.

24
00:01:25,020 --> 00:01:27,330
So this is a Firefox browser which just launched.

25
00:01:27,870 --> 00:01:29,400
It is a costly operation.

26
00:01:29,880 --> 00:01:36,570
I mean, every time it launches the browser, it took an enormous amount of time to launch the browser.

27
00:01:36,900 --> 00:01:41,340
But if a machine is pretty faster, then you don't really see that particular difference.

28
00:01:41,340 --> 00:01:46,200
But if a machine is lawyer, then you will really see that particular slow performance of that.

29
00:01:46,350 --> 00:01:51,050
And similarly, you can launch the browser in various different way as well.

30
00:01:51,060 --> 00:01:56,100
Like, if you remember, we launched this browser in a headless mode, something like headless as false.

31
00:01:56,430 --> 00:02:00,190
And you can also do a lot of things for the browser, for example.

32
00:02:00,690 --> 00:02:05,460
Let me change this to, let's say, chromium once again, and I will show you what I really mean.

33
00:02:05,730 --> 00:02:11,010
So within this launch option over here, if I just try to do something like control space, you can

34
00:02:11,010 --> 00:02:17,580
see that brings me up something like a dev tools, download pod, EMV, executable pod and things of

35
00:02:17,580 --> 00:02:18,040
that nature.

36
00:02:18,270 --> 00:02:25,830
So if I just try to do something like a dev tools and if I go to something like true, which means it's

37
00:02:25,830 --> 00:02:28,970
going to show me that the old rules of that particular browser.

38
00:02:28,980 --> 00:02:35,690
So if I try to run this node browser Dargis file, you can see that it enabled the Dowdle for me.

39
00:02:35,730 --> 00:02:41,550
So it does the exact same thing like how you can do with the chromium options of selenium, where you

40
00:02:41,550 --> 00:02:45,750
can set the desired capabilities of a chromium to set.

41
00:02:46,650 --> 00:02:47,000
Sure.

42
00:02:47,070 --> 00:02:49,130
Show tools and things of that nature.

43
00:02:49,140 --> 00:02:54,800
It's exactly the same thing that you can do in selenium, but you can also do that in playwrite as well.

44
00:02:55,080 --> 00:03:01,020
And similarly, you can also do something like said, the different executable parts of your chromium

45
00:03:01,020 --> 00:03:05,400
if you want to, because at the moment we are using the chromium just sitting in our cash, but rather

46
00:03:05,400 --> 00:03:10,290
you can also change the particular cash version to the directory that you want to specify so that it

47
00:03:10,290 --> 00:03:14,170
will run that particular browser for you and somebody that is something called a slowmo.

48
00:03:14,190 --> 00:03:19,590
This is very, very important or very, very handy while you try to debug your code and see what's been

49
00:03:19,590 --> 00:03:22,260
typed while you run this particular slowmo.

50
00:03:22,260 --> 00:03:27,000
I mean, once you run your test at the moment so I can probably go to our Vickki test.

51
00:03:27,000 --> 00:03:32,220
If you remember, we were typing some value over there like Apple and one or something like that.

52
00:03:32,220 --> 00:03:33,060
It was pretty fast.

53
00:03:33,170 --> 00:03:34,320
We couldn't able to see that.

54
00:03:34,590 --> 00:03:40,590
So I'm just going to do something like a slowmo and then I'm going to type the value, something like

55
00:03:40,860 --> 00:03:42,390
five hundred or something like that.

56
00:03:42,960 --> 00:03:47,040
I think maybe not five hundred, maybe thousand, something like that.

57
00:03:47,490 --> 00:03:53,130
And then if I tried to run the node off with Ketut J.S. and if I hit the enter.

58
00:03:54,050 --> 00:04:00,260
You can see that it has launched that Wikipedia and it took some time to type that value Apple in one

59
00:04:00,260 --> 00:04:00,780
order.

60
00:04:01,040 --> 00:04:06,140
So if you change that particular value to, let's say, five thousand, you will see that literally

61
00:04:06,140 --> 00:04:09,790
more even more slower than what it has typed.

62
00:04:09,800 --> 00:04:15,700
So each and every operation that it does for the apple and one is going to be very, very slow.

63
00:04:15,920 --> 00:04:21,260
So you can see that it is quite, quite lawyer what it does to any operation over there, like those

64
00:04:21,260 --> 00:04:25,120
long lines waiting for like five thousand milliseconds for every operation.

65
00:04:25,370 --> 00:04:29,480
And then before it clicks the apple in one, it takes another five thousand milliseconds.

66
00:04:29,480 --> 00:04:30,890
So it is quite slow.

67
00:04:31,190 --> 00:04:36,500
So this is how it works with a slowmo operation and you can change the behavior of the browsers and

68
00:04:36,500 --> 00:04:38,170
things from here as well.

69
00:04:38,180 --> 00:04:42,050
I mean, you can set these behavior in your settings file if you want to.

70
00:04:42,080 --> 00:04:45,480
But as of now, I'm just going to keep everything over here so that you understand what it is.

71
00:04:45,500 --> 00:04:51,350
So this is what is browser, basically, and you can keep customizing this browser, using what is called

72
00:04:51,350 --> 00:04:52,600
as a launch options.

73
00:04:52,610 --> 00:04:57,770
So if you go to this interface launch options, you can see they have different options, like headless

74
00:04:57,920 --> 00:05:07,160
executable pod arguments, ignore default args proxy's and a download pod Chrome Sandbox Firefox user

75
00:05:07,160 --> 00:05:12,560
preference handle sign ups, timeout environments, dev tools and Solomont things of that nature.

76
00:05:12,800 --> 00:05:14,630
We are going to customize that even further.

77
00:05:14,640 --> 00:05:20,720
What we talked about when we talk about Playwrite Destructor, which is a separate section altogether,

78
00:05:20,720 --> 00:05:21,830
we talk about that.

79
00:05:21,830 --> 00:05:28,820
We will see how we can also parse these options like Shlomo's and hitless options and stuff from the

80
00:05:28,940 --> 00:05:33,500
command line, which is going to be very, very helpful while we try running in the continuous integration

81
00:05:33,500 --> 00:05:34,480
and continuous deployment.

82
00:05:34,490 --> 00:05:39,620
So those things are very, very helpful while we try to create our own arguments in the test run or

83
00:05:39,800 --> 00:05:41,110
in the playwright stroner.

84
00:05:41,330 --> 00:05:46,040
And these are really, really handy and just understand that these are different options and properties

85
00:05:46,040 --> 00:05:48,320
being set for the browser itself.

86
00:05:48,560 --> 00:05:52,130
Now, next video, we'll talk about the browser context in even more detail.

87
00:05:52,250 --> 00:05:53,810
And we understand how things work.
