Aim: Login to the sample flight application with multiple users
Excel File:
agentName Password
user1 mercury
user2 mercury
user3 mercury
user4 mercury
QTP Code:
datatable.Import "D:\QTP\TestData\login credentials.xls"
Dim i
Dim iRow
iRow = datatable.GetRowCount
For i = 1 to iRow
systemutil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe"
Dialog("Login").WinEdit("Agent Name:").Set datatable.Value("agentName")
Dialog("Login").WinEdit("Password:").Set datatable.Value("Password")
Dialog("Login").WinButton("OK").Click
systemutil.CloseProcessByName"flight4a.exe"
datatable.SetNextRow
Next
QTP runs the script 16 times. The value of 'i' range from 1-4 and then is set back to 1. Why? Pointer should leave the for loop ideally. Can you please explain the reason?