Forum Discussion

raynjay's avatar
raynjay
Occasional Contributor
8 years ago

How to get current running keyword test case name in the event (OnStopTest)

Hi All,

 

I want to get the current running keyword test case name in the event (GeneralEvents_OnStopTest(Sender))

My purpose is to send notification message when test case is failed.

I determine if the keyword test case is passed or failed with error count in the event,GeneralEvents_OnStopTest(Sender).

 

Project.TestItems.Current.Name can be used but it can be used only when run test project.

I want know the current running keyword test case name when run the specific keyword test.

Anyone know about it ?

 

Thanks,

Raymond.

 

 

2 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    There currently, as far as I am aware, not a way to do so.

     

    The work around is a bit labor intensive.  It's going to entail you making your keyword tests more "robust" with regards to errors where they actually log the errors directly rather than waiting for TC to do it automatically.  That way you can manually add the keyword test name to your error messages and parse it out that way.  That's the best I can do for you beyond a complete re-architecture of your automation framework.