Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problems with iterations on data tables
#1
Not Solved
What I am trying to do is import a data table, have QTP set things in the application according to what is in in the table. There are three rows in the header, not including the header row. Here are the scripts

Code:
Action 2
DataTable.Import ("C:\Documents and Settings\lbullen\Desktop\datafarpostprgpgynum.xls")

Action 1_1
Browser("wesite").Page("website_name").WebList("position_type_cd_2").Select "Residency "

Action1_2_1
Browser("browsername").Page("website_name").WebList("pgy_ind").Select DataTable("pgy_ind_value_out", dtGlobalSheet)
Browser("browsername").Page("website_name").WebList("pgm_type_cd").Select DataTable("pgm_type_cd_value_out", dtGlobalSheet)
Browser("browsername").Page("website_name").WebEdit("positions_ind").Set DataTable("positions_ind_value_out", dtGlobalSheet)
Browser("browsername").Page("website_name").WebEdit("start_dt").Set DataTable("start_dt_value_out", dtGlobalSheet)
Browser("browsername").Page("websitename").WebEdit("desc_txt").Set DataTable("desc_txt_value_out", dtGlobalSheet)
Browser("browsername").Page("website_name").Image("Save").Click 25,9

I have set under File>Setttings>Run, Run on all rows.
For action 2 and 1_1, I have set under Action Call Properties: Run one iteration only
for Action 1_2_1, run on all rows.

It runs through the first iteration then loops back and runs the first row two more times. I want it to go to the next row. What am I doing wrong?
Reply
#2
Not Solved
Hi!
Try clearing all data in Global sheet!
Or use dtLocalsheet instead of dtGlobalsheet
Reply
#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
#4
Not Solved
No. All rows in Global Sheet are process regardless of the Action call property. That Iteration setting only applies to dtLocalSheet. Make a sheet for each action if you want to control the iterations and data.
Reply


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)