https://www.qatechies.com

HP QTP Utility Statements : ExitComponentIteration Statement

technical-concept-uft

HP QTP Utility Statements : ExitComponentIteration Statement


Welcome to this post! – ” HP QTP Utility Statements :ExitComponentIteration Statement”.

If you are looking for HP UFT, QTP utility statements and their usages, then you are at right place. This post “HP QTP Utility Statements : ExitComponentIteration Statement” consists of concept discussion and usage discussion. Go ahead and enjoy reading…

This discussion will help you prepare well if you are going for the interview and can help you if you need the function to be used in your project test suite.

 

ExitComponentIteration Statement

Abstract

The ExitComponentIteration statement is used to get the current component iteration exited and return to the parent calling action. This statement is called as a priority step or statement whenever defined. The statement in itself falls under the category of utility statements and not utility objects.

Remember there is a difference between utility statements and utility objects.

Before we dig down deep into the usage let’s quickly visit some general questions.

In the interview usually, you might be questioned in different ways like:

  1. How to get current iteration of the component stopped?
  2. Can you use the ExitComponentIteration and exitTest one after the other?
  3. What are the objects and parameters of ExitComponentIteration statement?
  4. is ExitComponentIteration is an object or statement?
  5. What happens to next component in order of execution when prior one is exited?
  6. Can you use the return value of the exit component into another business process test component?

 

Discussion

Suppose you have created the test with several components. Each component of the Business Process test needs to be executed in order of execution and each of the component loops through as per data sheet i.e. in iterations of rows and columns. And in case of some unexpected errors, business cases you might want to exit the current component. Now, exiting the component and returning a status of the current component can be done via this ExitComponentIteration Statement.

Hence, officially the main purpose of the ExitComponentIteration statement is to exit the current component iteration. The pass or fail status of the component remains as it was in the step prior to the ExitComponentIteration statement.

 

Points to note here:

  1. The ExitComponentIteration statement and its return value are displayed in the Run Results.
  2. 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.
  3. 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.
  4. The return value can be stored in output parameter to be used in other Business Process Components or Tests as an input parameter.

 

Syntax

ExitComponentIteration [(RetVal)]

 

Let’s see the parameters and their usage description for this statement:

 

Argument Type Description
RetVal Variant Optional. The component iteration’s return value. The return value is displayed in the run results.

 

Example

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

'ExitComponentIteration example

res = Browser("Home").Page("Login Page").WebEdit("userPassword").Check ( CheckPoint("userPassword") )

If res = False Then

    ExitComponentIteration

End If

 

 

This brings us to the end of our discussion on “HP QTP Utility Statements : ExitComponentIteration Statement”.

 

I really hope you have enjoyed reading this short post. If you have any doubt on this please feel free to add your comment below.


Other Utility Statements:
UNREGISTERUSERFUNC REGISTERUSERFUNC
SETLASTERROR GETLASTERROR
INVOKEAPPLICATION EXITTEST
EXITACTION EXITACTIONITERATION
DESCRIBERESULT EXECUTEFILE
EXITCOMPONENT EXITCOMPONENTITERATION
LOADANDRUNACTION PRINT
WAIT EXITTESTITERATION
LOADFUNCTIONLIBRARY CALLSERVICETEST
OBSOLETE MANUALSTEP
RUNACTION

And if you like to read more on UFT or QTP Technical Interview Questions please follow below links: 

UFT Technical Interview Questions – Set 1

UFT Technical Interview Questions – Set 2

How to Download Resource From QC\ALM?

How to Upload Resource To QC\ALM?

 

Or if you prefer General Interview Questions please follow below links:

UFT General Interview Questions – Part 1

UFT General Interview Questions – Part 2

 


If you would like to keep track of further articles on UFT (QTP). I recommend you to SUBSCRIBE by Email and have new UFT articles sent directly to your inbox.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

advanced-floating-content-close-btn
https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5034726663464946 (adsbygoogle = window.adsbygoogle || []).push({});
advanced-floating-content-close-btn 
*************************** Do you want to learn TOSCA? Do you want to excel in Career? Try my New Courses: 1. Tricentis Tosca and Working with Excel   2. Tricentis Tosca and UI Automation Great News!!   Price has been slashed down for limited period of time.So Hurry!!! Click The Shown Links and Enjoy Learning. ***************************
 
error: Content is protected !!