Forum Discussion
- JHuntCommunity Hero
How are you determining whether it is running or not? By default, just calling exec or execute only returns a Process so you need to do something with that Process. There is no command prompt window shown.
Below is a way to see the output:
String line def p = "cmd /c C:\\temp\\hw.bat".execute() def bri = new BufferedReader (new InputStreamReader(p.getInputStream())) while ((line = bri.readLine()) != null) {log.info line}
INFO:C:\Program Files\SmartBear\SoapUI-5.4.0\bin>echo Hello World! INFO:Hello World!
- writerNew ContributorDoes anyone know how to execute a bat file from within a Goovy script Test Step in SoapUI?
- SmartBear_SuppoSmartBear Alumni (Retired)Hello,
You should be able to execute it from Groovy by running something along the lines of:
Runtime.runtime.exec("file.bat")
Regards,
Dain
eviware support - Ranjeeth_RajNew Contributor
I am trying to execute .bat file from SoapUI using groovy.
Scrip is executing successfully but bat file is not executed, I am using both type as below both are not working
- Runtime.runtime.exec("cmd /c C:\\My_docs\\Soap_UI_Report\\Data\\release_template\\extract.bat");
- def proc = "cmd /c C:/My_docs/Soap_UI_Report/Data/release_template/extract.bat".execute();
Related Content
- 3 years ago
Recent Discussions
- 2 days ago
- 3 days ago