Metadata for objects in Object Repository

I am recording Katalon to automate a native app for Android and iOS. My app has 6 roles and UI fields are shown / hidden on basis of roles. Whilst recording objects is quite straightforward, verifying their presence with respect to UI Screen and Role becomes quite tedious. There are approach to achieve this, but they are costly to maintain.

I was looking to store screen name and role name(s) as a metadata for the object in object repository. I custom keyword would check for the object’s presence and absence based on the scenario I am testing.

I can see there is no provision to add metadata for an object. Could you please suggest any plugin / technique through which I can add some metadata for objects?

I don’t know that I’m following your problem 100%, but focusing just on the metadata issue…

TestObjects are Groovy objects. Groovy objects can be modified, if you don’t mind accessing metaclasses. But even that isn’t ideal – there is no UI to support this, you’ll need some running code to place the metadata into the objects.

An easier (if not better) idea might be to store the metadata in a file (json, perhaps) keyed by the id you use for the test objects themselves. That way, you can store as much metadata as you want, and even produce the file from another related system.

@devalex88 Might it be possible to add a map userdata [:] to the next generation of TestObjects in a future release?

You have got the problem statement right.

I did continue with this approach. I am maintaining a json file with object and metadata mapping. This is a bit more work when you have to use a codeless automation tool for rapid test automation. It would be nice to have this facility out-of-the-box

This is the exact thing I was talking about. Have a visual editor like we have for variables where users can simply key in their metadata key,value pair. Also expose an api for this metadata access. potential use case of this metadata is while doing assertions

Many thanks for looking in my question.

Regards, Rahul

Cool. I will move this to the Suggestions forum.

Hi @jadhav.rahul898

Right now I am not sure if this would be considered for implementation. However, an idea would be to add a property to your Test Object that points to a metadata file (json file) in your project. A custom keyword then can check and read this property in a Test Object to access the associated json file.

I think once things are set up then it’d be intuitive enough to have non-programming testers maintain the test objects.

1 Like