Forum Discussion

kakabubu's avatar
kakabubu
Contributor
6 years ago
Solved

How 'Stop on error' should act for two projects within one project suite?

We have testComplete project suite for our automated tests.
There is a project (P1) with ~300 tests, designed in a way to run them ignoring errors occurring and just posting them to the log.

Recently I've added a second project (P2) to the project suite. We want to configure this project to stop the TEST execution if an error occurred and continue to the next test included to that project.

(tests are run by scheduled nightly task)

I'm confused about the configuration of project playback options, etc.

P1 project 

- properties: 
- - Stop on error is unchecked. 

- - Stop on exception is unchecked. 

- TestItem properties 'Stop on error' and 'Stop on exception' set to 'Test Item' for all test items of the project.

 

P2 project 

- properties: 
- - Stop on error is checked. 

- - Stop on exception is checked. 
- TestItem properties 'Stop on error' and 'Stop on exception' set to 'Test Item' for all test items of the project.

When project suit is run and the error occurs:
Actually:
P1 does not stop the execution of the test.

P2 stops the execution of the project.

 

What I need:

P1 OK (does not stop the execution of the test)
P2 stops the TEST execution and continue to the next enabled test of the current project.

 

Can you please help me understand, what kind of configuration will meet my requirements?

 

Also, I was going to write some handler for OnLogError event, which would make attempt to close all overlapping windows and restore program state to initial. Is it a correct use of testcomplete tools, for making tests stable and independent? )))

4 Replies

  • shankar_r's avatar
    shankar_r
    Community Hero

    kakabubu wrote:

     

    Also, I was going to write some handler for OnLogError event, which would make attempt to close all overlapping windows and restore program state to initial. Is it a correct use of testcomplete tools, for making tests stable and independent? )))


    It depends on the project. Yes, you can use OnLogError event to restore your application but you have to keep in mind that it runs every time when a Log.Error() OR error occurs. 

    If you know when to restore your application then it is easy to do. But if it is random then you have to handle it in a generic way like (each test when starts make sure app is on valid state)

    I would prefer to handle those overlapping using OnOverlappingWindow/OnUnexpectedWindow and use custom functions to restore your application at some point.

    • kakabubu's avatar
      kakabubu
      Contributor

      shankar_r wrote:


      ... keep in mind that it runs every time when a Log.Error() OR error occurs. 

       


      Thanks for your remark.

      Actually, I believe that it's exactly what I need. 

       

      I mean:

      if

      - the test will stop on any occurred error or error message,

      - and continue to the next test. 

      then

      - I should assure that the program is ready for the next test (including 'close possible error windows if they exist')

       

      But I still can't understand

      - how should I stop the test run after an error occurs

      - AND continue to the next test within the current running project.