Click random link from list of objects

Hey Guys,

suppose i have following HTML

   <li><a>Test 1</a></li>
   <li><a>Test 2</a></li>
   <li><a>Test 3</a></li>
   <li><a>Test 4</a></li>
   <li><a>Test 5</a></li>
   <li><a>Test 6</a></li>
   <li><a>Test 7</a></li>
   <li><a>Test 8</a></li>
   <li><a>Test 9</a></li>

I have this “//ul/li/a” xpath to capture all anchor tag. so now i want to click any anchor tag randomly.

can i store those all anchor tag as a TestObject into array list ?

please give any solution for that.

in OR define object with xpath:

then in code simply use :

findTestObject(‘path/to/object’,[(‘IDX’): x])

where x is random number

1 Like

thanks! Andrej Podhajský