Test Script (excerpt): def x = ThreadLocalRandom.current().nextInt(1, 10 + 1) WebUI.click(findTestObject('PageObject/a_Open', ['index' : x]))
Test Object Variables:
Is there possibly something else that I could be doing wrong?
If I replace XPath’s ‘[$index]’ with [1] or [6] or other integers, then it works fine. But the point is that I want to randomize ‘tbody’: not hard code values.
try to use selection mode attributes with xpath = ‘//*[@id=‘hello’]/div/table/tbody[${index}]/tr/td[4]/span/a’
i don’t know if it’s still true, but xpath selection method cannot be parameterized. (at least it was true few version back, i stopped to use selection method other then attributes back then)