Do I use random randint or random choice to random click on the list?


enter image description hereenter image description here

For the picture below, I wish to perform an automation testing which is random click on the items and save it. Is this consider as a list?

Selenium Python

Asked By: Carl Carl



Use the one that suits the format you have the elements in. If you have a list of the elements themselves, random.choice is the better option; if you only have the number of elements, you might prefer random.randint.

Answered By: Rahul