Feroz
8 years agoOccasional Contributor
How to generate a random number (Ex: 4 digit) and use it in my keyword tests,
Hi All,
I have a scenario where i need to use a random 4 digit number in my keyword tests. I tried below code snippet in my scripts but no luck. Could you please help me in this.
Code Used:
function randomWholeNum()
{
var st1 = Math.floor(Math.random() * 20);
return st1;
//Log.Message(st1);
}
Expected:
random number..... but it is not returning any value
I want to return a value. So, that i can use 'Last Operation Result' method (In the Set variable method) and use it in my Keyword tests.
Thanks in Advance.
Regards,
Feroz