hi guys my name is karik and I'm from is automation.com and today in this video be talking about playwright mCP servers all new API testing support if you remember a couple of weeks before I've been talking about this model context protocol of cloud anthropic which has got the feature to talk to your local context which is nothing but your local application or your local browser which can perform the operation that you are looking for and once again if you're really not heard about the mCP server mCP stands for model contest protocol which is an open- Source standard to help AI assistant to work more effectively by connecting them to the system and tools where relevant data reside that is what we have discussed already and I also told that mCP server can actually interact with multiple different uh systems within your own machine or it can be uh some other systems like slack or uh Google drive or even Puppeteer and I also told that I built my own playright mCP server which is going to be something helpful for you to perform the automation testing is something but the UI automation testing something like this we already discussed about it and also we saw a demo like how it can perform the operation like uh entering the username and password clicking the the link and also performing the operation on the UI like how you are seeing over here so those things we already discussed and how it is all working fine uh on the last video and also a couple of other demonstration have discussed about it but today in this video I'm going to talk about the all new feature that I have released the support of playright mCP server which is nothing but the API testing as you can see over here so basically now you can tell the model context protocol of the Play Ride mCP server to just perform the API testing operation by the plain English text and it is going to do all the operation that you are looking for so we are going to see a demonstration of how we can achieve this in this particular video here so once again the playright mCP server is already released so you can just go ahead and add the reference or add the mCP server in your CLA desktop client and you should see the functionality which is going to work in my machine is going to work in your machine as well but before I'm going to go deep into that I'm going to quickly show you a demonstration of how this entire operation really works so now if you just go and open the cloud desktop client something like this you should see that you're going to have the uh mCP server for the playright mCP server so any playright mCP server Beyond 0.2.4 should have this particular feature the API testing feature which I'm talking about so all I'm going to do right now is I'm going to be doing a quick API test and for doing that I'm going to give some command to the uh Cloud desktop client to tell that this is what I really wanted to automate so the command which I'm going to be giving this time is going to be this I'm going to say uh perform a post operation for the URL which is this one with the body uh of this body and verif five the response has the created at and ID property so this is the thing which I'm really going to give to the cloud desktop as an input right now so if you just go to the website over here you will see that this ready to use uh restful API is like a website which has got some apis that you can use for testing operation so they have hosted it uh in this particular URL so you can just see how this really works so I'm going to use the same exact URL to per from the operation which I'm going to be showing to you right now see that this is the URL and you see that there is a command that they have given for the post you can supply this particular body and it will give you the response something like this so only if you have the created at property in this particular response you can ensure that this is working fine or not that's the reason why I told that and ver five the response has created at and ID property because you see that I'm not really supplying these two property as in body input so now if I try to send this command and over there you'll notice that now the uh the mCP server of the playright is going to kick in and you see that we have got a new play rightor poost Tool which is going to perform this operation for me so now if I just say allow this chat you'll notice that it is going to perform the operation for me and now it's going to verify the response whether it has the ID and created at property and looks like it has and that's the reason why it is telling me that see that this is the property like ID and there is a created at property as well so it is matching like what it is looking for and you also notice that I have also added for this particular request that you passing in that this is the request body that you're sending in you will also have got a Content which is going to be the response content so you see that this is the actual response coming in uh from the particular API that we have got which is great so now we also have got the response text over here and I have also added the response status code over here so you can now verify if there is a response status code of 200 or 404 or 500 something like that so all of these you can verify uh with this particular uh API over here that is that is pretty cool that is what I have did it over here and that's exactly what we are going to be seeing this particular demonstration but I'm going to add even more workflow uh for the API test because for instance if you're going to be doing a post operation and if you want to do a put operation or maybe a patch operation like update or partial update operation then you need to do it on a specific ID for instance a specific uh object ID or specific product ID over here so if you want to do that you need to store that particular ID uh and then you need to pass it as an input to the put operation so that it can perform the the uh the updation on that particular uh object or that particular uh item that you are trying to update that's exactly like a workflow that we wanted to do now I'm going to do every single thing right now using the plain English text I will show you how everything can be done well as that said I'm going to quickly show you how we classically do the uh testing right mostly for API testing what we do is like we're going to open uh the postman over here and then we go to the uh uh to uh let's say for the get operation uh we're going to copy this particular URL and then we go to the postman like that and we hit the send it is going to give us all the uh responses of that particular API in a Json format right and now let's say if I want to get any of the uh any of the um the object by performing a post operation for instance so let's say I'm going to do that and I'm going to create a new product so I'm going to copy this and in the body uh let's say I'm going to pause it as a Jon form over there and if I try to send it right now you see that it is going to create a new product for me see that the ID is pretty much like what the response we got from the cloud desktop client and also has got the uh created at property along with the data that we have supplied so that is how the creation actually works and if I want to do a put operation so all I have to do it is see that I have to do a put operation for this particular ID that I have got so what I'm going to do is like I'm going to do a put and see that I have to pass this ID over here so I'm going to say slash this particular ID which I want to update uh and the the the thing that I need to update is really uh let's say I wanted to update what they have said over here like how I'm going to be updating so instead of the uh Intel Core I9 I'm going to say M4 or M3 uh processor and the year going to be 2024 or something like that so if I do a send over here you'll notice that it is going to do an upd for me over here that is the put operation that we do that is the testing that we always do right like we have to do it in the postman or maybe we create a workflow for doing all these operations and stuff and similarly we do the patch and delete operation but we definitely need to supply this ID if not we can't see what updation is really happening for our specific uh object or specific product that we're talking about so well in all these things because if I want to do all these operation uh in man I have to do like one by one every single time so instead of doing that and if I want to really do an API test all with plain englist Tex instead of doing it uh like an Postman or maybe uh in an automated rest API tool like rest assured or rest sharp I can use this play rides based uh API testing feature in Cloud anthropic so the scenario that I have already written for that matter I'm going to just copy P so that we don't really have to type that every single time so this is my scenario over here all I'm saying here is that I'm going to say perform a post operation for this particular URL with this particular body and verify if the response has created at an ID property and store the ID in a variable for the future reference say a variable product ID so I'm going to pretty much tell like an end user uh or maybe a manual test engineer like how I need to perform the next subsequent operation or how I wanted to carry forward this operation so I'm going to store the ID in a product ID variable and now I'm going to say perform a get operation for the created product ID over here and verify the response has the property like ID and name so I'm not really verifying if it has got the uh the value uh of the name as Apple MacBook Pro or something like that I'm just plainly telling this is what I wanted to verify and then I'm going to say I want to perform a put operation this is going to be the updation operation I'm going to tell that this is the product ID that I'm passing in so this product ID with this particular body so you see that I have now updated from the CPU from M4 to M5 uh and also I'm changing the year to 2025 uh the price is this and the color is titanium so I'm updating quite a lot of things over there so I'm verifying if the response has got created at an ID property and even if I want to verify if it has got uh the year as 2025 it can do that as well for me so so you can do all these changes are verified just by using the plain English text you can do that and similarly you can perform the patch operation I have told that just go and update the the name from Apple MacBook uh Pro uh 19 to limited edition uh and then finally I'm going to say verify uh verify that it has got the value as the Apple MacBook Pro 19 limited edition and that's what I'm trying to uh verify so I'm just going to verify if it has got an updated property and uh and a value maybe and uh and name property with value as this one right that's what I really want to verify so now with all these plain English text if I hit enter if I send it you will notice that now all these operations are going to be happening for me with the with a tool just specified inside the uh mCP server you see that now it tells me that this response contains there is a tick mark there so all these testing are getting passed for me so the post operation is successful the get operation is successful the put operation is successful and the patch operation is currently executing and it's also successful so notice that all these tests are now running on an actual API not like like a like an API which you don't really have access to now this API is accessible by our Cloud anthropic and it creates thing for me over here look at that that's the get operation for me and that's the put operation we already saw this uh and this is the patch operation so you see that that's the patch for me over there it has got all the details which is great and it has like verified every single thing instant for me so all you have to do right now is install this playright mCP server uh in your uh in your actual Cloud you know how to do that we we already discussed about it just go and edit the configuration and do it and once you add it you will now see everything is been done over here that's all guys this is how we can perform API testing using playright mCP server which has got the API in feature but everything is running under the hood with the playright so playright is the one which is driving all these API test for us and everything is just works fine so now this has got so many other open questions as well you can ask like karik how about if I wanted to pause an image and if I want to verify that and how about I want to do with the multiform uh input and what if I want to do with a even more complex binary datas how I can do that well this library is set to extend with all these capabilities pretty soon but for now we have got the basic operation to perform the API testing and hope you have got the idea like how everything works so once again thank you so much for watching this video don't forget to use the playright mCP server in your Cloud desktop you can get all this feature without even a single penny thank you so much for watching this video catch in the next one