Forum Discussion

mboyce's avatar
mboyce
Contributor
6 years ago

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.

    • mboyce's avatar
      mboyce
      Contributor

      TanyaYatskovska 

      Thank you for the suggestion, but no, that article doesn't explicity answer my question.

       

      I want to have an error handler that looks for a specific scenario and, if found, (via scripts) resets my tested desktop application, stops the project, and then continues to run any subsequent projects in the suite.

       

      To accomplish this I am looking for a script command to stop the project, but it seems this doesn't exist. I'm just looking for someone to say "Yes this does exist and here it is" or "No it doesn't exist"

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        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.