Does any one have a clue why jmeter is passing empty POST after I modify request body.
I have a request with massive JSON in a body (unfortunately I can't paste an image with it)
I have BSF PreProcessor attached to this request:
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.jmeter.config.Argument;
import org.apache.jmeter.config.Arguments;
import org.apache.jmeter.samplers.Sampler;
import org.apache.jmeter.protocol.http.sampler.HTTPSampler;
Sampler sampler = ctx.getCurrentSampler();
String param = sampler.getArguments().toString();
String replacerMCI = vars.get("vMainCaseId");
Pattern r = Pattern.compile("(?<=mainCaseId\":\")(\\d{2,})");
Matcher m = r.matcher(param);
String paramRep = m.replaceAll(replacerMCI);
Argument arg = new Argument("", paramRep);
Arguments argList = new Arguments();
argList.addArgument(arg);
sampler.setArguments(argList);
When I'm logging to console to see if the argument is modified I can see it has a new value but when I start the test I see that POST is send with empty data.
POST https://servername:9443/teamworks/ajaxCoach
POST data:
Cookie Data:
[some cookie data]