Run batch from Test Case

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 ) 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

1 Like