Forum Discussion

jaibabu's avatar
jaibabu
New Contributor
8 years ago
Solved

How to retrieve the current test run status (Pass / Fail) from Keyword test

Hi,

 

    Currently i am trying to get the status of the keyword test result and its failed reason. But i don't find any way to achieve this.

I had recorded a keyword test. when i run this test by clicking the run button, the keyword test gets executed and it shows fail or pass condition in the Editor window. But what i need is, if this test fails, then i need to post a bug to TFS automatically. To post the bu automatically to TFS i come across the following method "IssueTracking.CreateWorkitem()" through script.

 

    But what my problem is,

     1. How to fire this script (IssueTracking.CreateWorkitem()), when my keyword test gets failed? [Record and Plaback]

     2. How to pass the failed reason and description to that script (IssueTracking.CreateWorkitem())?

   

Note:

I had come across reading the Project log, but i can read upto the previous test run logs not the current log.

Link Referred: https://support.smartbear.com/viewarticle/68245/

 

Just i am learning testcomplete for myself, i searched through google but all i got is creating checkpoint and error handling. But this doesn't satisfy my need.

 

Please guide me how to get the current test run state (Keyword test run and also Script test run) and the reason of the test failure.

 

Thanks

Jaibabu.J

  • Have you tried using the OnLogError event handler?  Basically, whenever anything is written to the TC log of a type "Error", that event handler will get triggered and you'll be able to call code there to post to TFS.

2 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Have you tried using the OnLogError event handler?  Basically, whenever anything is written to the TC log of a type "Error", that event handler will get triggered and you'll be able to call code there to post to TFS.

    • jaibabu's avatar
      jaibabu
      New Contributor

      Hi Robert Martin,

       

         Thanks a lot and it worked as expected.

       

      Thanks

      Jaibabu.J