Forum Discussion

Dan_Kriz's avatar
Dan_Kriz
Occasional Contributor
15 years ago

Issue with 'Stop on error' in editor window

Hello all,


             I have a project set up as the following (note the tree structure for child and sibling levels):


>Project name (Folder)


-->Test case name (Folder)


---->Init script (function)


------>Login script (function)


-------->Script #1 (function)


-------->Script #2 (function)


---->Logout script (function)


Within the 'Project editor - Test Items' window, I have all of the scripts set to 'Stop on error - Test Item.' According to documentation, an error in Script#1 should cause a stoppage all the way to the Init script, thereby immediately jumping to the Logout script, which is what I want. 


My problem is that even on receiving an error, nothing stops. My question is, what could cause 'Stop on error' to be ignored? I've searched the forum and the documentation, and the only conflict I can come up with is 'Stop on error in Project Properties overrides Stop on error for each test item,' however, this is disabled. Can someone lend some insight as to what is happening?

8 Replies

  • AlexKaras's avatar
    AlexKaras
    Community Hero
    Hi Dan,



    I probably missed something in your question and it is also not quite clear what does "nothing stops" mean, but according to the TC documentation "Test Item - Stops the execution of the current test item (including its child test items and further iterations of the current item), but proceeds with the execution of the subsequent sibling items." ("Test Items Page (Project Editor)" help topic). So, if Script #1 fails, execution should proceed with Script #2. Is this the behaviour that you observe?



    And no, there are no internal means in TestComplete to provide the functionality you mentioned (to continue execution not from the sibling test item but from the parent one (ideally - to be able to specify the parent level to continue the execution from)) though I would love to see it in one of the next version of the tool (maybe in TC8...).
  • Dan_Kriz's avatar
    Dan_Kriz
    Occasional Contributor

    Hi Alex,


                 Thank you for the response. In regards to the logic you described, that would be the case if I only had 'Stop on error' applied to script #1, however, it is also applied to the Init and Login scripts, so an error in the log should recursively apply all the way back to Init, stopping Init and all of its child scripts, hence bypassing Script #2, or so I thought.


    Now that I read this section more clearly: 'Specifies TestComplete’s behavior in case an error occurs during a test run. Right after the execution of the test item has finished, the test engine searches for the error message in the test log formed during the test item’s execution.' I see where my mistake was. I missed the 'Right after the execution of the test item' part. Thanks for your time, this was clearly a case of me misinterpreting the documentation.

  • AlexKaras's avatar
    AlexKaras
    Community Hero
    Hi Dan,



    No problems. :) Glad to be of some help and you are always welcome here.
  • zildarius's avatar
    zildarius
    Occasional Contributor
    I have some, like this, problem.

    I use TC 8.10.

    In my project I have 3 test item, every test item has only one script this one procedure for test:

       Project

           Script1

               procedure test1

                       ....

           Script2

               procedure test1

                       ....

           Script3

               procedure test1

                       ....

    So, I would like to know how to do next: if, for example, in test item 1 (that contains the script 1) was error, can it stop execution of current test?

    Because although I set options "Stop on error" for test item it still execution this test item.

    I hope you uderstand me.

    Help me, please.

  • Hi Ildar,





    Because although I set options "Stop on error" for test item it still execution this test item.


    Do you mean you've set the value of a test item's "Stop on error" property to "Test Item", and the execution of this item was not interrupted although errors occurred? We've tried to reproduce such behavior, but failed. So, can you send us a sample project suite on which this issue can be reproduced?





    BTW, you can learn about stopping tests on errors and exceptions if you read the "Stopping Tests on Errors and Exceptions" help topic.
  • zildarius's avatar
    zildarius
    Occasional Contributor
    Hi Alex!

    You wrote:
    Do you mean you've set the value of a test item's "Stop on error" property to "Test Item", and the
    execution of this item was not interrupted although errors occurred?

    Yes. I have set the value of a test item's "Stop on error" property to "Test Item".
    I added the Project there I work this Calc.
    If when the test (in Unit1) execute I close window Calc TC still runing test.

  • Hi Ildar,





    I've checked your project - it does not contain any tests or test items. So, please make sure the archives you attach contain enough data to reproduce the issue.