HI friends,

My Aim was to read an excel file and use the values in each colums for data
driven testing.


I have an excel file,in which the 1st clm is username (with column
heading),and 2nd column is password(1st row is heading).File attached

Below script which i used to run flight app, results in error



Subscript out of range in line"Dialog("text:=Login").WinEdit("attached
text:=Agent Name:").Set myField(1)". "

Please help me to find out the error in my code,

Thanks in advance



Dim objFso, myFile, myLine, myField
Set objFso=CreateObject("Scripting.FileSystemObject")
Set myFile=objFso.OpenTextFile("E:\Userlist.xls",1)

Do Until myFile.AtEndOfStream
myLine=myFile.ReadLine
myField=Split(myLine,",")
SystemUtil.Run "C:\Program Files\Mercury Interactive\QuickTest
Professional\samples\flight\app\flight4a.exe"
Dialog("text:=Login").Activate
Dialog("text:=Login").WinEdit("attached text:=Agent Name:").Set myField(0)
Dialog("text:=Login").WinEdit("attached text:=Password:").Set myField(1)
wait 2
Dialog("text:=Login").WinButton("text:=OK").Click
Window("text:=Flight Reservation").Close
Loop
myFile.Close
Set objFso=Nothing

-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Attachment: Userlist.xls
Description: MS-Excel spreadsheet

Reply via email to