Stop Project Script Command
I've been searching the docs and message boards and I think the answer to my question is no, but I don't see that explicitly stated anywhere.
Does a script command exist to stop a project during a suite run?
I'm running a project within a project suite (comprised of about 30 projects). Within this particular project, there is a specific scenario that may be encountered that I want to handle in the following way:
- Set a flag to true (I'm using a Project Suite variable)
- Log an error
- Have an OnLogEvent handler that looks for the flag, and if it is true:
- Run a few scripts to reset the application
- Stop the project but continue to run the suite
This sounds all good until I get to the part of stopping the project in script. I can only find Runner.Halt() and Runner.Stop(), which I understand as stopping the entire suite.
I can use the flag and and if() at the beginning of the remaining scripts within the project to tell them to run or not, but that's less than ideal and I could reuse this event handler in a subsequent project if it worked the way I want it to.
I think the answer is:
No, there is not, not specifically as a Object.Method item available to "stop project". Instead, as the article TanyaYatskovska linked to gives a variety of methods, settings, etc., which allow you to control project flow. So, combining native language exception handling, event handlers, settings in the Project Suite items list and Project items list, etc., you CAN achieve what you want... but there is no "Stop this project" command.