QTP random number problems

Original link: http://www.cnblogs.com/emma/archive/2010/03/03/1677190.html

We currently used random numbers are actually pseudo-random
because the computer We von Neumann Theory
must press the "laws" to operate
but is not random, "irregular" Why?
Then there is the generation of "pseudo-random" method according to the random seed
random seed is not constant repeat (time stamp is good)
and then through the "laws" arithmetic processing to produce "different" results can be obtained. " pretend "random number (according to" laws "to" different ")

Why say it this
because QTP is running on the computer, but also they can not break through the above-mentioned limits
so random seed used QTP is the impact of a major source of random numbers generated by a
learned from my test:
certainly the conclusion that QTP random seed used in some rounds and comprises using timestamps
when used with a secondary (such repeated operation, but only run once, it is equal to the first) and a close time (as in 1 within 2 minutes)
to give a random number may be the same.

So nothing particularly good solution, in fact, not to be solved: Just let the script run, it's random number is "random" the

Opening said phenomenon, we can try it yourself:

Write a script, only use a random number RandomNumber operation related to (find a place to show what a random number, such as msgbox)

Tap run, run once, write down random numbers

Immediately and then tap run, run it again, write down random numbers

Will be able to find either of the two random numbers are the same, or is just +1

Reproduced in: https: //www.cnblogs.com/emma/archive/2010/03/03/1677190.html

Guess you like

Origin blog.csdn.net/weixin_30500289/article/details/94954123