Enabling Test Event Notification

The ITestEvents and ITestEvents2 interfaces are optional. UFT One uses these interfaces to notify the Testing Agent when different events take place. Implement these interfaces if you want the Testing Agent to perform specific actions when an event occurs. If you implement these interfaces, UFT One notifies the Testing Agent when a test run begins or ends, when a test run is paused or resumed, when a run session is close to its end, when a test is closed, and before UFT One closes.

UFT One notifies the Testing Agent of these events by calling the relevant method in the ITestEvents interface. Implement the methods that represent events in response to which you want the Testing Agent to take action.

For example:

  • When a test run is close to its end, you might want to add a summary report to the UFT One run results.

  • When a test run ends, you might want the Testing Agent to close an application that UFT One opened during the test run.

Note: If you want to add lines to the UFT One run results, you must implement the BeginRun2 method in the ITestEvents2 interface. Save the reporter object provided by this method, and use it to call the IReporter:Report method during the run session.