Forum Discussion

kanemeyer's avatar
kanemeyer
Occasional Contributor
10 years ago

Is there a way to disable passed checkpoints from logging?

I have a test that runs quite a few checkpoints and dont need it to post all the passed checkpoints to the log. is there a way to shut that off?

  • You can create an event handler for the OnLogCheckpoint event to filter out unneeded messages. For example, to filter all passed checkpoint messages:

     

    // JScript

    // TODO: Make sure this function is bound to the OnLogCheckpoint event // in the Events project item function GeneralEvents_OnLogCheckpoint() { LogParams.Locked = true; }

    onlogcheckpoint.png

  • You can build your own property checkpoint with an If Then or an If Object 

     

    If  (my property is not correct) Then

        post an error to log

     

     

     

     

    • sxadov's avatar
      sxadov
      New Member

      I just cannot find it using the FindChild command.  I'd also like to have it use a varible with the "sbtray" aspect (i.e. "subtray*") of the code as the numbers may vary.   Can someone please give me some idea of what I am doing incorrectly???

    • kanemeyer's avatar
      kanemeyer
      Occasional Contributor

      Is there any way to do this in Keyword Tests?

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    You can create an event handler for the OnLogCheckpoint event to filter out unneeded messages. For example, to filter all passed checkpoint messages:

     

    // JScript

    // TODO: Make sure this function is bound to the OnLogCheckpoint event // in the Events project item function GeneralEvents_OnLogCheckpoint() { LogParams.Locked = true; }

    onlogcheckpoint.png

    • NS189's avatar
      NS189
      Occasional Contributor

      Hi Helen,

         where do I put the GeneralEvents_OnLogCheckpoint method you provided. When I follow your steps, it put mine in KeywordTests,

      and then I do not know where the "script"/code is for it. I opened it in KeywordTests and I do not see any script associated

      with it?

      Am I missing somehting?

       

      thanks

      ns189

    • NS189's avatar
      NS189
      Occasional Contributor

      Hi Helen,

         I think I figured it out, what I did, I added a function  to a file I currently had and it looks like it is happy :)

       

      function GeneralEvents_OnLogCheckpoint(Sender, LogParams){

                   LogParams.Locked = true;

      }

       

      but your suggestion works correctly, in my test result log , I do not see checkpoint messages any longer.

       

      couple tech articles I found it helpful are :

      https://support.smartbear.com/viewarticle/73839/

      https://support.smartbear.com/viewarticle/75628/

       

      thanks

      ns189

       

       

       

       

       

      • HKosova's avatar
        HKosova
        SmartBear Alumni (Retired)

        Hi ns189,

         

        Glad you got that sorted out. Happy testing!