How to change QTP Run setting programatically to point "Run one Iteration only" when the script is opened through QC.
if you have nested actions you can pass iteration number
RunAction ActionName, [Iteration , Parameters]
You can also set up for next , while went and do loops to control your iterations .. in case it is one..
but by default QTP runs only one iteration for each action by(unless test has been run to set for more than 1 iteration or nested is action has been called from multi run parent action)
I don't know if this is directly applicable to your issue, but you may want to review this article from the HP support knowledge base.
"Iteration setting for the test are ignored, when a test is executed from ALM/Quality Center 11. All iterations are run instead."
(Opinions and information contained in this post are wholly my own and do not reflect the opinions of my employer.)
Create a library file and associate the same with the test. Then place the below line of code in it
Setting("GlobalIterationMode") = 2
This will not work if you call it in on of the Actions
Buy the NEW QTP Descriptive Programming Unplugged Book
** Download QTP Unplugged 2nd Edition eBook for FREE **
NumberOfTestCases= DataTable.GetSheet("Global").GetRowCount - count for ALL ITERATIONS
If Environment("TestIteration") = 1 Then
Catch the train on rail of fasten, proven and easy solutions.
I have succesfully arranged a workflow Independent Framework for QTP like the EMOS Framework for WR