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? )))
Having the option checked to stop on error in the project properties page will stop the entire project and cause the options on the test items page to have no effect:
https://support.smartbear.com/testcomplete/docs/testing-with/running/control-test-flow/overview.html
The test item’s Stop on error property only has effect if the project’s Stop on error option is disabled.
The test item’s Stop on exception property only has effect if the project’s Error dialog option is disabled.
So you would want to turn that off. At the same time setting the test item properties to stop on error Test Item, isn't exactly what it sounds like. It will actually attempt to finisht running the test item in it's current iteration but then stop any further iterations or child test items. A little misleading, but that's what documentation is for :)
If you want the test item to stop exactly when an error occurs the OnLogError event handler is your best choice, using it to call Runner.Stop(true).