How can I either run a batch file from java or better yet, run these commands in java? The closes I got with running the command was
Process process = Runtime.getRuntime().exec("cmd /c start \"C:\\Program Files\\SmartBear\\SoapUI-5.2.1\\bin\\testrunner.bat\"-a-f'W:\\WebServices Migration Project\\crp5\\regression results W:\\WebServices Migration Project\\crp5\\CountryRetrievalCRP10X2Http-soapui-project.xml'");
But that gave some error with those other paths do you know what I would need to modify for this line to work?.
I tried just running the bat file that I made but that also didn’t work. I checked the file path, copied it directly. Saw this bit of code online: Cannot run program "CRP5RegressionTest.bat" (in directory "C:\Users\P621842\Desktop"): CreateProcess error=2, The system cannot find the file specified.
ProcessBuilder pb = new ProcessBuilder("CRP5RegressionTest.bat");
pb.directory(new File("C:\\Users\\P621842\\Desktop"));
Process p = null;
try {
p = pb.start();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
int exitStatus = p.waitFor();
} catch (InterruptedException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Here is how the batch file looks like.
@echo off
set SOAPUI_HOME=C:\Program Files\SmartBear\SoapUI-5.2.1\bin\
pushd %SOAPUI_HOME%
call testrunner.bat -a -f"W:\WebServices Migration Project\crp5\regression results" "W:\WebServices Migration Project\crp5\DFIAccountRetrievalCRP27x1-soapui-project.xml"
Thank,