In this lecture, we are going to talk about how we can actually take a video capture of the operation
that we are actually performing.
So this is also one of the nice things that you can do with your testing.
So I'm going to create a new file.
I'm going to call this as video captured on G.S. or something like that.
And then I'm going to copy paste exactly the same code that we always use.
And I'm looking at it here.
Does that just to save some time?
Because we don't have to keep doing this tracing every time.
So I'm just going to get rid of this tracing and also get rid of the stopped racing from here, because
we really don't require that I'm going to save this guy and now we need to do a video capture.
So video capture is something available in two formats.
Basically, one is using a browser context that you can do or you can also capture video based on the
page level context if you want to.
So one way is to do the video capture from the browser context level, not from the page level.
So for doing that, I'm just going to go here.
I'm just going to do something like video.
Part, so if you specify really part, which means it is going to be the part where you're going to
take the video form.
So if I just go to the video part and if I specify the directory, you could be able to get a video
coming in over there.
So if I just specify videos, slash something like that, this is going to capture the video for the
recording that you're going to do.
So for that, if I just to nod off the video captured on G.S..
So whatever operation is currently happening, it is going to capture videos that you see that there
is a folder called the studios and we also have a video sitting in there.
So let me just reveal that in the finder.
And you can see that the file format is a webcam.
So it's a very, very small size footprint video like just two forty four KB.
And you can see that the video is coming in, which is quite good.
So this is something that you can use for doing a video capture.
And also you can also use something called as recorded video.
But Ricardi video takes the president's basically because the recorded video is the new way of working
with the videos, because it has a lot of options along with.
So if you go to the video part, you can see that it does a car video.
Instead, it takes precedence over the video part, enable video recording for all the pages to the
video about the directory.
It is not specified in the video.
It is not recorded.
Make sure your browser cameras are close for the video to be saved.
So it is not kind of recommended practice to do with the video recording video iPod.
So just go with the videos or hear, which is going to take that video.
And you can also specify the size of the video that you want to capture.
So you can you can just tell something like size, as probably you can specify the width of the video's
800 and then height.
You can do that as well.
And this is going to be captured based on the size that you have given the screen size that you have
given.
And oops, I'm sorry for that.
I think I need to give the director of the video recorder video something like this.
And similarly, the size should come under the record video as well, because if you use the size,
it is applicable for the size on the video recorder itself.
So if you just see you can get the video size over here.
So the video part and video size goes hand in hand.
Similarly, the size and the directory of the record video goes hand in hand as well.
So this is the way that we can actually do for the record video.
So you can see that this is the directory of the video which has been captured and this is the size
that you need to capture on this particular video.
And now, if I tried to run the video capture, hopefully this time is going to work and it says that
I covered this.
I started expected.
No.
Oops.
Oh, my God.
How it's spelling is wrong.
So this is the height.
Sorry about that.
On screen or on the screen.
There you go.
It's working fine now, finally.
And it should create a new video or record a new video on the videos folder itself.
If not, if I'm not wrong.
Yep.
It's there.
So this is the one I just double click.
You can see that the video is now recorded on this size.
Which is quite good.
So you can see that everything is working fine as expected.
So this is how you can actually capture the video of the browser on the browser context, which is quite
good video in our next video while we talk about generating a PDF file of a page using playwrite.