QTP Forums

Full Version: QTP not performing iterations based on local data sheet
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
Change the Option in Action-Call Properties to run on all rows, for actions 2 and 3
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
(05-15-2008 11:36 AM)niranjan Wrote: [ -> ]Change the Option in Action-Call Properties to run on all rows, for actions 2 and 3


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
(05-14-2008 11:16 PM)Breaker Wrote: [ -> ]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?


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
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
------------------------------------------------
(03-16-2009 10:45 AM)bfakruddin Wrote: [ -> ]
(05-15-2008 11:36 AM)niranjan Wrote: [ -> ]Change the Option in Action-Call Properties to run on all rows, for actions 2 and 3


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
(05-14-2008 11:16 PM)Breaker Wrote: [ -> ]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?


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
(03-16-2009 10:45 AM)bfakruddin Wrote: [ -> ]
(05-15-2008 11:36 AM)niranjan Wrote: [ -> ]Change the Option in Action-Call Properties to run on all rows, for actions 2 and 3


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


Baba why don't u try it for urself.. what niranjan has suggested..

(05-14-2008 11:16 PM)Breaker Wrote: [ -> ]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?


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
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)
(07-29-2011 08:08 PM)priya04 Wrote: [ -> ]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.

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
Reference URL's