10-12-2009, 08:55 PM
Hi Guys,
Me too encountered the same problem . I think its a bug in QTP, I am not sure .If any one have any solution please put it through.
I was trying to automate the Flight example. I that my requirement was to login to the system once with a user name and do ticket add for 10 customers. I tried to parametrize the 10 user names from data table for the second action which would add n number of users given in data table. But unfortunately as the friend had suggested above . The whole login operation itself was running for 10 times even though after logging once it was doing the customer add for 10 times.
Finally since i didn have any other options, I had to use a small for loop .
Am pasting that code here. Please provide if there is any other ideas.
Even if u run the below given code with the data out putting i have given to data table, it will end up with the same issue. If u jus remove the data out putting to table then it will work fine jus once .
Me too encountered the same problem . I think its a bug in QTP, I am not sure .If any one have any solution please put it through.
I was trying to automate the Flight example. I that my requirement was to login to the system once with a user name and do ticket add for 10 customers. I tried to parametrize the 10 user names from data table for the second action which would add n number of users given in data table. But unfortunately as the friend had suggested above . The whole login operation itself was running for 10 times even though after logging once it was doing the customer add for 10 times.
Finally since i didn have any other options, I had to use a small for loop .
Am pasting that code here. Please provide if there is any other ideas.
Even if u run the below given code with the data out putting i have given to data table, it will end up with the same issue. If u jus remove the data out putting to table then it will work fine jus once .
Code:
SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\HP\QuickTest Professional\samples\flight\app\","open"
Dialog("Login").WinEdit("Agent Name:").Set "mwerkjihk"
Dialog("Login").WinEdit("Agent Name:").Type micTab
Dialog("Login").WinEdit("Password:").SetSecure "4a8a4c587df483cf3803c90679eca512f092ec93"
Dialog("Login").WinEdit("Password:").Type micTab
Dialog("Login").WinButton("OK").Type micReturn
Window("Flight Reservation").ActiveX("MaskEdBox").Type "121212"
Window("Flight Reservation").WinComboBox("Fly From:").Select "London"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Frankfurt"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "FIRST"
DataTable.SetCurrentRow(1)
Datatable.Value("new",dtGlobalSheet)= "FIRST"
Window("Flight Reservation").WinButton("Insert Order").Click
Dim i
Dim Uname(10)
Uname(1) ="jijo"
Uname(2) ="Femmy "
Uname(3) ="martry"
Uname(4) ="steffy"
Uname(5) ="Maria"
Uname(6) ="Juney"
Uname(7) ="Julian"
Uname(8) ="Augustin"
Uname(9) ="Stephen"
Uname(10) ="Octopus"
For i= 1 to 10
Window("Flight Reservation").WinMenu("Menu").Select "File;New Order"
Window("Flight Reservation").ActiveX("MaskEdBox").Type "121312"
Window("Flight Reservation").WinComboBox("Fly From:").Select "London"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Los Angeles"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set(Uname(i))
DataTable.SetCurrentRow(i+1)
Datatable.Value("new",dtGlobalSheet) = Uname(i)
Window("Flight Reservation").WinButton("Insert Order").Click
Next
Window("Flight Reservation").WinMenu("Menu").Select "File;New Order"
Window("Flight Reservation").ActiveX("MaskEdBox").Type "121412"
Window("Flight Reservation").WinComboBox("Fly From:").Select "London"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Denver"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "Last try"
Window("Flight Reservation").WinButton("Insert Order").Click
Window("Flight Reservation").Close