Hi,
Since Katalon performs all the UI validations based on the TEST OBJECT(which is defined in Object Repository) , is it possible to Create new TEST Object during runtime ? If possible kindly share your inputs ?
As we can see, there’s way to modify existing TEST OBJECT from object repository folder using WebUI.modifyObjectProperty. Am looking for a way to create test objects during runtime.
/**
* Construct a Katalon-compatible TestObject in memory.
* @param css (String) The CSS selector used to find the target element.
* @return (TestObject) The constructed TestObject.
*/
static TestObject makeTO(String css) {
TestObject to = new TestObject()
to.addProperty("css", ConditionType.EQUALS, css)
return to
}
As per your code, it will just add property to existing Object from object repository.
No, it specifically creates a new TestObject, in memory and adds a css property to it.
Is there a way to insert new TEST object into Object Repository during runtime ?
No, I don’t think so. And, if you think about it, it’s probably not a very good idea: imagine the amount of one-off TOs you might end up with in your repository.
Personally, I agree with Russ on this issue. If the TestObject can be created physically, any mistake from the test script will destroy the project with hundreds of unexpected objects.
I would like to know one thing on Objects identification side.
I have added one object to repository once and after few days, developer changed DOM structure(lets assume) then, will katalon studio repository will automatically create new xpath and continue my test or it will fail due to object issue.
What I would like to know is , will Katalon create multiple xpaths for one HTML clode and store in repository or only one
Katalon generates multiple XPaths for you. If you take a look at any Test Object in the Object Repository and switch to XPath tab you would see multiple locators there. However only one locator (the Selected Locator) will be chosen to locate the element at run-time.
For an auto healing effect (trying multiple locators when the selected locator) fails, please consider subscribe to a KSE license.
Thanks for your quick reply. Soon we are going to buy the full version…
Can Katalon iterate and select the locator which is working during run time ?
For first run one locator is selected and locator is worked fine
For second run(same tc) selected locator is not working as dom is changed.
So now, will katalon iterate the rest of the locators(xpaths lets assume) and verify if they are working or not.
Or do we need to manually change the xpaths in the selected area of object repository as we can see
The Auto Healing plugin which is available in the Enterprise version enables test execution to continue by attempting to find a working locators from the set of locators in a Test Object. I think it is what you’re looking for.