Transcription
Hi guys, welcome to my new course on AI-driven test automation for Playwright and Selenium using Large Language Models with Olama and cloud models. So, we are going to be using both the local large language model as well as the cloud model for this particular course.
Well, as that said, what exactly is this course and what do we learn in this entire course? Well, this course helps you understand how to effectively work with artificial intelligence and automated tests together to leverage the best of both worlds. So, basically, this course teaches you how to maintain control over artificial intelligence and your code, rather than letting the white coding tool to take control of your automation test.
I know there are many different white coding tools available, like GitHub Copilot or Cloud Code and Cursor IDE, as well as there are many different tools available like MCP servers for Playwright as well as for Chrome DevTool MCP. These tools will help you generate the code and also update the code or refactor your existing code. But the problem is, the moment you let these tools to take control of your automation test code, it will write things which you may not be understanding after some time. And there are also chances that you may rely fully on these tools, while the existing code that you have got will have less potential of using the power of AI, rather than just letting your artificial intelligence to do everything for you. So, essentially, your code becomes an AI-first approach, rather than an AI-driven approach. So, that is the problem that we always face.
Instead, in this particular course, you will have full control over the AI and your code, and you don't need any fancy tools to enhance your existing test code for that. With just a few code changes, your current existing code itself will become an AI-powered course. And because we have seen what this course is and what this course is for, we also need to understand what this course is not for, as well.
Well, if you are wanting to learn Playwright and Selenium basics along with AI testing, then this course is unfortunately not for you. Because we are not going to learn anything basics or the foundation elements of Playwright, like how the element needs to be found and how to perform an operation, how to open a browser, and how to do the assertions. Those are things that we'll not be discussing in this particular course. And the same thing goes for Selenium as well, because this course is going to focus fully on how we can enhance our existing tests, like Playwright as well as Selenium, with the power of AI and make the tests more smarter.
And if you really wanted to learn the basics of Selenium and Playwright, you can head over to my Udemy courses, where I have talked about the Selenium with C#.NET basics for complete beginners. And also, I have talked about how you can do the framework development of the Playwright in C#.NET in this course. And also, if you want focusing on building your complete framework for enterprise-grade, you can also go and look for this course in Selenium, which is going to talk about those details. So, these courses are exclusively built for that, and this course that we're talking about is not going to be for Playwright and Selenium with framework development kind of things, because that's not this course is for.
Well, as I said, what do I mean by the AI-powered test to existing code and how does this course really help? If you are puzzled about this, then let's see some of the use cases for the AI-driven testing, which will give you some idea of what I really mean about that. Well, if you are one of the million concerned about the fragile UI automation tests that frequently fail due to unstable user interface, then this course will help you fix that particular problem. And similarly, if you wanted to do a real visual testing, which gives a logical difference of your application if there is going to be any failure happens, then this course is going to be helping you that. And if you want to leverage further with your API testing to ensure that you get the entire automated testing done with just the API schema, then this course is going to be helpful for you.
So, we are going to see how we can use our existing tests and empower them with visual testing, self-healing, and making them more smart and intelligent with the power of artificial intelligence and Large Language Models. That is the crux of this particular course.
Well, as I said, let's understand why we need self-healing tests in the first place. For instance, you can see that we have got a page developed by the developers, and he's giving it to us, and he has made some changes on the UI. Well, now our test gets obsolete, and our test immediately fails. But what if we are passing the page as well as the code to the Large Language Model, and we are going to get a real-time feed of what has changed on the page, as well as whether our page object model code that we have got any obsolete locator? Then we can ask the Large Language Model to return if there is any matching page locators that we have got. Then go and run it. But if there is any breaking change, then report that breaking change as a file, and still don't fail the test, rather just run the test for the remaining scenarios, and then report the failed locators to the developers in a Slack or maybe in a format which the developers can understand, and tell them that these has made the test locator to fail, but still the test execution continued in order to not abruptly stop the entire test, but still continue from then.
So, this is one of the ways that you can see that automation tests can leverage the power of LLM to self-heal the test and continue the test execution and report the failures to the developer so that they can go and fix it, and the next time while we run the entire test, it is still going to work without any problem. This is the power of how we can use the self-healing approach.
Well, as I said, we are going to be doing all of these operations with quite a lot of different operations, and you will see that it starts off with complete basics, and then we'll go all the way to complete complex approaches, something like this, and then we'll see how things work. I'm going to quickly show you a demo before we get started with this course, so that you can understand how amazing this course is being built.
So, well, this course is built for both Playwright and Selenium automation testing tools. So, essentially, in this particular course, we are going to see how we can actually leverage the power of artificial intelligence and Large Language Models running both in the local machine as well as on the cloud to perform the self-healing of your tests, as well as the visual testing caching, and how you can use the semantic context to improve your test automation in even better fashion.
So, as you can see over here, for the Selenium test, we will have the test code pretty much like the same exact code that you might be familiar with using the page object model code. You'll also have the same kind of Selenium test over here, and you also have the utilities which is going to perform the operations for the Large Language Model, and how you can work with the visual testing caching, semantic search, and auto-healing approach, API integrations, and all those things. That's all going to be covered in this particular course.
As you can see in this particular page over here, we also have got what is called as a semantic context, which will actually help your code to make sure that even if the locator doesn't exist in the UI, it is going to use the power of the semantic context over here to perform this operation for you. Essentially, if you're going to see in the login page over here, we can see that we have got a client ID for the for the text username, and we also have got an O ID for the for the actual locator of the password. But still, we are going to give the semantic context over here that this is the locator which is going to be responsible for filling the username, and this is going to be filling the password for you. And look at the the way that I have given over here, the submit button locator is completely scrambled as well.
And the moment we start running this particular code, it is going to use the power of the Large Language Model, which is running within our local machine, like this, with the QN3 coder 30 billion parameter model, and it is going to perform the operation automatically for you, along with the self-healing approach, and also it is going to cache the entire test for you in the healed locator file, so that you can use the particular file anytime you wanted to. For instance, if I'm going to run this particular test over here, as you can see, before I run this particular test, you'll also notice that we are going to have a file in the bin folder, as you can see, like healed locator, which is going to contain the locators with all the healed locators options.
So, I'm going to go and delete this particular healed locator before I start executing the test. And the moment I start running this particular test, it is going to use the power of artificial intelligence and local Large Language Model to go and heal the locators for you. And because I have also given the semantic context, it knows that this has to be identified using the username locator, and it is kind of slow right now because it is using the power of the local Large Language Model while running the test for me. And you can see that the test is taking essentially quite a long time to perform an action of typing the username there. And similarly for the password, and now it is going to go and click the login button. So, all these three control IDs are completely wrong. I made this pretty intentional to make that happen.
And now, if you go to the bin folder, and if I'm going to show you the healed locator.json file, you will notice that the healed locator.json file will actually have got the actual locator. So, you see that for the client ID over here, the actual the working locator type is I'm using is the ID, and the locator value is username. And the same goes for the password over here. See that I have given the ID as O ID, which is completely not related to this particular locator ID, but still, because it has got a friendly name as the password input field, now the AI has got the context and semantic context of how it needs to identify the particular locator over there. So, this is how it is going to heal it for you.
And because we also have implemented the caching mechanism, now the moment you run the same test one more time, the total time took for the execution is 41 seconds. But now, if I run the same exact test, it is going to take just around like 7 seconds, because now it has got the already cached locator in the healed locator file. So, the execution is pretty much like how this Playwright does the execution for you, and it took only 12 seconds in overall execution time. This is how you can see that we can run the test using the power of the Large Language Model to do the operation, and it is quite awesome.
And also, we have got the support of the vision models, and how we can do the uh the image search, as well as the API enhancement, and everything included in this particular course. I'm quite excited for this particular course to deliver to you, so that you can do the same kind of enhancement, as well as more improved enhancement from here on, because now this course is going to give you an idea of how you can use the Large Language Model at your work and enhance your existing test cases, instead of just going with some fancy tool available on the market.
Once again, thank you so much for watching this particular video, and I'm quite excited for you to join this course. Catch you in the first section of this.