Question { HP, 8395 }
hey please tell me how to retriev data from excel sheet
which puts the login name and password in the application?
plz send me the code..please help me
Answer
Option explicit
Dim objExcel,objExcelSheet,row,col,i,j
Set objExcel=CreateObject("Excel.Application")
objExcel.Workbooks.Open("D:QTPdata.xlsx")
'objExcel.Application.Visible=true
Set objExcelSheet=objExcel.ActiveWorkbook.Worksheets("Sheet1")
row=objExcelSheet.UsedRange.Rows.count
col=objExcelSheet.UsedRange.Columns.count
For i= 2 to row
For j= 1 to Col
' Print objExcelSheet.cells(i,j).value
InvokeApplication"C:Program Files (x86)HPQuickTest Professionalsamplesflightappflight4a.exe"
wait 1
dialog("Login").WinEdit( "Agent Name:").Set objExcelSheet.cells(i,j).value
wait 1
J=J+1
dialog("Login").WinEdit("Password:").Set objExcelSheet.cells(i,j).value
WAIT 1
DIALOG("Login").WinButton("OK").Click
wait 1
window("Flight Reservation").Close
wait 1
Next
Next
objExcel.Workbooks.Close
objExcel.Quit
Set objExcelSheet=Nothing
Set objExcel=Nothing