Katalon Studio Object Repository AND Spy

First of all, I like the tool that I installed (6.1.5) for Windows 7.
However, I have the following questions …

  1. Do we have the ability use descriptive programming (like we do in QTP) without using Object Repository?
  2. Why katalon Spy force me to start recording from scratch? Why can’t I spy the object in the middle?


Hi, and welcome to the forum.

I don’t know QTP, but Katalon supports Cucumber which is much more descriptive in nature.

Plus, you can write test code directly in Script View. I never use the Object Repository, I have my own way of creating “TestObjects”.

I don’t know, sorry. I never use the Spy/Record tools either.

I’m curious, what’s your way of creating “TestObjects” ?

Firstly, that’s a little off-topic for this thread. Secondly, the reason I put TestObjects in quotes was because I don’t actually create real test objects. (I use JavaScript to test the html elements directly.)

However, this is a way to create a TestObject without using the OR:


Please make sure you read my notes at the bottom of the page (the Katalon Team messed up the title of my post).

Hi Russ_Thomas,

Thanks for your response. I work with Subrata and we are evaluating katlon for web automation.
descriptive programming in the sense, instead of using the object repository from the tool defining the properties in script to identify the object.

Is there a way in Katlon studio where we can leverage the tool to identify the object using spy(xpath, css etc) and use it without using the object repository.

For example, katalon uses the following when a button is clicked with the object repossitory value as follows:

WebUI.click(findTestObject(findTestObject(button_Sign_in, value)

However, we were wondering if we can use directly xpath:idrelative generated from spy to click

say I want to try something like this >>>> WebUI.click(findTestObject("//form[@id=‘loginForm’]/button").

Q. Why katalon Spy force me to start recording from scratch? Why can’t I spy the object in the middle?

For example we have 10 pages how to spy an object on 7th page without navigating from the login screen.

Yes. As I said, I never use the OR.

Not quite like that, no. You can use makeTo (see link above) and modify it to use xpath if you wish.

static TestObject makeTO(String xpath) {
	TestObject to = new TestObject()
	to.addProperty("xpath", ConditionType.EQUALS, xpath)
	return to

I have no idea. I never use it. For example, when I want to click on something, I write code like this:

    jsClick("css selector here")

No TestObject, no cluttered OR, no need for a spy/recorder tool. Under the hood, jsClick uses executeJavaScript


Hope this helps.

I use the Object Repository and it works for me, I dont use the spy or the record, I always take the propety directly with F12 in the navegator and I made my object by myselft in the Object Repository, for me is easier.

1 Like

If the 7th page is directly reachable without going through login then you should be able to spy it. But I am getting what you are trying to say.

Every time you will launch Katalon Object Spy it will start a new session of browser of your choice. It won’t disturb the session you have already running. Same will happen if you execute the script.

The object Spy tool will create an object for you and it doesn’t care if you already have that object in your repository. While creating an object it will save all the information you will need to identify that object during execution. You will have option to change how Katalon with the object during execution.

I am not sure about the descriptive programming but using the Katalon way of describing the action will make the test case maintenance very easy. For example, you might be using the below object in 100 scripts in your test suites.

WebUI.click(findTestObject(findTestObject(button_Sign_in, value)

Due to some change, the xpath is now broken but with Katalon Object repository you will only need to make the fix once in button_Sign_in object and Katalon will auto-update all the references. With descriptive programming, you might need to update every test script. Katalon itself is a framework.

1 Like

The point of a Test Object reference is, there is nothing to “auto-update”. The only time you may need to update the references is if you alter the path dramatically.

Even so, I still don’t like them - mostly because the OR does not scale to large systems.

@Russ_Thomas Let me know if I am not understanding correctly but I wanted to say that

For e.g :

If I have a object “Gift_Card_Shopping_Cart_Quantity” used in Test Scripts 3 times then Updating the selector or renaming the Object everywhere in the scripts will be handled by Katalon. I won’t have to update it manually everywhere. I only need to do that once in Object Repository.


Not correct. There’s nothing to auto-update. YOU made the change in the OR Test Object, the reference (“Gift_Card_Shopping_Cart_Quantity” in your example) remains the same.

Thank you all for the responses. Actually we wanted to use something like this without OR, as it might become complicated down the road to maintain Object repository.
static TestObject makeTO(String xpath) {
TestObject to = new TestObject()
to.addProperty(“xpath”, ConditionType.EQUALS, xpath)
return to
but the problem is there might be complicated xpaths/CSS (shadow DOM objects).
How we can leverage the tool for the reliable locators. either we have to spy or record the test in order to do it.
Please correct me if my understanding is correct.

Correct. Using the Spy tool/recorder will create a large potentially unmanageable OR. It is much better to manage your TestObjects yourself, either by creating them yourself, or by using makeTO.

A knowledgeable human is much better at building robust, efficient (and therefore successful) selectors. If you use Spy, you will end up having to manage an unwieldy OR (as you’ve already discovered). My advice: Learn CSS selectors and use those to target elements in your tests.

1 Like

@sandhya.singireddy You can use another excellent tool called Choropath to generate and validate unique selectors. The Katalon Spy tool might not give accurate selector every time in terms of complex application and they are not reliable. I agree with @Russ_Thomas. In our test setup we do use Object repository but the selectors for those Objects are always edited 95% of time from what Katalon give us in 1st instance.

Thanks Russ and Manpreet. I agree the selector from katalon need to be edited.
Following way works in case someone wants to do programmatically
String xpath = ‘//*[@id=“username”]’
TestObject to = new TestObject(“objectName”)
to.addProperty(“xpath”, ConditionType.EQUALS, xpath) --whatever property you want to add
and do the operations on the webobject to

1 Like