3
votes

I have the following code in my beanshell postprocessor that executes a C# program and writes its output into Jmeter's console:

import it.sauronsoftware.base64.Base64;

prev.setDataEncoding("ANSI");
encoded = Base64.encode(prev.getResponseDataAsString());
print (exec("C:\\prog\\prog.exe decode " + encoded));

It works fast enough for me, but I want to pass the output from prog.exe to a string (and then output that string as response data). Is it possible to do it using beanshell postprocessor? If not, what would be the easiest way to do it?

1

1 Answers

0
votes

Use OS Process Sampler after each webservice, this sampler will handle the decoding of the response.

Note that this is exactly what you are doing here with the additional cost of Beanshell.

It has been introduced in JMeter 2.7 and allows you to run you C# program and get output as ResponseData.