Forum Discussion

mcaramto's avatar
mcaramto
Occasional Contributor
21 days ago

Playback - On Error: Stop and Rerun Current Items Not Working.

Hello, can someone help me why Stop and Rerun Current Items on Errors is not working as before. When an error occurs, it is now continuing to run the whole test and then rerunning it, instead of stopping and then rerunning it. This is causing the execution to run very long and its very inconvenient. 

I have checked that my execution plan is using "Use project's On Error property" and that my project setting is set to "Stop and Rerun Current Items" when an error occurs. 

I have reinstalled test complete and it's still the same, how can I fix this? 

5 Replies

  • scot1967's avatar
    scot1967
    Icon for Champion Level 3 rankChampion Level 3

    Hello mcaramto,

    I see ...

    • "Use project's On Error property" ✅
    • "Stop and Rerun Current Items" ✅


    Have you verified "Stop and Rerun Current Items" in both Current and Default Project PlayBack properties? This could also be resolved by Try Catch implementation.  Do you have that in place? Last, when did this begin?  Background would help us such as any recent updates, your current version and the language you are using for your scripts or are you keyword testing?

    I hope we can help!

    ... If you find my posts helpful drop me a Like👍 Be sure to mark the post as the Solution✅ when you get one to help others out and to credit the one who helped you. 😎

    • mcaramto's avatar
      mcaramto
      Occasional Contributor

      Thanks for replying!

      I have Stop and Rerun Current Items" in both Current and Default Project PlayBack properties:

      Here is a small script as example: 

      With the execution plan settings:


      Here is the test log after executing, it is running the whole test instead of stopping on the error and rerunning it again: 



      Regarding about the try catch, can you show me how this is done? I never had this before and the stop and rerun has always worked for me. This started last week when I updated on the latest update, which is 15.80.1.7 (currently I am on). And I am using scripts for testing. 

  • Hassan_Ballan's avatar
    Hassan_Ballan
    Icon for Champion Level 3 rankChampion Level 3

    A common reason “Stop and Rerun Current Items” doesn’t behave as expected is configuration rather than a tool fault. Make sure of the following settings:

    1. Confirm the Playback > Error handling > On error property in Project Properties is set to Stop and rerun current item and that the Rerun failed test items count is configured. See the TestComplete docs here:
      https://support.smartbear.com/testcomplete/docs/testing-with/running/control-test-flow/stop-and-rerun.html (SmartBear Support)
    2. In the Execution Plan, verify each test item’s On error column is either set to Use project’s ‘On error’ property or explicitly to Stop and rerun current item. The test item setting takes precedence over the project default. See the property reference here:
      https://support.smartbear.com/testcomplete/docs/reference/project-objects/project/testitem/stoponerror.html (SmartBear Support)
    3. Check the overall Playback > Error handling > On error option under Current Project Properties to ensure it matches your intended behavior (Stop and rerun). That option controls what TestComplete does when an error is posted to the log. See the playback settings here:
      https://support.smartbear.com/testcomplete/docs/working-with/managing-projects/properties/playback.html (SmartBear Support)

    If all three are aligned and the behavior is still not as expected, it can help to isolate with a small test project to verify these values are actually being applied at runtime.

    If this resolves your scenario, marking it as the solution helps future readers find it quickly.

    • mcaramto's avatar
      mcaramto
      Occasional Contributor

      Thanks for replying!!

      I have checked all 3 points and problem is still occurring.

      I have also made a new project with a small script. Have included screenshots for reference. 

      Project Setting:

      Execution Plan Setting:


      Script to run: 

      Here is the test log after executing, it is still running the whole test instead of stopping on the error and rerunning it again: 

       

  • rraghvani's avatar
    rraghvani
    Icon for Champion Level 3 rankChampion Level 3

    See Stop and Rerun the Current Test Item After an Error - when you configure your project settings according to either Approach 1 or Approach 2, TC does not rerun after an error, as stated in the documentation.

    For example,

    Project Settings - rerun failed tests 4 times.Error occurs first. However, TC it's calling the next line of code i.e. Log.Message(), which it should not!On the next retry, the test passes, and I expect the next line code to show. Which it does.Summary results

    This appears to be a bug in TC, so I suggest opening a Support Ticket.

     

    Throwing an exception works fine - the same should also occur with Log.Error() is called.