Adding action parameters as steps in the Editor

Instead of selecting input (or output) parameters from the appropriate dialog boxes while parameterizing steps or inserting output value steps, you can enter input and output parameters as values in the Editor using the Parameter utility object in the format.

For example:

  • Parameter("ParameterName")
  • Parameter("ActionName", "ParameterName")

Additionally, suppose you have test steps that enter information in a form to display a list of purchase orders in a table, and then return the total value of the orders displayed in the table.

You can define input parameters, called SoldToCode and MaterialCode, for the codes entered in the Sold to and Materials edit boxes of the form so that the Orders table that is opened is controlled by the input parameter values passed when the test is called.

You can define an output parameter, for example TotalValue, to store the returned value. The output value (TotalValue) can then be returned to the application that called the test.

The example described above might look something like this (parameters are in bold font):

Browser("Mercury").Page("List Of Sales").WebEdit("Sold to").Set Parameter("SoldToCode")
Browser("Mercury").Page("List Of Sales").WebEdit("Materials").Set Parameter("MaterialCode")
Browser("Mercury").Page("List Of Sales").WebButton("Enter").Click
NumTableRows = Browser("Mercury").Page("List Of Sales").WebTable("Orders").RowCount
Parameter("TotalValue") = Browser("Mercury").Page("List Of Sales").WebTable("Orders").GetCellData(NumTableRows,"Total")