Open topic with navigation
The ITestEvents and ITestEvents2 interfaces are optional. UFT 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 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 closes.
UFT 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.
When a test run is close to its end, you might want to add a summary report to the UFT run results.
When a test run ends, you might want the Testing Agent to close an application that UFT opened during the test run.
Note: If you want to add lines to the UFT 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.