Ask a Question

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

Santhy
New 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.

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

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))

0 REPLIES 0
cancel
Showing results for 
Search instead for 
Did you mean: