Quoting from Is there a method to create an Object in the Object Repository using Groovy
You do not necessarily create thousands of Test object in the Object Repository. You can create a TestObject ‘on the fly’ using the following example:
TestObject to = new TestObject(“dynamic”)
to.addProperty(“xpath”, ConditionType.EQUALS, XPath expression)
In the 3rd argument as XPath expression, you give a String which you can generate whatever you like by your code.
Also you can parameterize the Test Objects. That feature would help reducing your coding effort. See