HP QTP Utility Statements : ExitActionIteration Statement
September 10, 2018
HP QTP Utility Statements : ExitActionIteration Statement
Welcome to this post! – ” HP QTP Utility Statements :ExitActionIteration 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 : ExitActionIteration 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.
ExitActionIteration Statement
Abstract
The ExitActionIteration statement is used to get the current action 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:
- How to get current iteration of the action (in the loop) stopped?
- Can you use the exitActionIteration , ExitAction and exitTest one after the other?
- What are the objects and parameters of ExitActionIteration statement?
- is ExitActionIteration is an object or statement?
Discussion
The purpose of this statement is also same as ExitAction but difference lies in the level of being called upon. ExitAction is to exit the action unlike ExitActionIteration which skips the iteration of the current action. Suppose you have created the test with several actions. Each action needs to be iterated based on some condition. And in case of some unexpected errors, cases you might want to exit particular or specific iteration on the action. Now existing the action and returning a status of the current action can be done via this ExitActionIteration Statement.
Hence, officially the main purpose of the ExitActionIteration statement is to exit the current iteration of the action. The pass or fail status of the action iteration remains as it was in the step prior to the ExitActionIteration statement.
Points to note here:
- The ExitActionIteration statement and its return value are displayed in the Run Results.
- The return value in the ExitActionIteration parameter must be a constant value either int or string.
- The return value can be stored in the output and hence to return a value to the calling action or test, use an output parameter.
Syntax
ExitActionIteration[(RetVal)]
Let’s see the parameters and their usage description for this statement:
Argument | Type | Description |
RetVal | Variant | Optional. The action iteration’s return value. The return value is displayed in the run results. |
Example
The following example uses the ExitActionIteration function to stop running the current action iteration when the value in the current row of the Login column in the action’s data sheet is “NewUser”.
'ExitActionIteration example CurrentUser = DataTable("Users", dtLocalSheet) If CurrentUser = "NewUser" Then ExitActionIteration("Exiting for NewUser") End IF
This brings us to the end of our discussion on “HP QTP Utility Statements : ExitActionIteration 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.
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.