AI-based Rules | Bondar Academy
Course: Mastering testRigor
Module: Generative AI
Instructor: Artem Bondar
Lesson Summary
In this lesson, we explore the AI-based rule feature of the Test Trigger , which is designed to automate existing test cases. This feature is particularly useful for converting documented test cases into executable automated tests. Creating an AI-Based Rule Using the example of a test case from the Best Buy application, the steps are as follows: Document the test case, e.g., "User can save selected product for later decision." Input the test case description and steps into the Test Trigger. Upon running the test, the Test Trigger identifies non-standard syntax and suggests creating an AI-based rule. Execution and Results After creating the AI-based rule, the AI attempts to execute the steps: The AI successfully finds and adds the Kindle to the cart. However, the validation step fails as it does not perform the expected action. Reusable Rules All generated steps become reusable rules . Each rule is marked as AI-based, meaning the AI will adapt to changes on the webpage, such as the location of buttons. Users can: Uncheck the AI option to create traditional rules. Modify rules manually to ensure they perform the desired actions. Integration and Efficiency The Test Trigger can integrate with various test case management platforms, allowing for quick importation of test cases. This feature can significantly reduce setup time by automating the initial configuration of test scenarios. In summary, the AI-based rule feature in Test Trigger enhances test automation by leveraging AI to adapt to changing web environments, ultimately streamlining the testing process.
Video Transcript
In this lesson we're going to talk about one more generative AI feature of the test trigger which is called AI based rule. So this feature can be very useful if you want to convert your existing test cases into the actual automated test cases. So test trigger following your test cases step can create the actual executable steps of the test cases and let me show you how to do that. So going back to our Best Buy application and let's say that we have a test case something like this. So this is again just a very simple example and let's say our test case says this user can save selected product for a later decision and the steps are on the home page search for Kindle then add Kindle to cart add Kindle and save items by clicking save for later and then validate that Kindle is displayed below saved items. So assume you have this test case somewhere documented in your test case management system or just in Excel file or something like this. So now what you can do is just simply take this description and create a new test case. So I go here at custom test case put this description into the description and take those steps and paste it over here. You can see those steps are not in the typical syntax of the test trigger. So when I click add and run I have this pop-up. So few steps first three steps test trigger figure it out that it is definitely not related to the test trigger syntax so it marked it automatically create AI based rule. But for the last one test trigger wanted to execute it normally but it's thinking that maybe something wrong with this command so it's offering either fix command commented or create AI based rule and we want to create AI based rule. That's it. So now all four commands will be created based on AI and AI will try to execute those steps and based on the its ability as best as he can will generate the test steps for our test case. So I click update and retest. All right that's it. The test case is completed. Let's see what actually was generated. So we can see that enter Kindle in what we help you to find today. So it found the Kindle. It added Kindle add to cart. Click on that. Then we navigate it to go cart. Then we clicked on the save for later icon. We saved it and looks like that for the last step instead of the validation that we wanted to validate that it's displayed below saved item it actually clicked on saved item roughly below Kindle. I think something like this. So this step failed but the rest of the step worked fine. Now let's see what actually happened when we talk about the rules. So I go to the reusable rules. Now we have all those steps were created as reusable rule. Now if I click on each of the rule we can see here a little mark AI based rule. So what this checkbox does it mean. So it means that every time you run this rule Test Trigger will run this description through the AI process and whatever AI decide based on the context at this moment on the web page it will trigger this moment. For example here add Kindle to cart. So if the cart button will be moving around the screen for example right now it's below the Kindle but then it will be relocated somewhere to the top of the screen. This rule still will work because AI gonna look for this cart button and will try to locate it. But if for example you will remove this checkbox you will see the steps that actually Test Trigger was executing during the last execution. And if you want for example for some of the rule instead of AI based rule converted to more traditional rule with the design steps that you want to click you just can uncheck this button modify the steps and then the steps will be saved as a permanent steps for this particular rule. So this rule worked fine for us so I will keep it as this. But I want to update this one. If I go here so we see that validate Kindle is displayed actually clicked instead of doing what we wanted it to do. Right so let's go back and see what we actually wanted. Going back here so I want to validate that Kindle is displayed roughly below saved items something like this. So let me update this rule manually reusable rules. Okay and I will type something like check that page contains Kindle roughly below saved items. That's it and I saving this rule. So out of four generated rules one I have modified to make it a regular rule. The rest of three rules remaining AI based rule. So now let's go back to our test cases and I run this test one more time a retest. All right and the test case was completed. So we can see we click save for later and later we manually validated that this item is located below saved items. So everything worked correctly. So this is the example how you can use AI based rule. This can be very example if you have let's say a large number of the test cases that you want quickly integrate with a test trigger. Test trigger can be integrated with a different test case management platform such as test trail and so on. So you can import your test cases into the test trigger based on the test case generate AI based rule and create those scenarios and then manually review those scenarios and make a needed adjustments here and there for AI rules to make your test actually what it's supposed to do. This can save you a lot of time by making an initial setup. All right that's it guys and see you in the next lesson.