01-31-2010, 08:18 PM
02-01-2010, 02:36 AM
I have This :
but it does not work
PHP Code:
Function RandomString
Dim str
Const LETTERS = "abcdefghijklmnopqrstuvwxyz0123456789"
For i = 1 to strLen
str = str & Mid( LETTERS, RandomNumber( 1, Len( LETTERS ) ), 1 )
Next
RandomString = str
DataTable.Value("rndstr", dtGlobalSheet) = str
End Function
but it does not work
02-01-2010, 10:32 AM
hey qtp_user22,
you have missed to put the parameter strLen
use this
you have missed to put the parameter strLen
use this
Code:
Function RandomString( ByVal strLen )
Dim str
Const LETTERS = "abcdefghijklmnopqrstuvwxyz0123456789"
For i = 1 to strLen
str = str & Mid( LETTERS, RandomNumber( 1, Len( LETTERS ) ), 1 )
Next
RandomString = str
DataTable.Value("rndstr", dtGlobalSheet) = str
End Function02-01-2010, 12:23 PM
Hi,
The simplest way is to use "AUT"& RandomNumber().
There is a random number generator facility provided in QTP itself. And u can very well use it.
U can give the range of numbers , like Between 1 to 10,000 and the number will be generated itself in the given range. Each time its a different number between the given range.
IT can find in the help section in the Qtp help.
Try, and let me know if u are not able to.
The simplest way is to use "AUT"& RandomNumber().
There is a random number generator facility provided in QTP itself. And u can very well use it.
U can give the range of numbers , like Between 1 to 10,000 and the number will be generated itself in the given range. Each time its a different number between the given range.
IT can find in the help section in the Qtp help.
Try, and let me know if u are not able to.
09-29-2011, 04:28 PM
Hi Friend,
hope this will help for you, try this and let me know if it not works
******************************************************
MsgBox RandomString
Function RandomString
Dim str
Const LETTERS = "abcdefghijklmnopqrstuvwxyz0123456789"
For i = 1 to len(LETTERS)
str = str & Mid( LETTERS, RandomNumber( 1, Len( LETTERS ) ), 1 )
Next
RandomString = str
DataTable.Value("rndstr", dtGlobalSheet) = str
End Function
******************************************************
Thanks & Regards,
G@veyom
hope this will help for you, try this and let me know if it not works
******************************************************
MsgBox RandomString
Function RandomString
Dim str
Const LETTERS = "abcdefghijklmnopqrstuvwxyz0123456789"
For i = 1 to len(LETTERS)
str = str & Mid( LETTERS, RandomNumber( 1, Len( LETTERS ) ), 1 )
Next
RandomString = str
DataTable.Value("rndstr", dtGlobalSheet) = str
End Function
******************************************************
Thanks & Regards,
G@veyom
