Hi All,
I am learning QTP through various references. I have created a script which will creates an excel sheet, store username and password. Later same sheet is used to login to "Flight GUI". I am able to go through 1 row or valid scenario. However, I am not able to proceed further with rest of the username and password combination.
Below is code for your reference:
Please advise?
I am learning QTP through various references. I have created a script which will creates an excel sheet, store username and password. Later same sheet is used to login to "Flight GUI". I am able to go through 1 row or valid scenario. However, I am not able to proceed further with rest of the username and password combination.
Below is code for your reference:
Code:
Objopen.Application.Quit
Set Objopen=nothing
Set objExcel=CreateObject("Excel.Application")
Set objWB=objExcel.Workbooks.Open("C:\Logindetails.xlsx")
Set objWS=objExcel.ActiveWorkbook.Worksheets("Sheet1")
objExcel.Visible=true
***************** I believe I am going wrong some where from here *****************
vRows=objWS.usedrange.rows.count
Datatable.SetCurrentRow(1)
rowcount=Datatable.GetSheet("Sheet 1").GetRowCount
For i = 1 To rowcount
SystemUtil.Run "C:\Program Files\HP\Unified Functional Testing\samples\flight\app\flight4a.exe"
dialog("Login").WinEdit("Agent Name:").Set rowcount
dialog("Login").WinEdit("Password:").Set rowcount
dialog("Login").WinButton("OK").Click
If window("Flight Reservation").Exist(5) Then
msgbox "Test Passed"
window("Flight Reservation").Close
Else msgbox "Test Failed"
End If
Next
objExcel.Application.Quit
Set objWB=nothing
Set objWS=nothing
Please advise?