# WebUI Test Object - Best Practice

**URL:** <https://forum.katalon.com/t/webui-test-object-best-practice/67553>\
**Category:** Miscellaneous\
**Tags:** start-page\
**Created:** [August 2, 2022, 12:31pm UTC](https://forum.katalon.com/t/webui-test-object-best-practice/67553 "2022-08-02T12:31:06Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [August 3, 2022, 2:39pm UTC](https://forum.katalon.com/t/webui-test-object-best-practice/67553/15 "2022-08-03T14:39:05Z")

</div>

I wrote:

> [@kazurayam](#):
>
> Katalon Studio offers no help to find duplicating Test Objects. You need to find them by your deep thinking or developing tools for yourself.

I would give you a starter for developping tools for you. See the following GitHub project.

> **[GitHub - kazurayam/ObjectRepositoryRetriever](https://github.com/kazurayam/ObjectRepositoryRetriever)**
>
> Contribute to kazurayam/ObjectRepositoryRetriever development by creating an account on GitHub.

My `com.kazurayam.ks.ObjectRepositoryRetriever` class reads the XML config files in the `Object Repository` folder and returns a `List<TestObject>`. My demo test case converts each TestObject instance into JSON text and prints them like this:

```auto
2022-08-03 23:26:39.893 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2022-08-03 23:26:39.897 INFO c.k.katalon.core.main.TestCaseExecutor - START Test Cases/testObjectRepositoryRetriever
2022-08-03 23:26:40.616 DEBUG testcase.testObjectRepositoryRetriever - 1: projectDir = Paths.get(getProjectDir())
2022-08-03 23:26:40.636 DEBUG testcase.testObjectRepositoryRetriever - 2: testObjects = ObjectRepositoryRetriever.readTestObjectFiles(projectDir)
2022-08-03 23:26:42.483 DEBUG testcase.testObjectRepositoryRetriever - 3: assert testObjects.size() > 0
2022-08-03 23:26:42.487 DEBUG testcase.testObjectRepositoryRetriever - 4: println(testObjects.size())
19
2022-08-03 23:26:42.495 DEBUG testcase.testObjectRepositoryRetriever - 5: testObjects.forEach({ java.lang.Object to -> ... })
null
{
  "isParentObjectShadowRoot": false,
  "properties": [
    {
      "name": "id",
      "condition": "EQUALS",
      "value": "comment",
      "isActive": true
    }
  ],
  "xpaths": [],
  "objectId": "Page_AppointmentConfirmation/lbl_Comment",
  "useRelativeImagePath": false,
  "selectorMethod": "BASIC",
  "selectorCollection": {}
}
{
  "isParentObjectShadowRoot": false,
  "properties": [
    {
      "name": "id",
      "condition": "EQUALS",
      "value": "facility",
      "isActive": true
    }
  ],
  "xpaths": [],
  "objectId": "Page_AppointmentConfirmation/lbl_Facility",
  "useRelativeImagePath": false,
  "selectorMethod": "BASIC",
  "selectorCollection": {}
}
...

```

You would want to extend my sample code so that it helps you finding duplicating TestObjects.  
How to do that? …well, I do not know. It is your homework.

---

_[View the full topic](https://forum.katalon.com/t/webui-test-object-best-practice/67553)._
