QTP/UFT: Input and Output Parameter

”##Create Test (Start) Parameter “myPin”
”##Create Action (Action1) Parameter “enterPinNumber”
”## Set the Parameter
Dim enterPinNumber
enterPinNumber = TestArgs(“myPin”)
‘msgbox enterPinNumber
”## Run Test with Test Parameter
PbWindow(“w_Pb_frame”).PbEdit(“Pb_edit”).SetSecure enterPinNumber

”## Run Action with Action Parameter
RunAction “openApp [open_Application]”, oneIteration, Parameter(“inputParameter”)

”## Create a Output Parameter “userIDNo”
”## Get the “idNum” Value at RunTime
idNum = trim(PbWindow(“w_Pb_frame”).PbWindow(“w_Pb_frame”).PbDataWindow(“dw_window”).GetCellData (11))
”## Set the Output Parameter Value
Parameter(“userIDNo”) = idNum

”## Select a Power Builder Cell that match from QTP/UFT Runtime Data Table
PbWindow(“w_Pb_frame”).PbWindow(“w_Pb_frame”).PbDataWindow(“dw_window”).SetCellData “#1”,“lastname”,DataTable.Value(“LastName”,addNewUser)
”Return Output Parameter “newUserLastName”
Parameter(“newUserLastName”) = DataTable.Value(“LastName”,addNewUser)

Advertisements