Home > Software design >  Do I use random randint or random choice to random click on the list?
Do I use random randint or random choice to random click on the list?

Time:02-01

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

CodePudding user response:

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.

  • Related