Understanding the Test Object Method Dialog Box

When you click Add or Modify in the Custom Support Test Object Methods ScreenCustom Support Test Object Methods Screen, the Test Object Method dialog box opens.

The Test Object Method dialog box enables you to specify details for the test object methods listed in the Additional methods required for test object class pane in the Custom Support Test Object Methods screen.

The Test Object Method dialog box contains the following items:

Option

Description

Method name

The name of the test object method as it appears in UFT GUI tests. The name should clearly indicate what the test object method does so that a user can select it from the Step Generator or in the Keyword View. Method names cannot contain non-English letters or characters. In addition, method names must begin with a letter and cannot contain spaces or any of the following characters:  ! @ # $ % ^ & * ( ) + = [ ] \ { } | ; ': " , / < > ?

    Note:
  • Do not use the name of a test object method that already exists in the support class. (The Custom Support Test Object Methods Screen lists the test object methods that are already included in the support class.) If you want to override the implementation of an existing test object method, select it in the left pane of the Custom Support Test Object Methods screen (rather than creating a new test object method with the same name).

  • Modifying the name of a method is equivalent to removing the method and adding a new one.

Arguments

A list of the test object method arguments and their types.

  • The first argument of every test object method must be obj (Object). You cannot remove, modify, or move this argument.

  • You cannot modify the signature of a test object method that belongs to the existing test object class that you selected in the Test Object Class Selection Screen. (This means that in an existing test object method, you cannot add or remove arguments, or change their types.)

Method returns a string value

Indicates that this test object method returns a string value in addition to the return code. (The return value can be retrieved and used in later steps of a UFT GUI test.)

If you select this check box:

  • the wizard adds the ReturnValueType element to the test object method definition that it creates in the test object configuration file.

  • the method stub that the wizard creates in the new support class, returns the object Retval(""), which includes the return code OK and an empty string.
    When you implement the replay method for this test object method, you can use different types of Retval. If the method succeeds, return OK and an appropriate string value. Otherwise, return only the relevant error code. For more information, see the API Reference.

Description

The tooltip that is displayed when the cursor is positioned over the test object method in the Step Generator, in the Keyword View, and when using the statement completion functionality in the Editor.

Documentation

A sentence that describes what the step that includes the test object method actually does. This sentence is displayed in the Step documentation box in the Step Generator and in the Documentation column of the Keyword View.

You can insert arguments in the Documentation text by clicking  and selecting the relevant argument. The arguments are then replaced dynamically by the relevant values.