Hi,
OnStopTest is generated after the execution is finished and a log is created. But the LogResults object that is used to retrieve the status does not provide access to the current test log. This is because the test log contents are formed during the test execution, and the log is only added to the list of project logs after the test run is finished. So, you need to run the project and then run the routine that contains the following code:
TotalLogNumber = Project.Logs.LogItemsCount
Set LastProjectLogCreated = Project.Logs.LogItem(TotalLogNumber - 1)
If LastProjectLogCreated.ChildCount > 0 Then
Log.Message(LastProjectLogCreated.Child(LastProjectLogCreated.ChildCount - 1).Status)
End If
For more information, refer to the
Scripting Access to the Test Log Contents help topic.