Forum Discussion

Santhy's avatar
Santhy
New Contributor
2 years ago

How to get the command line logs in SoapUI using groovy script?

Hi,

I am running an exe from SoapUI application using groovy script. Below is the code snippet which I got from the community and it works for me.

(https://community.smartbear.com/t5/SoapUI-Open-Source-Questions/SOAPUI-Groovy-to-run-exe-files/td-p/217273)

But I am not getting any updates/progress of the command line execution in SoapUI.

Can some one help me to solve this. I need to get the whole command line logs in SoapUI using groovy script

 

import java.io.InputStreamReader

ProcessBuilder pb = new ProcessBuilder("cmd","/c","C:\\dummy.exe")
pb.redirectErrorStream(true)
Process p = pb.start()
InputStreamReader isr = new InputStreamReader(p.inputStream)
char[] cbuf = new char[1024]; //read 1024 characters, increse to higher amount if necessary
isr.read(cbuf);
log.info(new String(cbuf))

No RepliesBe the first to reply