08-04-2010, 04:44 PM
Hi ,
I am facing a problem while creating script in QTP.
Please find below the code...
'-----------*END FUNCTION*-----------------------
Asset_Id is a column in my datasheet..
But still value of as is not getting saved in that column..donn know why..
I am doing record and play..
So please help me to solve this issue.
I am facing a problem while creating script in QTP.
Please find below the code...
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
End Function
'-----------*END FUNCTION*-----------------------
Code:
public a
a=RandomString(4) 'Put random string generated into a variable 'a'
msgbox(a)
'------------*GET VALUE OF MFG PART# FROM G.SHEET & SET PRICE OUTPUT VALUE in G.SHEET*-------------
row_cnt=datatable.getrowcount
for i=1 to row_cnt ' For each row , do following
datatable.getsheet(i) ' Read Sheet 1 i.e. Global sheet
datatable.Value("Asset_Id",1)=a
msgbox(a)
datatable.setnextrow ' Increment loop counter
Asset_Id is a column in my datasheet..
But still value of as is not getting saved in that column..donn know why..
I am doing record and play..
So please help me to solve this issue.