In my Katalon project (running on Windoes OS), I like to run an external python
program.
I was looking at several examples of how to execute an external program from a Java or Groovy program.
The problem is that no matter what program I try to run (the python script or even a simple cd
command), I get the following error from Katalon-Studio
:
[ERROR] - Test Cases/CallPython FAILED because (of) java.io.IOException: Cannot run program "cd": CreateProcess error=2, The system cannot find the file specified
Here are some of the options I tried:
Groovy:
println "python myp.py".execute().text
println "cd".execute().text
Java
Process p = Runtime.getRuntime().exec("python myp.py");
String[] cmd = ["python", "myp.py"];
Process p = Runtime.getRuntime().exec(cmd);
Process p = Runtime.getRuntime().exec("cd");