Action input and output parameters are one of the key features of UFT to parametrize actions and passing the output of one action as input to another action across a test. In this post, I will be discussing how we can use action input and output parameters.
How to define action input and output parameters in UFT
1 2 3 4 5 |
var1=Parameter("inpVal1")'getting value of input parameter1 var2=Parameter("inpVal2")'getting value of input parameter2 Parameter("outVal")=var1+var2 'storing the sum total in output parameter variable |
Now select the Action1 and call the Action2 using Call to Existing Action. It will insert the below code snippet in the Action1.
1 |
RunAction "Action2", oneIteration |
Now you will have to add the values for input and output parameters in the above RunAction method. The syntax is as follows.
1 |
RunAction "Action Name", oneIteration,input1,input2..inputn,output1,output2....outputn |
Since we have defined only two input parameters and one output parameter. We will provide the values for input and output parameters in the called action. We have passed values 10 and 20 for input parameter1 and input parameter2 and storing the output value of the action in the variable OutPutVal.
1 |
RunAction "Action2", oneIteration,10,20,OutPutVal Msgbox OutPutVal |
Now run the Action1. It will call Action2 and compute the sum total of input parameter values and return the value in the output parameter. The same will be displayed in the message box.
Recommended Posts
- Actions in UFT One with Examples
- Read, Write and Update Excel File In UFT
- How To Use Dictionary Object in UFT With Examples
- Descriptive Programming in UFT with Examples
- How to Use Regular Expression in UFT to Identify an Object
- File System Object UFT | VBA
- Micro Focus UFT Tutorial – An Overview of UFT
- How to Use Visual Relation Identifier in UFT with Example
- VBScript MySQL Database Connection in UFT
- Read and Update XML File in UFT | VBA