Hi @roopali.phapale,
I am one user of Katalon, hope I did understand your full context. I guess that your situation is to reduce effort to create Test Object because sometime, we can create one Test Object and use for different Objects in the Web Sites
Imaging that we have the page like below screenshot:
Normally, We need to verify GUI, we create 3 Test Objects (3 buttons in the screenshot) then verify them existing in the script.
For this case, we can create one object only, then passing object name to verify it. Below is the steps
- Create one Test Object
- Identify the xpath rules of related Test Objects. In the screenshot, 3 buttons just different about the text
xpath: //a[normalize-space(.) = ‘Make Appointment Tomorrow’]
Other buttons have the same structure, just change the text
So, we define a template of xpath which button’s text is stored in one variable
//a[normalize-space(.) = ‘${buttonName}’]
In your test script, just provide the value of the button name via the variable, example:
lstButtons = [‘Make Appointment Tomorrow’, ‘Make Appointment’, ‘Make Appointment Yesterday’]
lstButtons.each{
WebUI.verifyElementPresent(findTestObject(“Object Repository/New Test Object”, [“buttonName”: it), 30, FailureHandling.CONTINUE_ON_FAILURE)
}
Note: buttonName is the variable you defined in Test Object
With this approach, if your real Object need 2-3 or more variables, using the same ways
Hope it is useful
FYI.