Forum Discussion
TanyaYatskovska
10 years agoSmartBear Alumni (Retired)
Thanks for sharing such great information, Dan!
- baxatob10 years agoCommunity Hero
Great opportunity!
For python you can use this expression:
import random
var = random.choice([i for i in range(x)]) # Will return the random mumber between 0 and x- vondie10 years agoContributor
baxatob,I tried to implement your suggested Python code into a Keyword Test and I can't get it to work. Is it possible to import a library into a Keyword Test? I tried using the Run Code Snippet tool to add "import random" at the top of the script but I am getting exception errors. See screenshots for examples, if desired. I can create a script but my team has decided that the majority of our tests should be Keyword Tests, not Scripts, so they are easily debugged by everyone on the team. Thanks!
- baxatob10 years agoCommunity HeroHi Vondie,
You can create the script and then call it from your keyword test using Run Script Routine item.
Related Content
- 3 years ago
Recent Discussions
- 3 days ago
- 3 days ago
- 6 days ago