Hi

Check the following method.  You can give whatever the inputfile you want
and sheetname.  Get the values what ever you want.
Hope this helps..  You rocking..   To verify from your side comment the
flight application code, use message boxes.  You will know how it works.
If you want from the first column you just need to give value "1" instead of
"2" in kcount value.

Thanks
srinivas P
'------------------------------------------------------------------------

InpFile="c:\Userlist.xls"
SheetName = "Userlist"

Set appExcel = CreateObject("Excel.Application")

 Set objWorkBook = appExcel.Workbooks.Open (InpFile)
 Set objSheet = appExcel.Sheets(SheetName)

 mActRowCount =  objSheet.UsedRange.Rows.Count

 For kcount = 2 to mActRowCount
   mcount = kcount-2
   mColumnAValue = objSheet.Range("A"&kcount).Value
   mColumnBValue = objSheet.Range("B"&kcount).Value

 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
mColumnAValue  ' myField(0)
 Dialog("text:=Login").WinEdit("attached text:=Password:").Set
mColumnBValue    '    myField(1)
 wait 2
 Dialog("text:=Login").WinButton("text:=OK").Click
 Window("text:=Flight Reservation").Close

'Cheecking values you can use message boxes
 'msgbox mColumnAValue
 'msgbox mColumnBValue


 next

appExcel.DisplayAlerts = False
 appExcel.quit
 Set appExcel=Nothing
 Set objSheet=Nothing
 Set objWorkBook=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