All right, so now we're going to start writing some of the code in the playwright for darknet language
binding and we'll see how it actually works.
So for doing that, I'm going to be some of the calls over here.
And you can see that the installation is done by I mean, the playwright station can be done using the
Newgate package, but the playwright itself is going to be installed within your project in three different
ways.
I mean, there are three or four different ways that you can actually do so playwright in this project.
So if you use a playwright in test projects, all require browsers will be installed at the time.
So this is one way that you can do or you can also use the playwright in Docker Container Image and
then you can run it from there.
This is another way and that is third way, which is going to be playwrite in the remote servers.
So basically you can connect to a playwright using the remote instance using this particular playwright,
Seelie, of Install.
And then from there you can run that.
I mean, I probably think that the best way is to go with this one, that playwrite of installed, I
think, because it will do all sorts of things for you to put all the required browsers and playwrite
required detailed files for you automatically and then you can start working from there.
I think this option is something I really prefer to show for this demo and for the rest of the demo
in the section.
But as I said, I'm going to open my visual studio over here.
I'm going to create a new project and I'm going to choose an Indian test and I'm going to choose the
console.
Sorry, not the console.
The Indian test project.
Yeah.
And then I'm going to hit next and I'm going to choose the name of the project as playwrite sharp demo
and create.
So this is basically a document called Project, which is using the court, threw out one at the moment.
And if you could see the package, you can see that in that one 2.0 and the framework is the dominant
core and all those things are going to be pretty much exactly the same thing.
And all I'm going to do to start working with the playwright itself is by adding a new get package.
And if I go to the browser and if I search for playwrite, you can see that the playwright Sharp comes
in.
I think the still it is not changed to the name of the Microsoft team.
There's still the author name is still the original author name, and they have not changed this one
at the moment.
So I'm just going to do an installation of the latest stable version.
And you can see that there are a lot of details coming in.
So I'm just going to install them on.
There you go.
It's done.
And if I go back to the solution exploders, you can see that the workshop has been installed, which
is quite good.
And now once the installation is done, we can start writing the code and we can see how it actually
works.
So for doing that, I'm just going to go over here and probably I'm just going to copy paste this code
and I will explain to you what these things are in our next video.
But as of now, I'm just going to copy paste this code.
You can see that it's going to ask you for adding the dependencies.
Something's going to add that.
And you can see that it actually tells you that the Awada operator can only be used within and I think
method.
So basically this particular test method is not and I think this has to be and I think method so that
we can use an agreed keyword in C Sharp.
So we need to change this method to async.
So make sure that you do that.
If not, you're going to get this kind of error all the time.
So please try to do that.
And once this is done, you're pretty good to go.
And there is an error coming in for the click operation.
I think it should be afraid as well.
I'm not sure why.
Yeah, I, uh, think this example has missed up with there should be a wait.
If not, the code isn't going to work and I'm going to stay with this and try to run this test and see
what's going to happen.
So if I just write, click and run the test.
So what will happen is once I run the test for the first time, it is actually going to download the
the playwright for you so you can see that it is still downloading things over here.
All right.
You can see that it took some time to actually download all of the play regular stuff.
And this test actually shows you a message saying, I think testamentary must have a non-white return
type.
So basically what we did is we just change this rate and I mean that method as a think method.
But basically and I think method is going to be like a task type.
It certainly have a wide return type over here.
So basically it should be of a task return type.
If not, they're going to get this at.
So this is basically from the asynchronous programming model that you need to always follow to make
sure that you change this guy to task, if not, the test is going to fail.
So let me try to run this again and you will see that the test this time is going to work as expected.
And you can see that it's actually opening on a Web browser and it is performing the operation and the
disk has got passed.
So you can see that just to run this particular test, like playwrite SERAP test in a think format,
you need to change the signature of the method type return type, as I think, and task and other things
are going to be pretty much exactly the same, like how we used to do that.
We'll talk about how the code has to be written in our next video.
But you don't set up and writing a writing and writing a simple test.
This is quite similar to other language bindings as well.