Thread Rating:
  • 2 Vote(s) - 1.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP not performing iterations based on local data sheet
#1
Not Solved Question 
I'm trying to write a test in keyword view with 4 actions and local data tables for two of the actions. From what I understand it should run Action 1 once (no parameters), Action 2 four times (4 rows in a local data table), Action 3 four times (4 rows in a local data table), and Action 4 once (no parameters) in that order.

However what is happening is that the entire test is being executed once, accessing only the first lines of the local data tables for Actions 2 & 3, if there is nothing in the Global data table. If I put four rows in the Global data table it runs through all iterations but in the following order: Action 1, Action 2 - row 1, Action 3 - row 1, Action 4; Action 1, Action 2 - row 2, Action 3 - row 2, Action 4;...

Any ideas on why Actions 2 & 3 aren't iterating based on their local data tables?
Reply
#2
Not Solved
Change the Option in Action-Call Properties to run on all rows, for actions 2 and 3
Reply
#3
Not Solved Exclamation 
Thank you so much. I'd set that option globally, but didn't realize that I had to set it for the individual actions :S
Reply
#4
Not Solved
Hello Niranjan,

Action-Call Properties doesn't contain the Data table Iteration... These Data Table iterations for total Test...!

Run one iteration only,
Run on all rows
Run from rows to -- rows

are iterates whole test...

thanks & regards
Baba Fakruddin.D

Hello Breaker,

First, get clarification on Test Run... How QTP will run the Test and Action and any function calls.... practice by using debugging... and observe carefully step by step and also observe the variable values in Debug viewer pane..

QTP will run the test sequentially from step1 to step n....! what ever it may be new action or any function call...

The step will jumps from Action/function Call to Called Function or Called Action.

If you wanna run one action with several iterations, just call that action with that no. of iterations just as...

RunAction "Action Name", no.of iterations, parameters if any

You can run that action with no. of iterations available data in your local sheet... accessing the data from local sheet to that action is not an issue. you can do it easily...

thanks & regards,
Baba Fakruddin.D

if any queries send me a mail on baba.fakru@gmail.com
Reply
#5
Not Solved
Hi,
Defaulty QTP takes Global Data sheet iterations for any Action.
For Eg:
1.Global Datasheet contains 4 rows and Local Datasheet contains 1 row,totally it takes 4 iterations on the Data table.
2.Local Datasheet contains 1 row and Global Datasheet contains 4 rows,finally it takes 1 iterations on Data table.

Thanks
------------------------------------------------
Reply
#6
Not Solved
Baba why don't u try it for urself.. what niranjan has suggested...
Reply
#7
Not Solved
Hi,
Global Sheet iterates as many times the rows present
local sheet iterates just once eventhough you have 4 rows or more rows for this you have to add Loop in your script then it will iterate as many rows you have.
* One more Point if you want to use local sheet you should not have any data in Global sheet because if u have data in global & in local sheet it still takes global data only automatically.

Example:loop
introwcount=dataTable.getsheet("Action1").getrowcount
msgbox introwcount (shows how mnay rows present in table)
for i=1 to introwcount (iterate from 1 to how many rows present in the table)
DataTable.setcurrentRow(i) , (if we give this in locall all rows will iterate)
Reply
#8
Not Solved Question 
This is an interesting point. I have a similar problem with the DataTable and I want to ask you to find a solution for me:
Thread: How to create a suitable loop

Thanx,
Tom
Reply
#9
Not Solved
Hi ,

QTP by default runs as per the Global data sheet rowcount and for all the rows present in Global datatable.

So here in your case, Global sheet if having no data, ( by default Global datasheet having one row) so it runs only the first row for all local datasheets for all the acions.( Because for local sheet, default setting is run for one row only)
So if you want to run the script as expected and handle it on the basis of row numbers present in Local sheet then use Action call properties.
Here if you select Run for all rows then the specific action will run for all the rows present in that local data sheet and then again move to the next action. Even if you can control that only for 1-3 rows you want to run that specific action though it might have more rows in local sheet using Action call Properties.

Hope above information will help. Please let me know if you need more details.

Regards,
Nilanjan.
Reply
#10
Not Solved
hi,
this is just a query related to the global sheet.
I have given three sets of data in the global sheet for which I need the flight application to launch with the credentials and then exit and the same action should repeat for 3 times. But when I run that the script just gets executed once.
If the test runs in accordance to the number of rows in the Global Sheet then why did the test run only for 1 row?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Repeat iterations Until New Value Is Seen in Column1 shayk1985 1 1,730 07-05-2018, 05:52 PM
Last Post: Ankur
  UFT Datatable iterations Studymode 2 3,771 12-12-2017, 11:10 PM
Last Post: Studymode
  UFT 14.01 - identifying wpf objects. but not performing action. chinmoyee 1 2,486 11-15-2017, 03:42 PM
Last Post: Ankur
  Reading data from excel sheet serenediva 1 9,598 03-03-2017, 10:07 AM
Last Post: vinod123
  QTP-Re-executing script after completion of all iterations JwalantBhatt0602 1 2,691 03-24-2016, 12:37 AM
Last Post: JwalantBhatt0602

Forum Jump:


Users browsing this thread: 1 Guest(s)