The RunAction statement can run only actions that are already associated with your test as part of the test flow. Therefore, in order to enter a RunAction statement in the Expert View for an external action, you must first insert a call to the action (Insert > Call to Action) or copy the external action (Insert > Copy of Action) into your test. Using this option associates the action with the test and also inserts a RunAction statement for you. After the the external action is added to the test flow, you can add additional calls to that external action in the Expert View.
If you insert a RunAction statement in the Expert View for an external action that is not already associated with your test as a part of the test flow, the RunAction statement fails. For more information on copying or calling external actions.
Syntax
RunAction ActionName, [Iteration , Parameters]
Return Value
Variant.
If the action called by the RunAction statement includes an ExitAction statement, the RunAction statement can return the value of the ExitAction's RetVal argument. For more information, see ExitAction Statement.
Examples
The following example calls the SearchFlight action, and runs all iterations of the action.
RunAction "SearchFlight", allIterations
The following example performs the same call as the previous example, but runs only one iteration of the action and saves the returned value to the AxnVal variable.
AxnVal=RunAction ("SearchFlight", oneIteration)
The following example runs one iteration of the action, supplies a string value of MyValue for the input parameter, and stores the resulting value of the output parameter in a variable called MyVariable.
RunAction "Action2", oneIteration, "MyValue", MyVariable
For gaining more insights in the automation using QTP log on to below url :
Automation Testing Using QTP
For gaining more insights in the automation using QTP log on to below url :
Automation Testing Using QTP
Post a Comment