Creating and Restoring Syntax Highlighting in Katalon Studio

While Katalon Studio comes with some formatting and syntax highlighting, it’s very beneficial to set up your own. The time investment will be worth it later when you can focus in on your code based on it’s color without having to read each and every line. Katalon has two areas where you can set formatting options. Both are under Preferences. The first is under General > Appearance > Colors and Fonts. This handles the main font style, color and size of the editor window. The other, related to syntax highlighting is located under: ​Java > Editor > Syntax Coloring You will then have Java, JavaDocs, and Comments. Java contains most of the options you will be interested in and you will see an example of your syntax highlighting in the Preview window. Once this is set, it’s awesome, however, when you upgrade Katalon, those formatting options will be overwritten. This is not awesome. But, it’s easily handled by making a […]

QA Regression Suite coming together

My automation project is progressing faster than I expected. I added the code to check for results, added code to count rows, and removed all the hard coded values I put in place. The QA Execution Profile is now in place with the correct data values for that environment. I even swapped some of the String values for Lists so multiple values could be checked in a single pass. I cleaned up the navigation code so the tests can either click the links they need, or they navigate to the correct location then call each other in the proper order. I have just put together the QA Regression test suite and have been testing it against the site. It contains 21 tests, chained together, that run from start to finish. With everything running together, I made a few adjustments to my data values, picked some better customers to work with, added a couple of checks to make sure objects were […]

Waiting on elements to appear using While Loops

Timing is everything. Certainly so when it comes to automation and waiting for elements to appear before moving on to the next step. While Katalon has several wait methods, including the new smart wait, there are times when you have to wait for a text change. In this case, we aren't waiting for an object, we are waiting for a condition to change. For example, we need the number of search results to increase or decrease. Or we already have a list of names, but the one we want isn't available yet. In these cases we will use the while loop to get our status and add a delay until what we are searching for is available. In the example below, we are waiting for a status change. We have previously created an item and now we need for the status to show as "Sold." When that happens, we can proceed with the next step. The first thing we need […]

Connecting Katalon Studio into XLS and CSV files

Since reading from external source files has become an important part of how we get data, I wanted to put together some simple examples to show reading data from a CSV file, an XLS file and from a Database source. All three are very similar and since Katalon handles most of the work, it's easy to grab data from a file with just a few lines of code. We start by using the TestData library and reference the "Test Data File" from the "Data Files" object in the project. That is done with: TestData csvData = findTestData("Data Files/Data Source Name") Once we have that, we can use some of the built in Katalon keywords to get the number of rows in the file and the column names. int rowCount=csvData.getRowNumbers() List columnNamesList=csvData.getColumnNames() Once we have that information we know how many rows we can read and how many columns. We then use getValue to read our piece of information. temp1=csvData.getValue(columnName, rowNumber) […]

Adding Timing Flags to Test Cases within Katalon

I've made reference to this before, but due to the success I've had using it, I wanted to bring it up again. Within my tests cases I have been adding markers to time how long it takes to complete an action. This is usually connected with the Save action or something similar. For example, how long does it takes to save the form data? Or how long does it take to move from one page to another. Using the "feature flag" idea, I place the start of the code right before there is an action to click the button. After the click action, there is a waitForElementVisible action, which waits for an email address input field to become visible. Once we can take action on it, the Save action is complete and we can record the time between those two events. if (timedTest==true){ timeStart = new Date() } WebUI.click(findTestObject('btn-Save Cart)) WebUI.waitForElementVisible(findTestObject(input-Email Address'), 90) if (timedTest==true){ timeStop = new Date() TimeDuration […]