Forum Discussion
Hi,
You can use Runner.Stop(true) in-order to stop the current test item execution.
In a basic way, You can add this code into your OnLogError, then it will stop the current test item.
Reference:
- For adding event handler - https://support.smartbear.com/testcomplete/docs/testing-with/advanced/handling-events/creating-handlers/for-testcomplete-events.html
- Using Runner method - http://support.smartbear.com/testcomplete/docs/reference/project-objects/items/script/runner/stop.html
- Related topics that might help you
- tristaanogre7 years agoEsteemed Contributor
Additionally, if you have you scripts set up that each of them is a TestItem in the project, there's an option in the test items for "Stop on Error"
This option has three settings: None, Test Item, Project. If set to Test Item, if an error happens within that test item, it will only stop that Test Item. The next test item in your project will run accordingly then.
- AlexKaras7 years agoChampion Level 3
As a side note and mostly as a feature request for Support:
> This option has three settings: None, Test Item, Project.
Where 'Test Item' effectively means: 'stop processing current Test Item and all child ones and continue from the next sibling'.
From the usability point of view it would be extremely great to get one more option with the functionality like this: 'in case of error, stop processing this and all child Test Items, move up one level and continue processing from there'.
- nisgupta7 years agoValued Contributor
Here what I have done
The first screenshot shows that event handler get created.
The second screenshot that the functions associated with the events get created .
My main concern is that - should we need to create the functions in other scripts also under the same projects .I mean just copy those functions to other scripts as well.
Please update
Thanks
NG
- AlexKaras7 years agoChampion Level 3
Hi,
Project event is global for the whole project and only one handler's routine is required. It is irrelevant what script unit contains this routine.
- nisgupta7 years agoValued Contributor
SO my question is if the project contain multiple scripts how can I create event handler for multiple scripts ? When we create event control then it asked select any one from the list as shown in the attached screenshot.
If I select any one script and add there then event handler will work for that script only. How can I make ti work for multiple scripts ?
Thanks
NG
Related Content
Recent Discussions
- 6 hours agoSubhraDas
- 24 hours agotramuntana