i have a bunch of elements with the same id, that only changes by a number at the end of the id, like this:
dashboard-device-name-0
dashboard-device-name-1
the xpath of the items is: id(“dashboard-device-name-0”)
// define your max ID
int maxAvailableId = 10
// in each iteration, create a new test object with _i_ ID and do whatever you want
// if your id starts from 1, change for loop definition accordingly
for(int i = 0; i <= maxAvailableId; i++) {
TestObject to = new TestObject()
to.addProperty('xpath', ConditionType.EQUALS, 'id("dashboard-device-name-' + i + '")')
WebUI.click(to) // or any other action
}
Sadly it doesn’t work for me, probabaly something i’m missing(maybe an import? i tried ctrl + space and got nothing), here is the error i get:
Test Cases/Verify Backup Status FAILED because (of) Variable ‘ConditionType’ is not defined for test case.