ExitComponent Statement

QTP Action Type : Exits the current component run.

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

If the component is part of a component group, then the entire component group is skipped and the run proceeds to the next component after the component group.

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

Syntax

ExitComponent[(RetVal)]



Argument

Type

Description

RetVal

Variant

Optional. The component'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 ExitComponent statement to end the component run 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

       ExitComponent

End If

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.