Stepping into Automation with Katalon
By: Jack Gittins
Tags: Software Engineering

Before touching Katalon, I had strictly been a manual QA with no programming experience. Spatial Vision had tried automation before but it never kicked off and so our QA team decided to give Katalon automation a try.

The app in development was a transactional based system which contained some repetitive steps. Our process began with automating the login page and throughout the system. We covered a high percentage of the positive scenarios possible which probably wasn’t the most efficient way but we found it really useful as we were able to overcome a number of hurdles. The experience has enabled us to see the system’s benefits for similar scenarios in the future.

Below are a few of the techniques that I have found really helpful in automating the system.

Test suite collection

This is one of the simpler features but something that I hadn’t considered before stepping in. The Katalon test family tree begins with a test case then a test suite, finishing with the test suite collection.

Katalons file structure

We have kept our test suites to be defined as a workflow and then added these to a Test suite collection to either form a full regression suite or a couple of workflows that string together to create a business scenario. We occasionally use this when manually testing to create test data where the collection would be to log in and perform transactions in the system to get data into a specific state for manual testing on newer features with our created data. The main use of the collection however is our end-to-end regression test where we put everything into a final regression test before sending into UAT. This give us a breakdown of what has passed and failed.

We have only automated through the UI in Katalon but it does have functionality to perform API testing, we decided to only do UI as our main focus was to assist in regression.

Writing to excel

Using a class for writing to excel was something I found easier than using Katalon data files workflow, as it felt more fluid to write to and read from during execution. I also like the ability to look at the values written in the file and look through our application after completion as to what has happened in the event of a failure.

The other benefit I found in using excel was the ability to use existing data that I could manually save into the excel file and use those as variables to test if a specific part of a script would work rather than having to run the whole suite.

Find by xpath

Each element on the application is associated with an xpath — this will include a long string of values which will define where an element will sit on the page. Understanding how an xpath works is particularly useful, and it was certainly a good stepping stone for myself. Xpaths can help when automating features that may not be developed yet as you can find elements with a specific text string that can be read from parent stories.

Another positive to keeping the elements location within the script, I found that it was easier to copy chunks of code that were repetitive throughout the system and alter the location method or variables. I also found it easier to maintain all the elements being held within a test case rather than sitting in the ‘Object Repository’. This method does have its downfalls whereby common elements won’t be shared across the project so maintenance does have some further overhead.

Getting code reviewed by a developer

This is a process that I really appreciate. It allowed us to have good consistency across the whole project and made sure we covered scenarios that the developers may consider a potential breaking point in the future. A real big help here was early feedback when a developer looked at my code and came up with the suggestion to name my variables the same as what they have used in the actual code of the application. I think the consistency in variables will be a huge benefit down the line when enhancements occur and these variables get changed.

Katalon analytics

I also found this really helpful when going through a test collection and finding out what has failed and if it is a high priority or not. The UI is much better here than on the Katalon desktop app for looking at the reports. It has other features which our licensing did not give us access to such as scheduling tests to run at a given time. Unfortunately this feature is currently (at the time of writing) in beta stage and looks to be adding payment for the full version.

Katalon analytics results view

As a whole Katalon has served as a great entry point for our company into the world of automation as no one in our little QA team had any extensive programming knowledge. At this point in time it is serving our needs perfectly well but as our skills grow and our requirements change a lot of the process learnt from our beginning should be able to translate into whatever direction we take.