Interview Questions   Tutorials   Discussions   Programs   Videos   

QTP - How do you call action in QTP?

asked marvit August 19, 2014 12:59 AM  

How do you call action in QTP?


1 Answers

answered By Dharma   0  
Testers can insert a new action at any point of the script by performing the following steps:

Step: 1 - Right Click on the Scripting area and select "Call to New Action"
Inserting Call to New Action Step 1

Step: 2 - In the "Insert Call to New Action" Window, give the test name, description, and also specify if it is a reusuable action or not. Most Importantly select the location the action to be inserted.
Inserting Call to New Action Step 2

We can also use QTP commands to call the Action at any point in the script.

RunAction "Calculate", oneIteration     'Executes  Calculate Action for one iteration.

Action can be called with Parameters as shown below:

'Input to the action
num1 = 5
num2 = 10
Dim value1

'Run the action with parameters
OutputValue = RunAction("Calculate", oneIteration, num1, num2, value1)

'Display the output
print OutputValue

   add comment

Your answer

Join with account you already have



Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!