All right, so in this section, we have been learning some of the tips and tricks of how to work with
some of the most common operation that we should be doing in our automation testing.
I mean, we will be encountering most of the time.
But this is something like a painting that I wanted to show you, which the team in the playwright actually
showed me while they released this new feature.
So I just wanted to show you as well.
So this is nothing but the way that you can work with the different browser same time and you can take
a screenshot of all the browsers.
So this is pretty cool.
I mean, I just wanted to show you how it actually works.
So I'm just going to name this file as maybe screenshot for all browser dodgier, something like that.
And over here, you're going to take all the screenshots for all the browsers.
So if I remember in our earlier video, we were trying to do something like this to get all the play
right.
And then we need to create the arrow function, which is going to be something like this.
And over here, we try to write all the codes for a single browser or something like that.
So we always try to write the code for a single browsers.
Maybe I'm just going to copy this.
Over here.
And then I'm going to go over here, I'm going to pace it.
So this is how we used to do it.
So this is, what, a single browser?
Right.
But this time, I'm actually going to do a operation for multiple browsers.
I'm going to do something like a looping because it's going to be for multiple browser.
We need to somehow loop for all the browser to be launched and then perform the operation.
Like what our operation that we are trying to do over here.
So I'm just going to write a for loop here where I'm just going to say consed off the browser type.
Off, so this is like an area that I'm going to be iterating, so I'm just going to say chromium.
So these are the same concerns that we try to always invoke, like Firefox.
And I think it's Web kit.
And after that, I'm just going to open the loop over here.
And then once it is invoked, we also need to do the launch operation.
So far, the launch operation, what I'm going to do probably I'm just going to cut this cord and I'm
going to pasted over here.
So for that for the launch operation, instead of passing the Firefox straight away or here, what I'm
going to do is I'm just going to pass the browser type.
So this prototype, because it is an array, is going to always iterate.
I mean, get the value one by one for each and every browser like Chromium, first Firefox, next Web
kit like that.
I was going to take and run the test for us on that particular browser.
And we can also probably take a screenshot for all these these browsers and we can see how it's actually
going to look like.
So I'm probably going to change this guy to this, which is going to have the example browser type start
being something like that.
Yeah.
So that's going to take the screenshot for us.
We'll just run this like a fun code basically, which is going to do this for us.
So I'm just going to do a node screenshot for all browser Dargis.
And you can see that it's opening the first browser, which is the Chrome browser, obviously, and
it's going to take a screenshot for that.
And then it's opening the Firefox browser for me in the other window, though, and just took the screenshot
as well.
And then it should open a Web browser.
This is for the first time, but actually looking for the Web browser on a Mac, you can see that the
Web kit is actually opening and it should navigate as well.
So what's happening with the apple in one?
It's pretty slower with the web get.
And it's actually not doing anything at the moment, I'm not sure maybe it's broken, so you can see
that it is kind of not responsive at the moment, but you can see that it actually takes the screenshot
of these two Browsr for some reason, the website is not launching for me on this one.
But if you tried running it on me, then machines other than opinion, one discourse should work fine
for you because I'm definitely sure that the web get was in my Windows machine.
So even in my older Mac twenty eighteen edition sow discord was working fine over there.
But for some reason it's not working for me on the apple and one, maybe it's a limitation or I don't
know what is that reason.
But yes, this code should definitely work on all the different browsers and it should be working as
expected.
So I'm just trying to run this again, just maybe it's not working for the first time.
So Firefox opened and then the Web get not just not working.
That's all right.
So, yeah, but you got the idea, right.
So this is how we can actually work with the different browsers and see how it actually works.