Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Iterations settings
#1
Solved: 11 Years, 4 Months ago
Hi ALL,

My test run starts from login and ends with creating a record with few combinations involved in between.

My requirement is this- After first iteration I want QTP not to start over again with login page rather to just start with creating an Account record.
So could any body help me how do I set this condition?

Note: Login should only happen in the first iterations rest all should follow from creating a record.
Reply
#2
Solved: 11 Years, 4 Months ago
Hi ,

Try with the below steps:

Step1 :
File>Settings>Run>choose "Run Only One Iteration"

Step2:
Code:
'  Login Code
       ----------
       ----------
       ----------
     For i=1 to Datatable.GetSheet("AccountCreation").GetRowCount
           Datatable.GetSheet("AccountCreation").SetCurrentRow(i)
            ------ Account Creation code here -------
     Next
Reply
#3
Solved: 11 Years, 4 Months ago
Try to make use of Reusable Action

Creat Login ,Add Account Action.

Call Login ' First Call

Call Add Account
'
'
'
'
'
'
'
n times


Thanks
Reply
#4
Solved: 11 Years, 4 Months ago
Diclare a global variable

Code:
Dim bLoggedIn = False

Function Login()
if bLoggedIn = False Then
   "Login here"
   bLoggedIn = True
End If
End Function

call this function in your script.
Reply
#5
Solved: 11 Years, 4 Months ago
Hi,
Try these Steps below:
1: Split the action from where you need qtp to do the iteration.
2: Set action call properties of login action as " Run one iteration only" and the other action as per the requirement through action call properties.
Welcome
Samson.B
Reply
#6
Solved: 11 Years, 4 Months ago
Hi All,
@samson . I have done the same settings , I split the login action as one - Action 1_1 and account creation as Action 1_2.
For Action1_1 - Action call properties- One Iteration only
For Action 1_2 - Action call properties - Run on all rows.
Note: Login details are not in the data table. They set as constants in the script.

When I run the test .. I happen to see login page every time an iteration ends. I even noticed that due to these settings only one row in the datatable is executed/retrieved on every iteration. Implies same record is created every time QTP runs next iteration.

Was there a mistake in my settings??

Regards
Swetha
@ Srikanth

My datatable is in global sheet.

How do I declare this statement :- For i=1 to Datatable.GetSheet("AccountCreation").GetRowCount??

Could you be more clear on the explanation please.

Thanks
Swetha
Reply
#7
Solved: 11 Years, 4 Months ago
The Action which we need to iterate for n times , need to perameterized right.
1: If so, we need to create a local sheet for qtp to pass the values to the required field (not in Global sheet).
2: Then set the Action Call Properties.

Thank you,
Welcome,
Samson.B
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Repeat iterations Until New Value Is Seen in Column1 shayk1985 1 1,751 07-05-2018, 05:52 PM
Last Post: Ankur
  UFT Datatable iterations Studymode 2 3,802 12-12-2017, 11:10 PM
Last Post: Studymode
  QTP-Re-executing script after completion of all iterations JwalantBhatt0602 1 2,702 03-24-2016, 12:37 AM
Last Post: JwalantBhatt0602
Question QTP not performing iterations based on local data sheet Breaker 18 56,821 01-25-2016, 04:32 PM
Last Post: arunshuklainbox
  How To use iterations for API petchd 1 2,803 12-03-2015, 06:51 PM
Last Post: petchd

Forum Jump:


Users browsing this thread: 2 Guest(s)