Writing and maintaining test scripts are two important tasks directly affecting the effectiveness and efficiency of test automation. One dilemma in test automation is that if scripts are quickly generated using tools, they may not be executable or playable when the application under test (AUT) changes. This is exactly 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 that makes benefits of test automation unattainable.
To help address this problem, Katalon introduced the new recording 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 for experienced engineers.
Katalon’s new recording is designed to generate effective, efficient, and maintainable tests that can be collaborated among team members. With this enhancement, the recording becomes an essential part of Katalon Studio.
2. Why is advanced recording needed?
Record & Playback is incredibly useful for beginners to start within their automation career as it helps generate and execute automation test easily and quickly. However, this approach has several major drawbacks when it comes to using in professional contexts, including :
The recording capability depends heavily on a capture engine such as Selenium Webdriver which does not fully address the complexity of modern user interfaces. The generated test scripts may not be playable and fragile to changes in the AUT. For example, modern UI framework such as AngularJS has dynamically generated ID for HTML components. Therefore, scripts created by ID locator approach which is popular in recording will be more likely not playable under a small interface change.
Test cases generated from 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 encourages automation engineer to leverage existing scripts.
In automation testing, maintainability is always the main concern in any long-term projects as 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
3. Recording in Katalon Studio 5.5
Fortunately, Katalon’s Advanced Recording offers an answer to address the dilemma in generating tests quickly while ensuring them to be maintained easily. With Advanced Recording, automation engineers are able to enjoy fast test generation while still being able to maintain and reuse test cases easily. Furthermore, in a team with diversified skill sets, it’s essential to allow team members to collaborate effectively in creating test cases. With Advanced Recording, this goal can be achieved.
In Katalon Studio 5.5, the recording capability has been improved with the spirit of Advanced Recording: efficiency, effectiveness, maintainability, and collaborativeness.
Continue to record from an existing test case
Users are now able 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 Record, a prompt will be shown to confirm if they want to record for the test case.
Test steps and corresponding dependencies of the selected test case are loaded to the recording window as shown below.
Be able to fully edit the test case while recording
During recording, most test step types can be added. The Variables section is available for editing. Test objects in the object repository can also be customized throughout the recording process and are synched with the objects in the test steps.
Be able to execute specific steps while recording. Multiple options for executing test steps such as Run All Steps, Run Selected Steps or Run From a Selected Step are available. Logs and execution status are also tracked properly.
Merge duplicate test objects after recording
After recording, 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 provides the following benefits:
- The capability to run selected test steps during recording helps users to assure that all recorded steps are playable. It’s very useful when dealing with long and complex test cases. If a test case is solid from the beginning, maintenance effort can be reduced significantly. Moreover, the run feature during recording also opens the capability to add advanced test steps such as custom keywords or call test cases. For instance, when an automation engineer is recording a new test case, and she or he knows there is a common test case which can be used as part of the new one. Instead of recording those steps again, the engineer can add that test case in then execute it to go through its steps as if they were recorded. This helps encourage automation engineers to reuse the existing tests which eventually improves the effectiveness of the whole project.
- The new recording capability unites three previously separated functions including spying, recording, and executing. Without this integration, it is time-consuming to fix 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 are able to easily reproduce issues then fix them and verify the fix immediately. All of those debug and fix operations are taken efficiently on just one screen.
- In automation testing, besides test cases, test objects should be taken seriously. Merging test objects is important to improve the consistency and maintainability of test artifacts.
- Collaboration is a crucial 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 definitely prefer the easy and quick manner of recording approach. Meanwhile, the experts in the team are normally in charge of building the framework and prepare common materials. Therefore, in Katalon Studio, advanced features are gradually introduced into the test generation process to better leverage existing test materials.
It’s just the beginning…
Katalon Studio continues improving its features to be the best that a test automation solution can offer. More features are under development to be released in the near future. Below are some:
- Smart object locator strategies: Object locator strategies are often 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 that are more maintainable and resilient to changes in the AUT. This feature is expected to reduce maintenance cost significantly.
- Object Type: As mentioned above, test objects are treated as an important asset of automation projects in Katalon Studio. A future release will include Object Types with behaviors and semantics. This feature can help users group a set of common or repetitive actions to a single item then use it in multiple places; therefore, it is expected to improve reusability and maintainability of test assets considerably. For example, in order 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 then select the appropriate item. Those steps are normally fragile due to the nature of the recording engine, looks not so meaningful to readers and also not highly reusable as well. With Object Type, they can be grouped into one unique step like set combobox value with one input so-called combobox test object. It will look much more meaningful, be more robustness and much easier to be reused.