How to Generate random number using Randomize in QTP (between 100 and 300)?
Technology Tree: QTP - Random Number
Randomize keyword ensure the unique seed, so do not forget that in code.
Here's the example from the QTP help:
Int((upperbound - lowerbound + 1) * Rnd + lowerbound)
as Yogi mentioned, don't forget to use Randomize first. For your specific example (100-300) it would look like this:
print Int((300-100+1)*Rnd + 100)
X = RandomNumber(300,500)
One more for you. I copied it from here
Last edited by gencke; 05-08-2013 at 07:10 AM.
Patience is like bread I say.... I ran out of that yesterday.
Thanks for the reply. I was able to generate random number.