Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problems with iterations on data tables
#3
Not Solved
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 .

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
Reply


Messages In This Thread
RE: problems with iterations on data tables - by rakeshmick - 10-12-2009, 08:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problems with Text color recognition Treirk 0 1,113 06-17-2019, 12:19 PM
Last Post: Treirk
  Repeat iterations Until New Value Is Seen in Column1 shayk1985 1 1,746 07-05-2018, 05:52 PM
Last Post: Ankur
  UFT Datatable iterations Studymode 2 3,799 12-12-2017, 11:10 PM
Last Post: Studymode
  QTP-Re-executing script after completion of all iterations JwalantBhatt0602 1 2,696 03-24-2016, 12:37 AM
Last Post: JwalantBhatt0602
Question QTP not performing iterations based on local data sheet Breaker 18 56,763 01-25-2016, 04:32 PM
Last Post: arunshuklainbox

Forum Jump:


Users browsing this thread: 1 Guest(s)