QTP doesn't run only one iteration (7738 Views)
Occasional Visitor
Posts: 2
Registered: ‎12-06-2010
Message 1 of 11 (7,738 Views)

QTP doesn't run only one iteration

Hi, I'm using QTP 11 integrated with MQC 11. I know that MQC now have 2 rerun options:
The forced one, and another option that is conditional to a test failure.
Both options are disabled in MQC.
I already set as "Run one iteration only" the Data Table Iteration option located at: Settings>Run>Data Table Iterations
The only action my test have is set to run only once as well, but my test runs for all lines.
E.g.: If the test has 50 lines, it is gonna run these 50 lines 50 times, therefore, runnin 2500 lines.

I already tried to set these Settings>Run options at run time, but the same occured.

If I start the test from my local machine, stright into QTP it works fine, but if I start it from MQC, the issue happens. Can you please help me?
Frequent Advisor
Posts: 46
Registered: ‎11-06-2008
Message 2 of 11 (7,724 Views)

Re: QTP doesn't run only one iteration

Paulo, I do not have any idea about the above weird behavior (working perfectly for standalone execution and executing all the lines from QC) as we haven't upgraded to QC & QTP 11.

Try the below code temporarily (until you get the real solution for the issue) to execute the desired line of data from the DataTable.

If DataTable.GetCurrentRow = 1 Then

{ place your entire script here }

End If
Occasional Visitor
Posts: 2
Registered: ‎12-06-2010
Message 3 of 11 (7,724 Views)

Re: QTP doesn't run only one iteration

Actually, I don't want it to run only the first line. I want it to run all lines only once.
It's currently running all lines (e.g. 50) 50 times.
Is there any method I can determine in which iteration I am into?
Frequent Advisor
Posts: 46
Registered: ‎11-06-2008
Message 4 of 11 (7,724 Views)

Re: QTP doesn't run only one iteration

Paulo, that is completely strange. I can't think of more solutions to this issue. Try deleting the Test from that TestSet in TestLab of QC and Select the Test again and execute it.

And also in QC TestLab, when you select TestSet, you can see "Automation" tab on the right pane. Click on it and click "On Failure" tab. Uncheck the Option "If an automated test fails, rerun the test up to --- times" and Set "On final failure of any test in test set" to "Do Nothing".

If you find any other solution, please post here so that others also may get benefit from it.
Senior Member
Posts: 3
Registered: ‎02-05-2008
Message 5 of 11 (7,724 Views)

Re: QTP doesn't run only one iteration

Since the Upgrade from qc10 to qc11 I have a similar problem.
Every Test iterates on all rows.
Which is bad because my function-library is already doing this.

No matter what I set for the Test QTP is iteratin on all rows.
BUT only when the test is started remotely via QC through a test set.

When the same test is started directly in QC everything works fine.

I even tried to set the Iterations option vie the function library:
App.Test.Settings.Run.IterationMode = "rngIterations"
App.Test.Settings.Run.StartIteration = 1
App.Test.Settings.Run.EndIteration = 1

No change.

Any ideas?
Did I miss some settings in QC?
QC10 with QTP11 had no such problems.

Occasional Visitor
Posts: 2
Registered: ‎06-21-2009
Message 6 of 11 (7,715 Views)

Re: QTP doesn't run only one iteration


I'm experiencing the same problem. I have ALM11 and QTP11. When running QTP tests from the ALM Test Lab my tests run all iterations. But my test has been saved and set to run 1 iteration only. I also only want to run 1 iteration. If I run directly from QTP, then it runs 1 iteration fine.

I've also tried putting code at the beginning of the script to change the Run Settings to run 1 iteration, but also didn't work.


Did you find/get a solution?

I've logged a request with HP to see if they can solve this problem. I'll post the solution if they figure it out.




Frequent Advisor
Posts: 25
Registered: ‎08-23-2010
Message 7 of 11 (7,609 Views)

Re: QTP doesn't run only one iteration

You could try installing Qtp hotfix 733 (attached) which resolved a similar issue:


HP QuickTest Professional 11.00 Hotfix QTP_00733 Readme File
         	                19 December 2010

(c) Copyright 2010 Hewlett-Packard Development Company, L.P.

QTP_00733 – Run Specific Iteration Range from Test Set and Display Iterations Correctly  

This document provides the following information:

* Hotfix Description and Technical Details
* System Requirements
* Hotfix Files
* Hotfix Installation
* General Notes

Hotfix Description and Technical Details 

This hotfix fixes a problem that caused all iterations to be run (instead of a specified range) 
when you ran a test set from Quality Center or HP ALM. This problem occurred only for tests that 
used data table parameter values that were retrieved from the internal data table provided with 
QuickTest (and not from an external data table). 

This hotfix also fixes a problem that caused the status bar to incorrectly display the Global 
sheet name (if applicable) and the iteration (row) numbers for Global and action sheets.    

System Requirements

This hotfix applies to the following: 

QuickTest Professional 11.00

Hotfix Files

The following files will be added or modified in the following folders under the QuickTest Professional installation folder:
	QTOTAWrapper.dll	11.00.1157.0
	AQTRmtAgent.exe	11.1.1398.0
	QTPro.exe	11.1.1398.0

Hotfix Installation

1. Ensure that you have administrative permissions on the QuickTest computer.
2. Double-click the self-extracting executable file and follow the on-screen instructions.

General Notes

If you have a QuickTest Professional User Interface Pack installed, installing a hotfix that modifies QuickTest user interface 
components may cause translated user interface elements to revert to the English version.


Robert Barcikowski
Senior Technical Specialist
Occasional Visitor
Posts: 2
Registered: ‎04-26-2013
Message 8 of 11 (5,583 Views)

Re: QTP doesn't run only one iteration

Just go to


Test Plan > Test Configuration > Test Configuration Details > Data > Select Dynamic > Data Resource Settings , and there you can select your rows(iterations).

Posts: 3
Registered: ‎08-26-2009
Message 9 of 11 (4,024 Views)

Re: QTP doesn't run only one iteration

Goto "Global" sheet of QTP.


Check how many blanbk lines do you have.


You must be having 50 blank lines that is why it is executing 50 times.

Delete 49 blank lines and then run.

If you have some data in Global sheet the move it some where else and then delete all the lines.



Super Advisor
Posts: 216
Registered: ‎02-08-2013
Message 10 of 11 (3,977 Views)

Re: QTP doesn't run only one iteration

Also if by accident you have edited the cells with spaces or space it will read it too.


Happened to me and it was a brain breaker I tell you!

Occasional Contributor
Posts: 6
Registered: ‎06-04-2008
Message 11 of 11 (2,936 Views)

Re: QTP doesn't run only one iteration

Looks like I need this patch too. I have a section of a test where I loop through datatable values but the test should only be one iteration. Running from QC will run the test 15 times. A quick fix for me was to add the following code at the end of my test. 


If c = 1 Then
End If

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.