Forum Discussion

agiletstware's avatar
agiletstware
Occasional Contributor
14 years ago
Solved

printing test case status to logs

Hello, I am trying to print the test case status (passed, failed, etc) to the log in the OnStopTest event but am having some difficulty. Sub GeneralEvents_OnStopTest(Sender)        ...
  • Jackson_L's avatar
    14 years ago

    First off when debugging I'd remove the line 'On Error Resume Next' otherwise you won't know when you hit an error.

    I would say Project.Logs.LogItemsCount gives you a total count whereas Project.Logs.LogItem() is a zero-based collection meaning you'd need to enter (Project.Logs.LogItemsCount - 1)


    Try changing:

    (Project.Logs.LogItem(Project.Logs.LogItemsCount).Status

    to

    (Project.Logs.LogItem(Project.Logs.LogItemsCount - 1).Status


    Cheers,

    Jackson