Writing and maintaining test scripts are two essential tasks directly affecting the effectiveness and efficiency of test automation. One confusion in test automation is that if scripts generate quickly using tools, they may not be executable or playable when the application under test (AUT) changes. It is precisely the problem with the recording capability offered in many existing test automation tools. The cost of maintaining test cases and scripts generated by recording is too high. Which, in turn, makes the benefits of test automation unattainable. To address this problem, the introduction of Katalon recording happened that enabled capabilities with several key benefits to help automation engineers improve their working processes and the quality of tests. This advanced recording is the feature not only useful for test automation beginners but also experienced engineers.
The design of Katalon’s new recording generates effective, efficient, and maintainable tests that can collaborate amongst the team members. With this enhancement, the recording becomes an essential part of Katalon Studio Native Windows Recorder (https://docs.katalon.com/katalon-studio/docs/windows-native-record.html)
UPDATED: Starting from Katalon Studio version 7.0, with the new Web Recorder, users can productively modify an existing test case or while recording. Instead of creating a brand new test case whenever there are changes to the UI, risks of overlooking how new changes might affect existing features minimize. Additionally, the latest version 7.5, comes with a new generation. This feature offers a seamless recording experience enhanced from the previous Web Recorder.
In this article, we will be covering the below main topics:
- Why is the advanced recording needed?
- Recording in Katalon Studio
- Continue to record from an existing test case.
- Be able to edit the test case while recording fully.
- Merge duplicate test objects after recording.
- Benefits of new recording
Why is the advanced recording needed?
Record & Playback is extremely useful for beginners to start within their automation career as it helps generate and execute automation tests easily and quickly. However, this approach has several significant drawbacks when it comes to using in professional contexts, including :
- Robustness – The recording capability depends largely on a capture engine. For example, Selenium Webdriver does not adequately address the complexity of modern user interfaces. The generated test scripts might not be playable and fragile to changes in the AUT. For example, modern UI frameworks such as AngularJS have dynamically generated ID for HTML components. Therefore, scripts created by the ID locator approach, which is popular in the recording, will be more likely not playable under a small interface change.
- Reusability – Test cases generated from the recording are linear, and they are difficult to be reused across test cases and suites. Moreover, the recording process is usually not designed in such a way that it encourages automation engineers to leverage existing scripts.
- Maintainability – In automation testing, maintainability is always the primary concern in any long-term project. The reason being the maintenance cost of test scripts can be enormous if the AUT is changing.
Learn basic “Record & Playback” using Katalon Studio here: Creating test case using Record & Playback (https://www.katalon.com/resources-center/tutorials/create-test-case-using-record-playback/)
Recording in Katalon Studio
Fortunately, Katalon’s Advanced Recording offers an answer to address the dilemma in generating tests quickly while ensuring them to be maintained efficiently. With Advanced Recording, automation engineers can enjoy fast test generation while still being able to manage and reuse test cases easily. Furthermore, in a team with diversified skill sets, it’s imperative to allow team members to collaborate effectively in creating test cases. With Advanced Recording, this goal is achievable.
In Katalon Studio 5.5, there is an improvement in the recording capability with the spirit of Advanced Recording. That is to say, the inclusion of efficiency, effectiveness, maintainability, and collaborativeness.
Continue to record from an existing test case.
Users are now enabled to load all steps of a test case to the recording window for continuing to record and generate new test steps for the test case. As shown in the figure below, when users select a test case and click on the Record icon to open Web Recorder, a prompt will confirm if they want to record for the test case.
Note: All existing test steps will import as Recorded Actions, and current Test Case variables will import into the Variables tab in Web Recorder. You won’t need to re-record the same test flow.
Be able to edit the test case while recording fully.
During recording, most test step types can add. The Variables section is available for editing. Test objects in the object repository can also be customized throughout the recording process and synch with the objects in the test steps.
Unlike the previous Web Recorder’s version, the list of available actions is the same as Katalon Studio’s built-in keywords (https://docs.katalon.com/display/KD/Built-in+Keywords). You can add any action, call another test case, and use Custom Keywords.
Be able to execute specific steps while recording. Various options for executing test steps such as Run All Steps, Run Selected Steps, or Run From a Selected Step are available. Tracking of Logs and execution status also happens properly.
Note: You need a Katalon Studio Enterprise license (https://docs.katalon.com/katalon-studio/docs/execute-a-test-case-or-a-test-suite.html#debug-a-test-case) to use this debugging feature in Katalon version 7.1+.
Merge duplicate test objects after recording
After recording finishes, there’s a default option to merge recorded test objects with the existing ones if their names match.
Benefits of the new recording
With the above functionalities, the new recording delivers the following benefits:
- The capability to run selected test steps during recording helps users to ensure that all recorded steps are playable. It’s instrumental when dealing with long and complex test cases. If a test case is solid from the beginning, maintenance effort can reduce significantly. Moreover, the run feature during recording also opens the ability to add advanced test steps such as custom keywords or call test cases. For example, when an automation engineer is recording a new test case. Or one knows that there is a standard test case that can be a part of the new one. Instead of re-recording those steps, the engineer can add that test case. After that, it can execute it to go through its steps as if they got recorded. It helps encourage automation engineers to reuse the existing tests, which eventually improves the effectiveness of the whole project.
- The new recording capability combines three previously separated functions, including spying, recording, and executing. Without this integration, it is time-consuming to correct the failed captured test objects in test cases. Also, with the new function to load the existing test steps of a test case to the recording mode, users can quickly reproduce issues, then fix them and verify the fix immediately. All of those debug and fix operations are taken efficiently and effectively on just one screen.
- In automation testing, besides test cases, one should take test objects seriously. Merging test objects is essential to improve the consistency and maintainability of test artifacts.
- Collaboration is a vital focus of Advanced Recording as in a development team nowadays; not all testers are automation experts. Most of them might be manual testers or have less than one year of test automation who prefer the easy and quick manner of recording approach. Meanwhile, the experts in the team are generally in charge of building the framework and prepare common materials. Therefore, in Katalon Studio, advanced features slowly introduce into the test generation process to better leverage existing test materials.
It’s just the beginning.
Katalon Studio improves its features continuously, to be the best that a test automation solution can offer. More features are under development will release shortly. Below are some:
- Smart object locator strategies: Object locator strategies are generally a black box in Selenium-based products, of which Katalon Studio is not an exception. However, going beyond Selenium-based object locator strategies, Katalon Studio will introduce smart object locator strategies. These strategies are more maintainable and resilient to changes in the AUT. This feature reduces maintenance costs significantly.
- Object Type: As mentioned above, test objects are an essential asset of automation projects in Katalon Studio. A future release will include Object Types with behaviors and semantics. This feature can assist users group a set of common or repetitive actions to a single item. We can use it in multiple places later. Therefore, the expectation is to improve the reusability and maintainability of test assets considerably. For example, to record a searchable combobox, an automation engineer needs to go through several steps:
- focus on the search text box
- fill in the search content,
- wait for the value to appear in the dropdown list
- select the appropriate item.
Those steps usually are fragile due to the nature of the recording engine. They are not so meaningful to readers and also not highly reusable as well. With Object Type, they can group into one unique step, like set combobox value, and one input so-called combobox test object. It will look much more meaningful, be more robust, and much easier to reuse.