Santhy
3 years agoNew Contributor
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.
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))