Skip to content

Instantly share code, notes, and snippets.

@danielarrais
Created March 21, 2022 13:07
Show Gist options
  • Save danielarrais/412d20fd21e1350cfb9ca10e40f98d89 to your computer and use it in GitHub Desktop.
Save danielarrais/412d20fd21e1350cfb9ca10e40f98d89 to your computer and use it in GitHub Desktop.
JMeter types
// This code is JSR223 PreProcessor, it's changing post data replacing variable in POST DATA of request
String variableValue = vars.get("variableName");
String bodyData = sampler.getArguments().getArgument(0).getValue();
String newBodyData = bodyData.replace("variableName", variableValue);
sampler.getArguments().getArgument(0).setValue(newBodyData);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment