# Run batch from Test Case

**URL:** <https://forum.katalon.com/t/run-batch-from-test-case/10424>\
**Category:** Integrations\
**Tags:** integrations, katalon-studio\
**Created:** [April 20, 2018, 8:16am UTC](https://forum.katalon.com/t/run-batch-from-test-case/10424 "2018-04-20T08:16:14Z")\
**Posts on this page:** 1\
**Showing post:** 27

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [July 28, 2019, 5:12pm UTC](https://forum.katalon.com/t/run-batch-from-test-case/10424/27 "2019-07-28T17:12:57Z")

</div>

> katalon TC status is shown as passed while the process of creating a text file[open(a1+“.txt”,“w+”)] is still being executed.

As JDK doc [Runtime (Java Platform SE 7 )](https://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#exec(java.lang.String)) explains,  
`java.lang.Runtime#exec()` executes the specified command and arguments in a separate process.

Katalon’s TC status would be PASSED as it has successfully invoked a new process, and that’s all TC does. TC does not implicitly wait for the invoked process to finish, as the new process runs independently.

If you want your TC to wait for the process to finish, the easiest way you can do would be reading the STDOUT and STDERR emitted by the invoked process while waiting for some ‘DONE’ message. As for how to read STDOUT and STDERR, please have a look at

> [@"Interactive" Test with Katalon](http://forum.katalon.com/t/interactive-test-with-katalon/18215/6):
>
> Let me show you an example. Please make a test case with any name in Katalon Studio, paste the following code, and RUN it. This script will execute Windows’ ipconfig command, read the stdout and stderr from the process and print it. import java.nio.charset.Charset String[] CMD = { "cmd", "/c", "ipconfig.exe"} String WINCHARSET = "MS932" // Charset used for the output of the command, depends on your Windows PC environment, // see https://docs.oracle.com/javase/8/docs/technotes/guides/intl…

---

_[View the full topic](https://forum.katalon.com/t/run-batch-from-test-case/10424)._
