Forum Discussion

jsc's avatar
jsc
Regular Contributor
13 years ago

Runner.Stop(true) & StopOnError

Hi all,



currently I use the Runner.Stop(false) function to stop the test on various errors.



I got some questions regarding Runner.Stop(true) or Runner.Halt(true):



1) if called with the parameter "true" will the execution jump to the next keyword test item or the next TestComplete project?

2) if I turned on "StopOnError" in some of the projects, will Runner.Stop(true) stop the test run or jump forward?



Kind regards,



Joachim
  • Hi,


    1) if called with the parameter "true" will the execution jump to the next keyword test item or the next TestComplete project?


    If the CurrentTestOnly parameter is set to True, the test engine will stop the execution of the current test item and will start executing the next test item.


    2) if I turned on "StopOnError" in some of the projects, will Runner.Stop(true) stop the test run or jump forward?


    When you call the Runner.Stop method, the StopOnError event is generated. So, you can use the StopOnError option instead of using the Runner.Stop method when an error occurs. In both cases, the test will stop when an error occurs.

  • jsc's avatar
    jsc
    Regular Contributor
    Hi Margaret,



    thanks for your reply, but I am not sure if I understood it all correctly.



    My intention is to change the currently used Runner.Stop(false) in some of my script extensions into
    Runner.Stop(true) and am not sure if I will not mix up things in my
    tests.



    I got 2 sorts of Projects.


    1. Projects that have StopOnError = true

    2. Projects that have StopOnError = false


    If I now change to Runner.Stop(true), will ...


    • ... in case 1. the test still completely stop and NOT go to the next testitem?

    • ... in case 2. the test stop this testitem and continue with the next testitem?


    Thanks for your help,



    Joachim
  • Hi Joachim,


    In case 1 (the StopOnError option is enabled and you are using Runner.Stop (true)), the test engine will completely stop the test execution (not go to the next test item).


    In case 2 (the StopOnError option is disabled and you are using Runner.Stop (true)), the test engine will stop the execution of the current test item and will start executing the next test item.