Katalon AI: Generating and Explaining Test Scripts Seamlessly With StudioAssist Learn Now
A codeless testing tool is the easiest way for new automation testers to start learning and experimenting with test automation or a powerful productivity boost for those with more experience.
In these 4 chapters, we will cover the topics of:
Hi, this is the Katalon team, and welcome to a tutorial. In this video, we'll show you how to create and execute test cases in Katalon using Record and Playback mode. Let's get started!
First, to create a test project, go to 'File' > 'New' > 'Project' and this new project box will appear. Give your project a name then you can either choose a specific type of test you want to create here or you can just choose generic if you want to run more than one type of test. Next, select a sample project to run your tests on or you can start with a blank project. Here allows you to integrate code stored in some outside platform like Github or Bitbucket.
Now give your project a description if you wish click 'OK' and then you have a new test project. Here before you create any test script you also have the option to integrate with Katalon TestOps, a centralized location for all of your test results and advanced reports. In this chapter, we're not going to focus on Katalon TestOps for now but watch out for a future tutorial.
Moving on, this is what your screen will look like. On the left panel, there are many tabs to explore which we'll now go over really quick.
- The 'Test cases' tab is where you store all of your automation test cases.
- 'Object repository' is where you saw all of the web locators that the keyword is going to interact with.
- The 'Test suites' tab is where you can run multiple test cases at the same time.
- 'Data files' is where you store the actual database files that you use for your tests.
- 'Checkpoint is where you store snapshot of test data taking at a specific time to compare test data in various testing points.
- 'Keyword' is where you obtain the capability of Katalon Studio.
- Finally, 'Test Listeners', this is where you add customized test step of choice.
- And 'Reports' is where all of your test reports are stored.
Now to create a test case, go to the top panel, click on 'Record web' button and this box will appear. Now input the URL of the web you want to test. Then click on the browser logo, then this tab will pop up and your test is being recorded. Here, you can see a red border surrounding every object in the tab, and everything you do, every object you click on will be recorded here. Also in this panel, you can see the object you're interacting with and change their name or their properties as your choice.
Now let me create a simple login test for you to see. Now you have your test script. Let's save it, click the 'Save script' to save all these locators. Give it a name and you have your first test case. With this login test case you can run in most browsers such as Chrome, Firefox, Internet Explorer you name it.
However, here I want to show you another way to create a new advanced test case incorporating the login test case you just used for this chapter. I'm going to create a booking appointment test case for you to see. First, go to the 'Test case', 'New' and give it a name. Then I'm going to drag this login test case into this 'Book appointment' tab on the right. Click the 'Record' button on top. Click 'Yes' and your new test case is in progress.
First, click 'Play' button to playback ALL of the steps in your old login test case. Now, all you gotta do is normally go through the actions that you want to test. To finish creating this test case you will want to create a verification point to verify that you have successfully navigated to the final page that you want or in this tutorial is the appointment confirmation page.
So, what you want to do is click on the object that you want to verify, or in this situation the 'Appointment Confirmation' object. Go to the panel on the right and give it a verification keyword that we have on this dropdown. Here I'm going to choose the simplest way to verify my object which is the 'Verified element present'. Set a timeout or a time that the test is going to wait for the object who appears to verify it. Here is 30 second and click 'Save script'. Choose to override the test case.
And here you have another test case for yourself as Katalon supports most major Browsers. I'm going to run this test on Firefox instead of Chrome for you to see. And that's the end of this chapter.
Katalon Studio supports Keyword-driven testing where test cases consist of keywords that represent actions of users on the AUT. To add a new step to a test case, use 'Open browser' keyword to start a browser instance. Then, provide an URL for the browser, this is optional. Use 'Set Text' keyword to enter value into a certain text field and specify the object to enter text. Provide the value to be entered into the object.
Next, use 'Click' keyword to click on certain control. You can drag and drop an object in the repository directly to the editor. Then, continue to use 'Verify Element Present' keyword to check if a certain control exists on the AUT. Finally, use 'Close browser' keyword to close the browser. You can disable a step to exclude it from the execution. Let's save this test case and execute it.
Hi, this is a Katalon team and welcome to our tutorial. For this video, we're going to show you how to create test cases using script mode. Let's get started! There are two ways to create test script in script mode. First, you can write the script from scratch using script mode in Katalon Studio. The other option is you modify existing test cases that you create using manual mode.
Now, I'm going to show you how to create a test case from scratch. First, capture the web element. Next, creating script. In this video, I'm going to utilize the web UI keyword available in Katalon Studio. Then, you run your test. I'm gonna also show you some alternatives for some other test cases.
Now that you know the step, I will create a test case testing the login to make an appointment flow in a web application for you to see. This is my new test case that I just created. See, our tab is still blank. To build a test case in script mode, first you need to gather all the elements from the page that you want to test. Navigate to the top bar. Click on the 'Spy Web' element and this tab will pop up.
My project URL is already in there. But you can input yours if that's what you need. Click on the browser logo and the element capturing process starts now. On the browser tab that just popped up, you will see your project with each element surrounded by a red border. You click on the object that you want in your test and it will appear on the tab of your right.
Now that I'm done with my testing on this page and I want to move on to the next page, I'll input my username and password to continue. Here, I want to use the 'make appointment' element so I'll click on that as well. Now that's all of my elements appear on this right tab, let me go through what you're seeing here.
You can change the object name here or the method to save your object in Katalon Studio here. This box shows you all the specific ways that Katalon Studio saves your project. On a side note, if you're using the Katalon Studio Enterprise version, this is where the self-healing mechanism gets all the pre-configured locators when enabled by default. And this box allows you to modify the initial address that Katalon used to locate an object. 'Veriy and highlight' lets you verify each object you capture by highlighting the chosen object in red. 'Add screenshot' lets you incorporate Katalon image-based testing into the capturing process which I'll show you in some other tutorials.
Now, let me modify my objects a bit and save my objects into the repository. Now that you have your objects ready, let's create a script. Since Katalon Studio has an extensive web UI built-in keyword, I'm going to utilize just that. Now, the first thing you need to do is to open the browser and navigate to the system under test.
Type the 'webUI' to access the web UI keyword. After you enter the dot, this content assist tab will appear. Content assists provide users with a context-sensitive suggestion for code completion. You can see all of the built-in keywords for web UI testing on display here. When you select a keyword, they will have a description display along for your reference. Now, let me create a test script. Pay attention or don't worry if you don't. You can look at the subtitle next to each step.
Let me explain something here real quick. At this step., what if you want to put in password in a secure way or encrypt it? So, let's select 'encryptedText' instead of just 'setText'. Drag and drop the object that we're going to interact with here and then navigate to the top bar. Select 'Help', choose 'Encrypt Text' and Katalon will do the encryption for you. Then all you gotta do is a simple copy and paste. Okay, let's keep going.
Before running your test, there is one extra step that I want to show you. Let imagine that your tests fail at some point before the 'closeBrowser' command and therefore cannot close the browser because it cannot reach there. So what if you still want to close your browser? This is where you use the 'TearDown' command. The 'TearDown' command can be used either as a post-test action or an IF statement in the test. Here, I'm using it as an IF statement to make that even if on failure, it will still close the browser.
And congratulations! You've just created your test case using script mode. A side note before we run is that Katalon Studio automatically translates all of your script-mode test cases into a manual-mode test case. Here, really convenient, right? Now, all you need to do is navigate to the toolbar, choose your favorite browser to run the test in, and then sit back, relax, and lets Katalon do the hard work for you.
Notice at the bottom bar if everything is green or there is no red line, your test case is success. Now what if you want to check if your SUT denies login when users entered the wrong username? So here, I'm going to have Katalon enter the wrong username. Therefore, I'm going to change the keyword here to 'verifyElementNotPresent' as an alert to Katalon that the make appointment object is not going to appear after I click on the login browser.
Now let's run the test case again to see what happened. Supposedly this test case will still have to pass if you do it right. And there you go another successful test case in script mode. This concludes the first way that you can utilize the script mode. There is another way to use script mode that is you starting from an existing script in menu mode.
Here is a basic login test case in menu mode. Now you can switch to the script view using the bar at the footer of the test case editor. Here you can see the test case specified in manual view is translated into a Groovy script in script mode. You can continue to modify this test case using all the stuff that I've shown you just then. And that's the end of our video.
Hi, this is the Katalon team and welcome back to our tutorial. Today we're going to show you all about test suite along with all the features that come with testing test suites. More specifically, I'll show you how to create and run three types of test suites, including basic test suite, test suite collection, and dynamic test suite. Let's get started!
To create a basic test suite, first, you need to have your test cases ready. If you want to learn how to create test cases, you can watch our other tutorials on how to create test cases using manual mode and script mode. We'll leave you the link down below. Since I already have my test cases now, I'm going to create a basic test suite. Right-click on the 'Test Suite' and you see this banner appears. Give your test suite a name and there you go you have your first basic test suite.
Now, let's add the test cases into our new test suite. There are two ways to add the test cases. The first way is to drag and drop the test cases into the test suite. The second way is using the test suite editor to manually select and add the test cases.
Now that you add all of your test cases, you also have the option to select which test cases to run here. The boxes are checked by default. So when running, remember to check or uncheck the boxes when needed. Above we have an 'Execution information' bar where you can adjust some settings for your test suites. Here you can select implicit timeout which is a timeout period that Katalon waits for a page to be loaded. This default can be set by going to the top bar, select 'Project' and 'Setting'. In this pop-up board, select 'Execution' and you can either set default browser for execution, default timeout, and post-execution action.
You also have the option to choose 'User define' to personalize your own timeout from one specific project and the time is going to be in seconds. For this project, I'll use default. Next, you can configure when and how many times Katalon retries an execution of a test suite until the test suite passes successfully. Finally, you can add a list of recipients who will receive the execution report via email once the test suite finishes its execution.
Now that you set up everything, let's run this test suite. Hit the play button, select a browser to run your tests on, and Katalon will do the rest. After running, notice this bottom bar, a green button means that the test case is passed while the red button indicates a failed test case. You can also look at this bar here to see the status of your whole test suite. In this demo, there's one failed test case. Here you can see the fault comment which should give you the direction to fix your test case.
Now that you know how to run one test suite, what do you do when you want to run multiple test suites at the same time? That's when you would want to create a test suite collection. The way to add test suites into the test suite collection is the same as adding the test cases into the test suite. Drag and drop or manually add. In the test suite collection, you can add a test suite into the test suite collection multiple times.
For the execution, you can choose to run the test suites either sequentially, meaning the test suites will be executed one after another, or you can run it parallel, meaning the test suites in the collection will be executed all at the same time. Here, Katalon also lets users have a lot of flexibility in executing the test suites.
First, you can run the test suites in the same collection but in different browsers. In this demo, I'll choose to run one of my test suites on Firefox, and the other ones on Chrome. Second, you can run the test suites in the same collection but using different profiles or different testing environments. To create a profile, go to the box on your left, select 'Profile', name it, and then you got a profile. I'll replace my profile here and we have a test suite collection. Navigate to the execution button, hit it and we're at testing. And there you go, another test project completed.
Now, I'm going to show you how to create a dynamic test suite. Dynamic test suite is a test suite where the test cases are added via a search query through a special plugin. In case there is no installed plugin, the query provider is set to no query provider available by default and Katalon Studio will instruct you to install the right plugin.
Now, I'll show you how to create a dynamic test suite with the plugin. In this tutorial, let's say, I have two types of test cases. One with a tag of regression and one without that tag of regression. If I want to create a test suite containing all the test cases that have the regression tag, I'll go to query builder, type 'regression' into the test suite, click 'OK' and Katalon will create a test suite matching my requirement. Now, all you need to do is run your test suite just like how you run your basic test suite.
Before we end this video, I'm going to show you how to integrate script mode to personalize your test suite. Switch to script mode and you can see that you can personalize what happens before, which is a setup keyword here, and after, which is the 'TearDown' keyword here. The same is also applied for each test case in the test suite using the web UI keywords that I mentioned in the script mode tutorial.
You can insert some personalized steps into your execution. After inserting the keyword, remember to change the skipped comment here from true to false, because by default Katalan Studio is skipping the step as there are no codes. Now let's run the test suite again to see the commands in action. And that successful test suite concludes our tutorial.
Creating dynamic test suite video is too fast, more detailed version would be better.
This was a good review of the prior courses
knowledgeable sessions for Katalon Studio
The course is simple and clear.