Hi all,
I’m learning. Be gentle!
I’m trying to use Katalon Studio to execute a test that runs a batch file on my local PC.
I’m using com.kms.katalon.core.configuration.RunConfiguration
The batch file produces a simple report as a text file. The batch file works as expected when I run it directly from my PC, irrespective if I run it via Command line, double-click, or by pasting the full path into the windows Run application.
When I run the test case in Katalon, it executes without error but I don’t receive the expected report.
I think my syntax is correct, because when I change the batch file name to something that doesn’t exist I get The system cannot find the file specified
And, when I try Runtime.runtime.exec("notepad.exe")
, notepad opens without a problem.
I’ve tried variations of the following, each with the same result.
Runtime.runtime.exec("C:/<path to batch file>/batch_file.bat");
Runtime.runtime.exec("cmd.exe /C C:/<path to batch file>/batch_file.bat");
Runtime.getRuntime().exec("C:/<path to batch file>/batch_file.bat");
Runtime.getRuntime().exec("cmd.exe /C C:/<path to batch file>/batch_file.bat");
I’ve tried different variations of single/double backslash/forwardslash.
I’ve also tried running Katalon in Administrator mode
Has anyone tried this before?