Forum Discussion

santoguya's avatar
santoguya
Contributor
15 years ago

test halts when a checkpoint fails

i have a script test with a bunch of checkpoints, but when it hits a checkpoint cannot be verified, the execution of the script stops and any tests after the failed checkpoint do not get executed.



i searched for "testcomplete continue testing on checkpoint failure" and other search terms but couldnt find the answer to this question, perhaps it would be faster to just post here on forums.



thankS!

7 Replies


  • Hi Randy,





    You need to right-click your project in the "Project Explorer" panel, select "Edit | Properties" from the context menu, select "Playback" on the project's "Properties" page that opens, and disable the "Stop on error" option. See the Project Properties - Playback Options help topic for more information.
  • Thanks David.



    Is there a way to only continue if there is a checkpoint failure, but stop if there is an action failure? I think this functionality would be pretty useful because if an action was recorded wrong, then all subsequent steps would fail in the automation, and therefore it would be obvious to stop on action failure. But if the checkpoint fails, it is just a check and did not perform any actions so the test should still go on as planned and continue performing actions and other checkpoints.
  • Maybe "Stop on window recognition error" is what I'm describing?
  • Hi Randy,



    Maybe "Stop on window recognition error" is what I'm describing?



    Currently, this will only work if you address your objects directly (via "Window", "WPFObject", etc.) and will not work if you address objects via Name Mapping.



    Is there a way to only continue if there is a checkpoint failure, but stop if there is an action failure?



    So, to implement this scenario, I recommend that you set an event handler for the OnLogError event in the following way:





    function GeneralEvents_OnLogError(Sender, LogParams)


    {


      if ( (aqString.Find(LogParams.Str, "checkpoint") == -1) || (aqString.Find(LogParams.Str, "failed") == -1))


      {


        Runner.Halt();


      }  


    }




    and leave the "Stop on error" option of the project disabled. See Creating an Event Handler for the OnLogError Event for more information.
  • schan's avatar
    schan
    New Contributor
    Hi David,



    I have try to create that piece of code you suggested above but I am not sure how I should call it when I need to use it.  What do I need to pass into as the Sender variable?
  • schan's avatar
    schan
    New Contributor
    I found out that you can actually use aqObject.CompareProperty() to check the value and it will not halt the script if it failed, but the problem is it does not really create a checkpoint icon in test results.  Is there any other way?
  • Hi,


    If you want to implement the following scenario:


    only continue if there is a checkpoint failure, but stop if there is an action failure


    use the approach suggested by David. You do not need to call the mentioned GeneralEvents_OnLogError function and pass any parameters to it - it is the event handler for the OnLogError event. This handler will be called automatically before an error message is posted to the log. I recommend that you refer to the Handling Events help topic for more information about handling events with TC. If this scenario is not what you need, describe the scenario you're trying to implement in detail.