3

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?

Ray Poward
  • 366
  • 5
  • 12

1 Answers1

0

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.

UBIK LOAD PACK
  • 33,980
  • 5
  • 71
  • 116
  • I'm not sure if it'll work for my case since I have to get a server response first to process it with this program and there are at least a dozen of SOAP samplers getting different responses in my test plans so passing responses between samplers might be difficult. – Ray Poward Oct 12 '12 at 06:00
  • I don't understand why you think it will be difficult. Any way using log file is not an option, as during load test they will be mixed – UBIK LOAD PACK Oct 13 '12 at 19:52
  • Would be a little easier just to add a postprocessor to the whole thread group, and extracting exec() output into a string might also be useful for beanshell preprocessors and assertions. However, OS Process Sampler works for me, so I'm marking this as an answer. Thanks for your help! – Ray Poward Oct 15 '12 at 07:57