TestProject Forum

How can I random select an item from a dropdow list but skip the first one

I’m using Action Click a random item on the list, but I don’t want to select the first one, how can I do that.

Hello @marco.xu
You can use 2 steps for that, the first step will be a Random number in a range:

In my case there are only 3 items, so I will choose to skip the first.
I take the output into the index parameter.

And the second one will be the click action with dynamic locator with index parameter (index parameter that I created in the previous step):

When I ran it, I got the number three so it would click on the third item, it would always skip the first because I chose to start my random number from 2

Thank you Kfiryo1, that’s a good idea.