Capturing naming conventions while using Web Recorder on Katalon Studio

Hello Katalon Developers,

I have little knowledge of programming and recently I was searching for testing applications/tools that can be utilized for automations but require minimal coding. I found out about Katalon and decided to try out its trial version.

With the help of my developer friends, I have a question while testing with Katalon Studios;

Issue: Capturing naming conventions while using Web Recorder on Katalon Studio.

I have a page that requires me to fill in multiple fields; these fields are programmed to use nested naming conventions. (eg: event.name, event.venue, event.description)

After recording with Web Recorder, the recorder only captured the top/first field for the rest of the nested fields. It seems that it is unable to specifically recognise the field names completely. Thus, when running playback, it only enters the inputs into the first/top field eg: input_Event Name_… (see screenshot)

image

Kindly assist me on how to go about to tackle this issue as most of my applications are using similar nested naming conventions. I figured there’s a manual workaround for this, however it would not meet with my objective to automate the testing process and be efficient.

Thank you for your attention to the issues mentioned above. I kindly request your input and suggestions. Your expertise and insights would be highly appreciated.

I look forward to receiving your response and working together towards finding suitable solutions.ed there’s a manual workaround for this, however it would not meet with my objective to automate the testing process and be efficient.

Thank you for your attention to the issues mentioned above. I kindly request your input and suggestions. Your expertise and insights would be highly appreciated.

I look forward to receiving your response and working together towards finding suitable solutions.

1 Like

Hi,

Welcome to Katalon Community. I think you better learn how to use GlobalVar and apply it in this case.

2 Likes

You are supposed to be in control even with the tool helping you.

As an example, you can change the name that the Spy creates. Make sure you change the name either as the Spy gets the element before you Save to the Object Repository or in the OR. Don’t change the element’s name in the code pane; either Manual or Script. When you change the element’s name in the Object Repository, every instance of the element’s code usage changes as well, so the code is in sync. As a suggestion, I would change “button_1” to something more descriptive if you plan on coming back to this test at a later date. We use a naming convention based on the nearest label or what is on the button if there is no label nearby. Similar goes for your other elements. Just a suggestion, but if you want to be able to use the elements again, knowing to what label they are associated with helps.

On another topic, I notice that you are using the default on some of your commands, like selectOptionByValue(). First, there are selectOptionByValue, selectOptionByLabel and selectOptionByIndex. The selectOptionByValue is using the value attribute found in the HTML. The selectOptionByLabel uses the reference you can see in the drop-down. Just so you know.

The other point is on selectOptionByValue() command in your code above. I notice you are using the last boolean, which is for RegEx (Regular Expression), you are leaving as true. This means that you want to use RegEx. RegEx is like using wildcard comparison; on 28 and on 2. Where is the wildcard in those? Change the boolean to false for this command until you actually need wildcard comparison (and how to use RegEx).

2 Likes

One other topic I thought you should know is to delete your Temp directory contents every-so-often. You can find where KS puts your temporary testing information at:

C:\Users\<your user name>\AppData\Local\Temp\<some number here>

As an example, I just deleted 1.5 Ggs of temporary testing files from my temp folder this morning and I delete the folder contents every month.

Edit: Once Windows Explorer moves to the Temp folder, use CFRL+A to select all files and folders, then SHIFT+DEL to clean up all temp items.

Could you please share the HTML source where these 3 elements are written?

What do you mean by “capturing naming convention”? I do not see what you want.

Do you want the Katalon Studio’s Web Recording tool to generate names of Test Objects in accordance with the naming convestions in your mind?