New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow passing of jmeter variables in post data #2045
Comments
Sebb (migrated from Bugzilla): If it is not working for you, please attach a test case to this issue. |
Ravi Challapalli (migrated from Bugzilla):
Tried with JMeter 2.3.4 version which also did not work. |
Sebb (migrated from Bugzilla):
JMeter has never supported variable substitution in external files, only in fields on the Gui screen.
|
@pmouawad (migrated from Bugzilla): |
@pmouawad (migrated from Bugzilla): |
Chris Cooper (Bug 43850):
I recently modified source code to enable me to insert variables into post data
quite easily actually. In HTTPSampler when sending post data and iterating
through the GUI arguments just changed the code to look something like this:
while (args.hasNext()) {
HTTPArgument arg = (HTTPArgument) args.next().getObjectValue();
JMeterContextService.getContext().getVariables().get(varName);
// this variable isn't defined or this wasn't actually a variable
if (val == null)
val = arg.getValue();
}
contentEncoding);
}
This allows for a variable defined by JMeter to be inserted, particularly useful
for multiple threads needing different values in a URL and if the variable
doesn't exist it just keeps the value in.
OS: All
Duplicated by:
The text was updated successfully, but these errors were encountered: