Developing Support for Running Tests

When UFT One runs a test step, it first calls FindObjectId2 to retrieve the appropriate object ID from the Testing Agent based on the stored description of the test object. (If FindObjectId2 is not implemented by the Testing Agent, UFT One calls FindObjectId). If the object is not found or if FindObjectId2 returns more than one object ID, UFT One can use Smart Identification to identify the object in the application. UFT One uses Smart Identification only if the UFT One user configured Smart Identification for the relevant test object.

Next, UFT One calls the RunEx method with the object ID, the test object method to run on the object, and the arguments for that test object method. (If the RunEx method is not implemented, the Run method is called). You must implement the RunEx or Run method so the Testing Agent performs the appropriate operations on the application being tested. Implement ITestable3 and the RunEx method if you want to add test-object related lines to the UFT One run results while performing the step.

To enable UFT One to provide meaningful error messages to the UFT One user, you must implement the GetLastError method.

The following diagram shows the general sequence of methods that UFT One calls when running a test. This illustrates the purpose of the methods that the Testing Agent must implement. For example, UFT One calls FindObjectId2 which is implemented by the Testing Agent in the ITestable2 interface. If FindObjectId2is not implemented, UFT One calls FindObjectId, which is implemented by the Testing Agent in the ITestable interface. (Note that if you implement ITestable2 or ITestable3, you must implement FindObjectID2.)

The diagram also shows the use of the GetLastError method. For more information, see Implementing the GetLastError Method: Reporting Errors.

For more information, see: