The Perfect Tool for Quick Browser Tests - Playwright MCP Server
By Execute Automation
Summary
Topics Covered
- HTML Analysis Prevents False UI Operations
- Playwright MCP Complements Library Use
- Developers Favor MCP for Quick UI Tests
- IDE Integration Enables Instant Testing
Full Transcript
Hi guys, welcome back. And today in this video I'll be talking about playright MCP server from automation and we're going to talk about where exactly this playright MCP server is going to fit in
in your everyday workflow while you do automation testing and playright MCP server is an replacement to the test automation that you do with the playright using the library or is it an
replacement to even selenium automation testing tool that you have been writing all these days using frameworks and things. So where exactly does this play
things. So where exactly does this play MCP server is going to fit in your workflow? That is something that we are
workflow? That is something that we are going to be discussing. And the next thing we're going to talk about is some of the new feature that is introduced in this new release that we have added something like the playright get visible
text and the playright get visible HTML and also save as PDFs and also uh drag and drops and things of that nature. So
these are things which is there already but it is now in the version 1.0.3 which I have not really discussed and I wanted to discuss about it. It is going to show you how you can really improve the
workflow or maybe better job in doing this test automation using this play MCP server with these kind of tool with a bit of a prompt fine-tuning that you have to do. That is exactly what we are
going to be discussing. So let's first talk about the smaller part which is the feature part because it's very very straightforward. So in order to do that
straightforward. So in order to do that I'm going to go to our cloud desktop over here and I have told uh here in the prompt saying navigate to this particular website and perform a login operation and check if the login is
successful. Before performing any
successful. Before performing any operation try to understand the page HTML structure and then perform the operation to reduce the false operation on the UI elements and then close the
browser once done. This is what exactly I'm trying to say over here. I can also say save the page as PDF if you wanted to or maybe uh try to navigate uh to the
website in a in a in a like a mobile mode. I can also say all those things
mode. I can also say all those things but I just want to keep things very very straightforward in this particular uh prompt and I'm asking this question over here. The moment I ask this question,
here. The moment I ask this question, you can see that it's going to open the playright um uh navigate tools for us.
And then you will notice that the the website is being navigated for us over here uh like how it is saying. And now
it's saying now I will take the screenshot to see if the page looks like uh and then I will examine the HTML structure. See that now it is calling
structure. See that now it is calling this playright get visible HTML for me.
Uh and now it is um analyzing the page and it is going to perform the login operation. See every time before it
operation. See every time before it performs any operation it is going to get the visible HTML page and then perform the operation because you can
also see that the uh playright MCP server has the uh ID of the username password and the login button to perform a better work because if you remember
earlier days while we were not having this particular feature the parent MCP server used to just do based on the namings and then it will perform the
operation on the UI but right now it is going to first of all understand the the HTML structure before it performs any of these operation and look at that now it
has performed all the operation for us and the test has got passed over here so this is one way of how you can make use of uh the play MCP server office
automation to perform these operation in a more relevant fashion so this is pretty cool so this is one of the feature that we have introduced in version 1.3 now Now we are in version
1.0.5. So this feature is already there.
1.0.5. So this feature is already there.
If you already using it for a long time, if you have not used it, please try to use these prompts which will make your life even more easier and you'll not get any false negative operation uh in the
uh in the uh play MCP server when it performs any operation. That's one
thing. The next thing is how the play MCP server is being used by the test engineers and developers. Is it a replacement for the uh the playright or
the selenium that we have been using all these days? If you remember playright is
these days? If you remember playright is an completely big library. So if you're just going to go and put this playright um uh dot let's say just playright
dodev. So this library has got all the
dodev. So this library has got all the bells and whistles. So it's available uh for different language bindings and you can also use this playrite uh for performing all the different operation
not something that you can actually uh do from the uh playright MCP server because the play MCP server is built on the top of this tool this library itself. So this library has got more
itself. So this library has got more feature than the play MCP servers itself and also this play MCP server uh library can be extended within your code. We all
know that we can write like a framework and then we can uh perform even many different operation which the plate MCP server can't and the plate MCP server runs uh with the power of the large language model like a reasoning models
but over here you don't even need to have any of those things it can just directly run on your local machine without costing you anything because it's all running within your local machine and there is no need for large
language models and things. Another
thing is there is a confusion with people saying this large language model actually is going to consume a lot of tokens because uh just if you're going
to use the plate MCP server to generate the code then it doesn't make any sense because play MCP server uh if you're just going to use for the code generation then you can use the codegen
tool which is available within the playright itself. So why can't you just
playright itself. So why can't you just use that? So if you just go and search
use that? So if you just go and search for uh code gen see this one this is the code generator operation which is already there in playrite which will help you generate the code on the fly so
you don't really have to use this feature to use for uh to generate the code in the playright MCP server because that's not the point there right so how
do we actually squeeze or maybe use this play MCP server within our development workflow and how exactly companies and people are really using this play MCP
server. Well, developers are actually
server. Well, developers are actually using the play MCP server more than the test engineers itself. So if you wanted to do some sort of component test or maybe if you want to do a quick UI test
of your application while uh not writing a lot of different codes to make that operation happen, they use split MCP server to different uh to perform this operation. And similarly, if you are a
operation. And similarly, if you are a test engineer and you wanted to see a specific UI element interacts and work as expected, you use playrite MCP server
for that matter. And if you have a very very simple test operation without logging in or maybe if you wanted to see whether all the different combinations
of the test are executable with your uh UI component you just put everything in the command all the datas and ask the player MCP server to to to navigate and perform all these operation playc server
is going to do that for you. So all of these you don't even have to leave the IDE to perform this operation because you can use the power of cursor or the
uh the VS course GitHub copilot or even the client and all these uh these tools can do this operation without you leaving out of the IDE. It can do things
for you out of the box. That is the power of it as well. So if I'm going to open the cursor IDE uh and you can see over here within the cursor we have this settings uh over here the cursor
settings uh and we have got this MCP tools and you can see that we have got the playright over here. So if I go and hit edit you can see that this is the playright MCP server that we have got.
So if you just put the play MCP server uh or configure this MCP server over here and then you can just use the uh the play rate MCP server in the chat uh
and then if I'm just going to open the tab over there and now if I'm going to ask any of the question from here let's say you're going to be building an application and you wanted to test that particular uh applications feature you
just go and ask in the chat side and guess what the play MCP server is going to automatically kick in and it's going to perform the operation. because you
have already configured the pyramcp server within the cursor IDE. So this is the place where the parmc server is going to really fit in because you don't necessarily have to do or write a lot of
codes to perform this operation. PM MCP
server is going to do that for you and similarly if you're going to be uh testing a very very simple database operation then you can use the MCB database server to perform this operation. So, so exactly that is how we
operation. So, so exactly that is how we use the MCP server not for the full-fledged end to-end testing with the uh the framework level uh like how you can do with a playright or selenium but
MCP server is mainly used to perform a very simple operation or maybe some complex operation based on the prompt like how you design but it is something
that you can even write very easily with the u with your code but you if you want to do something repeated and also you wanted to do it quickly instantly get it done. MCP server is the way to go
done. MCP server is the way to go instead of you writing everything from the scratch. That is how we use the
the scratch. That is how we use the plate MCP server instead of uh using it like a automation framework or any library replacement. Hope it clears your
library replacement. Hope it clears your questions and also hope it clears where you can use the playtime MCP server.
That is the real purpose that I wanted to create this video. And also I wanted to show you the feature that we have introduced in the V MCP server which is something that you just saw over there
the get uh visible HTML which is quite amazing. So that's it guys that's about
amazing. So that's it guys that's about this particular video very short video once again thank you so much for watching the video catch in the next one.
[Music]
Loading video analysis...