Search here for all the info you want in this Blog

Actions with Parameters

An action can have 2 types of parameters.
1. Input Parameter
2. Output Parameter
A parameter can be of type string, number, boolean, date, password, etc

Steps to declare the parameters for an action:
1. Select an action from the drop-down in the expert view
2. Select Edit --> Action --> Action Properties
3. Click on Parameter tab
4. Add the parameters for input & output sections by providing the parameter name, type & description --> Click on OK

Eg: 
Test2
X=inputbox(“enter 1st value:”)
Y=inputbox(“enter 2nd value:”)
RunAction “Action1[TEST!]”,OneIteration,x,y,res
msgbox res 

Test1
Action1 (reusable action)
a= Parameter(“i1”)
b= Parameter(“i2”)
c=a*b
Parameter(“o”)=c

Eg:
Test1
Userid = Parameter(“i1”)
Password = = Parameter(“i2”)
Dialog("Login").WinEdit("Agent Name:").Set "Userid"
Dialog("Login").WinEdit("Password:").Set "Password"
Dialog("Login").WinButton("OK").Click
If Window("Flight Reservation").Exist Then
Parameter("o")="Pass"
Else
Parameter("o")="Fail"
End If

Test2
Uid=inputbox(“Enter userid value:”)
Pw= inputbox(“Enter password value:”)
RunAction “Action1[Test1]”,OnceIteration,Uid,Pw,res
msgbox res

No comments:

Post a Comment