Mastering Selenium MCP Server | Integration with Claude

Brief Summary

This video explains how to integrate Selenium with Claude, an AI tool, using the Model Context Protocol (MCP). It details the benefits of using Selenium MCP server, which allows writing test cases in natural language and converting them into Selenium code. The video demonstrates how to set up the integration and perform basic browser automation tasks using Claude.

  • MCP enables seamless integration between LLM applications and external data sources and tools.
  • Selenium MCP server allows writing test cases in natural language.
  • The video provides a step-by-step guide to integrating Claude with Selenium MCP server.

Introduction to Selenium MCP Server with Claude

The video introduces the concept of using Selenium MCP server with Claude, an AI tool, for test automation. It mentions that MCP stands for Model Context Protocol, an open-source protocol that standardizes how applications provide context to Large Language Models (LLMs). MCP enables LLMs to interact with external data sources and tools like Confluence, Jira, and GitHub.

Understanding Model Context Protocol (MCP)

MCP facilitates seamless integration between LLM applications and external data sources and tools. The architecture involves an MCP client (like Claude) communicating with an MCP server, which in turn interacts with data sources such as Confluence, file systems, or databases. The MCP client registers or connects with the MCP server to fetch data from these sources. For example, a user story on a Confluence page can be read, and based on that, test cases can be generated.

Benefits of Selenium MCP Server

The video explains the benefits of using Selenium MCP. Without MCP, test automation involves writing code in Java, Python, or C# to initialize drivers and interact with browsers. With Selenium MCP, an LLM like Claude can be integrated with a Selenium MCP server, allowing test requirements to be written in natural language. This natural language is then processed to perform actions in the browser.

Functionalities of Selenium MCP Server

The Selenium MCP server, developed by Angie Jones, includes functionalities such as starting a browser, navigating to a URL, finding elements, clicking elements, sending keys (inputting data), getting text of elements, hovering over elements, and drag and drop. The server.js file in the GitHub repository defines these functionalities, which can be integrated with AI tools that support MCP.

Integrating Claude with Selenium MCP Server

The video demonstrates how to integrate Claude with the Selenium MCP server. Claude supports MCP communication and can interact with the Selenium MCP server. The integration process involves configuring Claude Desktop by editing the config file and providing the location of the Selenium MCP server. After restarting Claude, the integration is active, allowing Claude to control browsers like Chrome and Firefox.

Demonstration of Browser Automation with Claude

The video demonstrates browser automation using Claude. By typing "open chrome browser," Claude opens the Chrome browser. Then, by typing "launch source demo app," Claude navigates to the specified URL. The demonstration continues with Claude logging into the application by finding and interacting with the username and password fields. It also shows adding an item to the cart and then closing the browser.

Performing Operations in Firefox and Code Conversion

The video extends the demonstration by performing the same operations in Firefox. Claude successfully launches Firefox, navigates to the demo app, logs in, adds an item to the cart, and closes the browser. Finally, the video shows how Claude can convert the performed steps into Selenium Java code, which can be downloaded and used in a test automation framework. The generated code includes setup (before test), test case, and teardown (after test) sections.

Conclusion and Benefits of Using MCP Server

The video concludes by highlighting the benefits of using the MCP server to write test cases in natural language and convert them into Selenium code (Java, C#, or Python). This approach simplifies test automation and makes it more accessible.

Summarize any YouTube video in seconds

Get summaries like this one for any video, in your language, with the free Summ app.

Download on the Apple Store
Get it on Google Play

Transcript

Full transcript of “Mastering Selenium MCP Server | Integration with Claude”. Click a timestamp to open the video at that moment. Need another video? Use the YouTube transcript generator.

0:00 Hello everyone, welcome back to my channel Prince Automation Destination. This said Prince I hope you are doing well. So today we are going to talk about Selenium MCP server with Claude. So Claude is an AI tool which we are going to utilize for Selenium MCP integration. Right. So before we discuss about what is Selenium MCP server, let us discuss about what is MCP. Though I have already covered it as a separate video. If you want to understand at low level, you can check out my video in ICON. Now, let us try to understand what is MCP. MCP stands for model context protocol. This is an open-source protocol that standardizes how applications provide context to LLMs. Let us try to understand it. So, by

0:47 default, if LLMs want to talk to our file system or if it want to for example talk to any tool, let us say want to talk to Confluence, Jira, GitHub, right? to get the details of a particular repository or a particular page on Confluence. Right? So, LLM does not have that capability. With the help of MCP, it becomes possible. Right? So, we will try to understand how it works. Right? So, with the help of MCP, it enables meaning the MCP enables seamless integration between LLM applications and external data sources and tools. Data sources meaning it could be Confluence, Jira, GitHub, GitLab, right? It could be any any third party tool. Right? Now this is the architecture. So we will have MCP client. So it could be cloud

1:34 which is having capability to talk to MCP server. So MCP server is a program which has integration with data source. So for example there could be a MCP server for confluence which can talk to confluence page and there could be a MCP server for file system which can talk to uh the local file system. There could be MCP server for connecting to database, right? And there could be a MCP server to talk to any website or any tool available over internet. Right? Now, how it works is MCP client first of all need to register this particular MCP server or need to establish a connection with this particular MCP server which further has integration with the data source. Right? So this way when MCP client will

2:19 make a call to MCP server as a result we will be able to fetch the data from this particular local data source right. So try to understand like for example we have user story on confluence page. So we can read that particular user story and based on that we can generate our girkin right or our test cases right this is how it works right now as we are going to discuss about selenium with the MCP right that is selenium MCP server so we will try to understand what is the benefit we are going to get so selenium without MCP if we don't have like MCP in the middle so we will have Java code Python code or C# code right and we are going to trigger the driver we are going to initialize the driver and then we are going to talk to browsers right so in the middle we have selenium library and

3:05 this is how it works right now with the help of selenium mcp what will happen is we will have claude that is llm or any other llm like Germany we can use and we will have selenium mcp server so there would be integration established between this particular mcp client and selenium mcp server and then after within the llm we can write the data write the requirement in natural language processing that is human readable thing like for example I'll be writing open chrome browser right so it would be able to open the chrome browser right now let me go to this particular repository so this is where the MCP selenium server exist Angie Jones is a lady who developed this particular

3:51 framework right mcp server right so she has introduced some of the functionality Right. So if I show you, so she has these functionality. We can start the browser. We can navigate to a URL. We can find element. We can click element. Right? We can send keys meaning input the data. We can get the text of element. Right? We can hover over element. We can drag and drop. Right? So these are some of the functionality introduced by MCP server meaning this particular MCP selenium server. Right? So if I'll show you how it it is done right right so I'll show you this is the GitHub repository. So somewhere here in src lib you will find server.js and here

4:36 she defined the functionality. So if you will see this is get driver this is get locator this is opting uh somewhere you will find a browser management tool which browsers uh we can open right and then like there like find element find finds an element right then we have click on element. So these are the functionality defined here right. So we just need to integrate this particular selenium server with the cloud right or with any LLM or any AI based tool which support MCP right. So cloud is one uh AI tool which supports this particular MCP uh communication. It can talk to MCP selenium server right. So now let us discuss about this how we can integrate it with uh like cloud. So if you will

5:23 see it is supporting only chrome and firefox right. So we will be interacting with chrome and firefox. We can use go as well. So go is another AI agent which can interact with any llm and with the help of go also we can initialize the uh selenium server but I'm going to cover today's lecture with uh cloud right. So we will go to this. So this is what it is saying that use with other MCP client. So I'm going to use cloud desktop which I have just showed right. So I'm first of all going to integrate cloud desktop with this particular MCP server right so which has command npx and this is the location of selenium mcp server right so I'm simply going to copy it and I'll be going to mc uh this particular cloud and here we'll be

6:08 clicking on file and then settings right here we need to click on developers and we need to click on edit config right as soon as we'll click on edit config it will open the cloud location in our system where it is installed. Right now I'm going to right click and open it into notepad and here I'm simply going to provide this MCP server. So if I'll undo it was providing blank MCP right now after providing it like uh it would be able to connect to selenium MCP server. Right? So if I'll for example click here right we we don't see anything. So what I will do is I will first exit this right. So we will first exit this and we will restart it and then we should be able to see the

6:56 integration of cloud with selenium mcp. So let us wait for save. So it takes some time. So let me go again and go to settings and go to developer. So you see this selenium server is now running right. So we sometimes get the um message here as well that selenium mcive server is connected. Right? So if we don't have integration if you will simply write open chrome browser it won't be able to open it right but now we have integrated it so it would be able to open it. So I'll say open. So if you will see MCP is here now right. So now we got this message access integration in this menu. Right. So open chrome browser right. So let us see how it will behave. So it should be able to open the chrome

7:42 browser. So it is asking the permission I'll always allow. Right? So you see it has opened Chrome browser. Right? Next thing what I'm going to type in is launch source demo app. So it automatically picked up this particular URL right and if I'll navigate here it has opened this particular source demo app right now I

8:29 will say please login to the application so in the background it will find the elements as well as it will login into the application. So you see it is able to pick the elements right username and then password and then it is entering it and it will perform a login click on login as well right so it is asking so I'll now show you that it would have logged in so you see it has logged in right now what we can do is I'm going to inspect this and I'm going to click on this particular element and I'll

9:16 say add the following item into the cut. So you will observe that it would be able to add the item into the cart. So if you will go here we will be seeing that add to cart is now turned into remove that is this particular item is added. So if I navigate here this particular item is added right. Okay, then could you please close the driver, close the browser,

10:06 right? So, it has closed the Chrome browser, right? Could you please perform same operations in Firefox browser? So let us see whether it would be able to do so. So it has launched Firefox. Let me go back here. If it is asking for any access, right? Else I I'll go here and it has launched source demo. Now it will try to enter the

10:53 credentials. So let us see whether it is able to perform. So you see it is entering username. Now it will enter password and then it will click on login and now it would be adding the item into the cart as well and at last it will close the browser as well. So let us see. So it has added the item into the cart, right? Would you like me to

11:39 perform an additional option? It has not closed the Firefox driver. Close the Firefox driver. So it has closed the Firefox browser now right. So what we can ask is could you please convert the above or could you please provide the selenium Java code for only above steps.

12:30 So it has started creating the this particular app right this particular code right which we can at the end download and we can utilize it into the test automation framework right so it has converted this right so now you see that how beneficial it it is right so it has created before test right it has provided Chrome and Firefox, right? It has provided maximize option. It has then created the test case, right? And at last after test, right? So this is how we can take benefit of this particular MCP server to write the test cases in natural language and we can get the script running and we can then convert it into the selenium based code or selenium java or selenium C# or

13:17 selenium python. So this is how we can utilize it. So this is what I wanted to cover guys as part of current discussion. Thank you for watching and I would request you to please like, share and subscribe.

Share

More video summaries