All newly developed websites need to be tested for its functionality and stability. This task requires testers to have sufficient skills and tools to perform an automation project for a website effectively.
Katalon Studio is a free and comprehensive test automation tool for web, mobile, API, and desktop projects. It makes automated testing easy for those with minimal coding skills, yet inclusive enough to help you work on advanced projects. Katalon Studio comes in two versions: the Standard free Katalon Studio and Katalon Studio Enterprise for teams at scale.
This article will guide you through the basic steps to start testing your web in Katalon Studio.
Make sure you already downloaded Katalon Studio at www.katalon.com
How to start testing your web with Katalon Studio
Step 1. Set up a project
You can choose to create your new project either from scratch or from one of our project samples here.
Go to File > New > Project, then select your preference. Insert the project’s name, the location to store its data and description (optional).
Step 2. Create your first test case
To create a test case, right-click Test Cases > New > Test Case
Test cases in Katalon Studio can be written in pure Selenium format:
WebDriver driver = new ChromeDriver();
String baseUrl = "https://www.katalon.com/";
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.get("https://katalon-demo-cura.herokuapp.com");
driver.findElement(By.id("btn-make-appointment")).click();
driver.findElement(By.id("txt-username")).clear();
driver.findElement(By.id("txt-username")).sendKeys("John Doe");
driver.findElement(By.id("txt-password")).clear();
driver.findElement(By.id("txt-password")).sendKeys("ThisIsNotAPassword");
driver.findElement(By.id("btn-login")).click();
driver.quit();
Click Run to see how it works.
To simplify and speed up the process of writing test cases, especially in high volume, you can use Katalon Studio standard format. For example:
WebUI.openBrowser('https://katalon-demo-cura.herokuapp.com/')
WebUI.click(findTestObject('Page_CURA Healthcare Service/a_Make Appointment'))
WebUI.setText(findTestObject('Page_CURA Healthcare Service/input_Username_username'), 'John Doe')
WebUI.setEncryptedText(findTestObject('Page_CURA Healthcare Service/input_Password_password'), 'g3/DOGG74jC3Flrr3yH+3D/yKbOqqUNM')
WebUI.click(findTestObject('Page_CURA Healthcare Service/button_Login'))
Click Run to see how it works.
Next, we will go through the “ChromeDriver,” “click” and “findTestObject” methods, and how to use the “Page_CURA Healthcare Service/a_Make Appointment” argument to begin testing with Katalon Studio.
- Browser drivers: Browser drivers, i.e., ChromeDriver are abstracted away from the code and set up at the execution time so that the code is enabled for cross-browser testing.
- Click and setText: This is an example of Katalon Studio’s open-source built-in keywords library to wrap and enhance the limited set of Selenium keywords. You can also create your own set of custom keywords or import the shared custom keywords made by other users.
- Page_CURA Healthcare Service/ a_Make Appointment: are the test objects designed to follow the Page Object Model pattern. Katalon Studio supports your test objects with the “auto-healing” feature to make them sustainable, despite the continuously changing nature of the AUT. The script and objects above can be quickly generated by the Recording and Spying
Katalon Studio can be used for both manual and automated testing. It provides a dual-script interface for both manual and automated tests:
In practice, a team of testers and developers can apply these steps to their complete workflow:
- Firstly, the automation experts will prepare all the scripts needed to build test cases such as the custom keywords, test listeners, calling test cases, etc.
- Then, these prepared scripts will be transferred to the manual QAs to utilize without having to handle scripting.
- As a result, the manual QAs can gradually learn how to script and become automation scripters.
Step 3. Verification in the test case
To get the result of the login process, you need to add the verification script to the test case.
As the fundamental of scripting in Katalon Studio for the first test case has been explained, we can move on to another test case: “Make Appointment” header verification.
You can leverage Katalon Studio’s rich set of verification keywords to work on that requirement. Note that this kind of script can be done in both Manual and Script mode.
WebUI.verifyElementText(findTestObject('Object Repository/Page_CURA Healthcare Service/h2_Make Appointment'), 'Make Appointment', FailureHandling.STOP_ON_FAILURE)
You can then check the execution results in the Log Viewer. Refer to this doc of how to view execution logs.
Step 4. Debugging the test case
Try changing the verification text to “Make another Appointment.” to make the test case fail. Here are a few options of how you can check the reasons for failure in Katalon Studio:
- Option 1: Investigate error logs
- Option 2: Debug mode
For complex cases, Katalon Studio offers a debug mechanism that works similarly to the code debug mechanism in the advanced developer IDE.
- Option 3: Manual debug
It is possible to use the ‘Recording’ feature of Katalon Studio for debugging. The tool supports recording the failed test case, running the error test step for you to analyze and fix the issue directly in the recording mode.
Here’s an example:
When your test case failed, click “Yes, I do” in the window that shows up to continue recording the failed test cases.
Choose Run all steps to run the error test step. After that, you can investigate and fix the issue directly in the recording mode.
Step 5: Plan the test case in the test suite
- Right-click Test Suites > New > Test Suite
To create test cases with multiple configurations (e.g., retrying on failure, email sending or data-driven binding), use the test suite capability. The added configurations of a test suite execution can be managed by expanding the Execution Information section. See the example below:
For more details, refer to this doc.
Step 6: Execute the test suite and view the result
Select Test Suite > Run
The final step is to execute a test case in the designed test suite:
- After being successfully planned, the test suites or test suite collections can be executed not only directly in Katalon Studio, but also by the command line.
- Combining the standard JUnit format of the execution results and pre-built Docker images, these features will give you the flexibility to integrate Katalon Studio into a CI/CD pipeline with tools such as Jenkins or CircleCI.
Conclusion
This article on the basics of performing web testing on Katalon Studio should give you the key steps and concepts needed to start your project. Check out other tutorials to make sure you can fully utilize the tool and best leverage it for your test projects.
- ‹ Beginners guide to API testing with Katalon Studio
- Beginners guide to using Record and Playback in Katalon Studio ›
Add new comment