Hello
I’m trying to write a test in which all the checkboxes inside a panel are checked and unchecked in a certain sequence. The problem is that when I save these checkboxes as testobjects every single checkbox gets the exact same tag and xpath.
Naturally the test doesn’t work since Katalon can’t discern the checkboxes because all of them have the same attributes.
I tried manually adding a different ID for each checkbox but if I do that Katalon won’t find the object.
Moreover, if I inspect the elements I can see the ID of the checkbox but Katalon can’t for some reason.
Those first two checkboxes’ ID are incomesource0 and incomesource1 respectively:
Please help. I’m so very stuck in this problem.
Any feedback is much appreciated.
@Russ_Thomas Thanks for replying. I don’t use CSS (at least I don’t think I am). Do I write #income0 in the selector editor? Not quite sure what you mean.
parametrize the test object for the selector, and build the selector in the test script using a template, groovy is smart enough to do substitustions in gstrings, e.g.
you can use below xpath::
//input[@id = ‘incomeSource0’ and @value=‘Salary’]
//input[@id = ‘incomeSource1’ and @value=‘Pension’]
However you could use the below one also, just another form
//input[@id = ‘incomeSource0’ ]
//input[@id = ‘incomeSource1’]
Hello! Thanks for replying.
So… should I replace the entire xpath in the Objext’s xPaths with //input[@id = ‘incomeSource0’ ] for example?
This is how the xpaths look right now. I’m a bit unsure as to where I need to put the value you’re mentioning
Thank you! I changed the xpath in the selector editor but it still doesn’t work for some reason.
My checkbox is located in //button-group/div/label/input/ (?) (see pasted image) but Katalon interprets it when I save the object in //button-group/div/label/i as you can si in the xpath:position value. Do i need to change all the xpaths accordingly or just the selector?