I have a list of variables,
@{Example} = One Two Three
I want the list of variables, randomly choose an item from the list.
The simplest solution is to call python's random.choice method with the built-in Evaluate keyword. You can use robot's extended variable syntax to pass the list of choices into the function.
Here's a short example that will print a random value to stdout each time you run it:
*** Variables ***
@{Example} One Two Three
*** Test Cases ***
Example
${value}= Evaluate random.choice($example) random
log to console \nvalue: ${value}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.