QTP How to run multiple iterations (924 Views)
Reply
Frequent Advisor
Blair1000
Posts: 59
Registered: ‎04-16-2008
Message 1 of 9 (924 Views)
Accepted Solution

QTP How to run multiple iterations

Requirements: For Fight application, we want to login as different user Name, each user book ticket three times

User1: book ticket name Lisa1
User1: book ticket name Lisa2
User1: book ticket name Lisa3

User2: book ticket name Lisa1
User2: book ticket name Lisa2
User2: book ticket name Lisa3

User3: book ticket name Lisa1
User3: book ticket name Lisa2
User3: book ticket name Lisa3


We have two actions Login and Book Tickets.

If we set login Name as Parameter in global sheet, and ticket Name as Parameter in Book Tickets action table, QTP only run three iterations

User1: book ticket name Lisa1
User2: book ticket name Lisa2
User3: book ticket name Lisa3

How to set up data tables to run 9 iterations ?

Please use plain text.
Honored Contributor
Henry Floyd
Posts: 1,033
Registered: ‎06-11-2008
Message 2 of 9 (924 Views)

Re: QTP How to run multiple iterations

If I understand your question just put

User1: book ticket name Lisa1
User1: book ticket name Lisa2
User1: book ticket name Lisa3
User2: book ticket name Lisa1
User2: book ticket name Lisa2
User2: book ticket name Lisa3
User3: book ticket name Lisa1
User3: book ticket name Lisa2
User3: book ticket name Lisa3

in the global table.
Please use plain text.
Frequent Advisor
Blair1000
Posts: 59
Registered: ‎04-16-2008
Message 3 of 9 (924 Views)

Re: QTP How to run multiple iterations

Do you mean set Login name and Ticket name in Global?

Login Name ticket name
User1 Lisa1
User2 Lisa2
User3 Lisa3
Please use plain text.
Honored Contributor
Henry Floyd
Posts: 1,033
Registered: ‎06-11-2008
Message 4 of 9 (924 Views)

Re: QTP How to run multiple iterations

I guess so,

Each row of the global sheet will cause the script to run your action so you need 9 lines with the different parameters you need.
Please use plain text.
Frequent Advisor
Blair1000
Posts: 59
Registered: ‎04-16-2008
Message 5 of 9 (924 Views)

Re: QTP How to run multiple iterations

We want to set up three rows to run 9 iterations

Login Name Book Ticket Name
User1 Lisa1
User2 Lisa2
User3 Lisa3
Please use plain text.
Honored Contributor
Henry Floyd
Posts: 1,033
Registered: ‎06-11-2008
Message 6 of 9 (924 Views)

Re: QTP How to run multiple iterations

ok, you can but that would require you to do a loop in you action. It is much easier to just put 9 line in the global sheet

User1 Lisa1
User1 Lisa2
User1 Lisa3
User2 Lisa1
User2 Lisa2
User2 Lisa3
User3 Lisa1
User3 Lisa2
User3 Lisa3
Please use plain text.
Frequent Advisor
Blair1000
Posts: 59
Registered: ‎04-16-2008
Message 7 of 9 (924 Views)

Re: QTP How to run multiple iterations

If I add loop, QTP only book ticket for Lisa1 three times.

Is it possible we add three rows for Login name, and three row for book ticket name, and run 9 rows
Please use plain text.
Honored Contributor
Henry Floyd
Posts: 1,033
Registered: ‎06-11-2008
Message 8 of 9 (924 Views)

Re: QTP How to run multiple iterations

Use your Book Tickets action and create a sheet there that has the three rows Lisa1, 2, 3

Then in keyword view right click on the Action and select "Action Call Properties" and select "Run on all rows"
Please use plain text.
Frequent Advisor
Blair1000
Posts: 59
Registered: ‎04-16-2008
Message 9 of 9 (924 Views)

Re: QTP How to run multiple iterations

Thank you ! It works
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation