Hi. Today is going to be a very quick post. Here's a great function which gives you a random number based on your provided range.
Function funRandomNumberWithinRange(intMinimumNo, intMaximumNo)
funRandomNumberWithinRange = Int(((intMaximumNo - intMinimumNo) * Rnd) + intMinimumNo)
To use this function, simply call it along with a specific range:
MsgBox fnRandomNumberWithinRange(1, 10)
This will give you a number between 1 and 10! Awesome right? Leave your questions and feedback below!
Latest posts by Admin (see all)
- SQA QTP tutorial – WebList identified as a web element and how to select an item from this list - December 9, 2015
- Automation QTP tutorial-double clicking on any object - December 4, 2015
- Software Automation QTP tutorial – 5 top reasons for using automation - November 23, 2015