Forum Discussion

TestQA1's avatar
TestQA1
Frequent Contributor
2 years ago

No failure count in Execution Summary though the tests have been failed

Hi,

 

I am using StopOnError_OnStopTest(Sender) handler that runs if test encounters any Log.Error while running. 

I need to export summary of the failed results when the test fails so I am using Log.SaveResultsAs in the handler. 

The handler is critical as we are using it to switch to next features if current features fail.

Now the problem is despite of failed tests, the exported summary is showing 0 Failed count. Please check attachment.

My QA department is not approving this and want to see correct fail count in summary.

Please note that the On error property in project settings is set to Stop current item so that the test stops running and executes handler.

Thanks

 

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Create a new project, with the following functions

    function MyError()
    {
      Log.Error("MyError")
    }
    
    function MyWarning()
    {
      Log.Warning("MyWarning")
    }
    
    function MyMessage()
    {
      Log.Message("MyMessage")
    }
    
    

    Implement the various Events, to see when the event is triggered when either of those functions are called. Also, this is dependant on Project Settings -> Playback, Error Handling.

     

    This is just to learn and understand the behaviour of Events. 

    • TestQA1's avatar
      TestQA1
      Frequent Contributor

      Please check the following test flow:

      Step1 : Project on error = Stop current item in the Execution Plan

      Step 2: Event handler used = StopOnError_OnStopTest - it works in combination with step 1

      Summary shows no failure count.

      In order to get the failure in summary, I understand from your reply that the test needs time to log results. How can I do it if my test stops on error and I need to perform certain action in event handler. 

      I'm not sure which event to use to see failed test failure on summary in this scenario except using the one I mentioned in Step2.

       

      Thanks

      TestQA