ExitComponentIteration QTP

What does the ExitComponent Iteration function do in QTP automation testing using QTP : It simply exits the current component iteration.


If the component is not part of a component group, then the remaining steps in the component are skipped and the run proceeds to the next component iteration.

If the component is part of a component group, then the remaining steps of the current component and any remaining components in the component group are skipped, and the run proceeds to the next group iteration.

The pass or fail status of the component remains as it was in the step prior to the ExitComponentIteration statement.

Syntax

ExitComponentIteration[(RetVal)]



Argument

Type

Description

RetVal

Variant

Optional. The component iteration's return value. The return value is displayed in the run results.

Tip: To return a value for use in other components in the business process test, use an output parameter.

Example

The following example uses the ExitComponentIteration statement to end the current component iteration if a checkpoint on the userName edit box fails.

res = Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").Check ( CheckPoint("userName") )

If res = False Then

       ExitComponentIteration

End If

2 comments:

  1. Hi,

    This function is not working with QC 11. That is, it is not exiting the iteration.
    Pls giv us a solution.

    ReplyDelete
  2. Yiioverflow presenting one of the best and high performance PHP framework. Fast, secure and extremely professionals are developing applications. We guide to implement mobile app development and SOA hybrid applications.Code in Nodejs, Angular,Ionic,ReactJS and Yiiframework.

    ReplyDelete