# Stop test case execution from within a script

**URL:** <https://forums.eggplantsoftware.com/t/stop-test-case-execution-from-within-a-script/14592>\
**Category:** Eggplant DAI\
**Tags:** sensetalk, eggplant-functional\
**Created:** [September 9, 2025, 9:40am UTC](https://forums.eggplantsoftware.com/t/stop-test-case-execution-from-within-a-script/14592 "2025-09-09T09:40:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcell\_Balla](https://forums.eggplantsoftware.com/user_avatar/forums.eggplantsoftware.com/marcell_balla/32/589_2.png) [@Marcell\_Balla](https://forums.eggplantsoftware.com/u/Marcell_Balla)\
**Post date:** [September 9, 2025, 9:40am UTC](https://forums.eggplantsoftware.com/t/stop-test-case-execution-from-within-a-script/14592/1 "2025-09-09T09:40:44Z")

</div>

Hello. I would like to know whether there is a possibility to stop the execution of a test case from within an Eggplant script. Because using “exit all” only stops the current script. But what if the test case contains more scripts? I would like to stop test case execution as a whole when for example the tested version number of the software does not meat a minimum requirement.

The ideal solution would not make the test case result a failure in this case.

---

<div class="post-metadata">

**Author:** ![DaveHester](https://forums.eggplantsoftware.com/user_avatar/forums.eggplantsoftware.com/davehester/32/104_2.png) [@DaveHester](https://forums.eggplantsoftware.com/u/DaveHester)\
**Post date:** [September 9, 2025, 5:31pm UTC](https://forums.eggplantsoftware.com/t/stop-test-case-execution-from-within-a-script/14592/2 "2025-09-09T17:31:38Z")

</div>

When you add scripts as separate steps within a single DAI Test Case, the following is true:

- Values from global variables are available to each step within the case.
- Throwing an exception within any step stops the execution of the case.

If you were willing to mark the Test Configuration as a failure when any test steps are skipped, the easiest solution would be to throw an exception at the point where you currently have your Exit All. Because you prefer not to mark the Test Configuration as a failure, you will need to communicate to each successive step that it should be skipped. My recommendation would be to replace your Exit All with these lines of code:

```auto
put "TRUE" into global SkipStep
Exit All

```

Then at the start of any script that may need to be skipped add this:  
`if global SkipStep then Exit All`

Hope this helps.  
Dave

---

<div class="post-metadata">

**Author:** ![Marcell\_Balla](https://forums.eggplantsoftware.com/user_avatar/forums.eggplantsoftware.com/marcell_balla/32/589_2.png) [@Marcell\_Balla](https://forums.eggplantsoftware.com/u/Marcell_Balla)\
**Post date:** [September 10, 2025, 6:28am UTC](https://forums.eggplantsoftware.com/t/stop-test-case-execution-from-within-a-script/14592/3 "2025-09-10T06:28:46Z")

</div>

Thank you this will certainly work.

As a solution I have put “run” calls to each script of the test case into a new script.

```auto
setup.assertRequiredCcmVersion "24.2"

run "test-cases/metadata-dialog/xray-8212/init"
run "test-cases/metadata-dialog/xray-8212/iteration1"
run "test-cases/metadata-dialog/xray-8212/iteration2"
run "test-cases/metadata-dialog/xray-8212/iteration3"
run "test-cases/metadata-dialog/xray-8212/quit"

```

At the very beginning the check is done and since “exit all” inside the check aborts this main script too the subsequent calls to the other scripts is also aborted.
