Hi,
I would like to cleanup the object repository in Katalon Studio web. Is there a way to know which objects are currently being used in the scripts? I dont want t o have to copy the object name and search it in every script,that would be too long. Thanks.
I have tried that and chose to delete all unused objects. It turned out that it deleted all my objects even the ones that were used. Is this because of the way i declare objects in the scripts? I do not use TestObject objectName = new TestObject(objectID)
Instead i declare it this way.
String = ‘object ID’
WHen I would declare an obkect like this TestObject objectName = new TestObject(objectID)
my scripts would fail. so instead i declare them this way…String = ‘object ID’
Could this be the reason why its showing all objects in the unused object list?
I do not know how the “Tools > Test Objects > Show unused Test Objects” feature is designed.
@duyluong
@ThanhTo
@devalex88
Katalon Team, please have a look at this issue.
Usually, people write test case scripts like this:
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
...
WebUI.click(findTestObject('Page_CuraHomepage/btn_MakeAppointment'))
...
I GUESS, the “Tools>Test Objects>Show unused Test Objects” scans the scripts and find the calls to findTestObject(name)
method to mark “used Test Objects”.
@mgrandillo, you wrote, your scripts call the constructors new TestObject(xxx)
. Then, I GUESS, the tool will not be able to recognise your scripts using the test objects’ constructors.
The combination of “Object Repository” and “findTestObject()” is the basic method of managing TestObjects in Katalon Studio. For some reason, you avoided the basic method and preferred calling the constructor new TestObjet(xxxx)
. Then you can not expect much support for managing TestObject instances by tools. I would suggest to you; it would be an idea to rewrite your scripts so that they use that basic “Object Repository” and “findTestObject()” method.
@kazurayam You’re right.
@mgrandillo
The Test Objects Refactoring was designed to detect invocations of findTestObject
. If you instantiate a new Test Object by calling the constructor then the object indicated by the ID will not be reflected in the Unused Objects section. This design decision was made to simplify the process for the common users.
I’ll open a ticket to improve the docs in this manner. Thank you for your report !
Please see below how I instantiate a web object. Thanks
String link = “Object Repository/Page_Stratocast portal - Cloud administrators/link”
WebUI.click(findTestObject(link))