Comments (image map) Parameters (image map) Parenthesis (image map) Calculations (image map) Variables (image map)

Parameter indications

Relevant for: GUI actions and scripted GUI components

You can use UFT One to enhance your tests by parameterizing values. A parameter is a variable that is assigned a value from an external data source or generator.

When you create a parameter in the Keyword View, UFT One creates a corresponding line in VBScript in the Editor.

For example, if you define the value of a method argument as a Data pane parameter, UFT One retrieves the value from the Data pane using the following syntax:

Object_Hierarchy.Method DataTable (parameterID, sheetID)

Item

Description

Object_Hierarchy

The hierarchical definition of the test object, consisting of one or more objects separated by a dot.

Method

The name of the method that UFT One executes on the parameterized object.

DataTable

The reserved object representing the data table.

parameterID

The name of the column in the data table from which to take the value.

sheetID

The name of the sheet in which the value is stored. If the parameter is a global parameter, dtGlobalSheet is the sheet ID.

Example: Suppose you are creating a test for the Advantage Online Shopping site, and you select Italy as your shipping address. The following statement would be inserted into an action in your test in the Editor:

Browser("Advantage Shopping").Page("Advantage Shopping").WebList("countryListbox").Select "Italy"

Now suppose you parameterize the address value, and you create an Address column in the Data pane. The previous statement would be modified to the following:

Browser("Advantage Shopping").Page("Advantage Shopping").WebList("countryListbox").Select DataTable("Address", dtGlobalSheet) 

In this example, Select is the method name, DataTable is the object that represents the data table, Address is the Data pane parameter (column name), and dtGlobalSheet indicates the Global sheet in the Data pane.

For more details on using and defining parameter values, see Parameterize object values.