Question

I have an application that I am testing with JMeter. One of the tests calls for a REST request to be made, parse out a field from the response, and use that value as part of a new REST request. The complication is that in the second request, the XML payload needs a signature to be generated.

What I'd like to know is, is there a way to execute custom Java code in JMeter and have the resulting XML fill in the POST body of a JMeter HTTP request?

Était-ce utile?

La solution

You can use beanshell sampler or beanshell preprocessor sampler to call java code in jmeter.

Here you can implement signature generation using java(or add library jar to jmeter runtime) and assign the generated value to a reference variable and place the reference variable in Request Body. Check this Q&A for more information. You can find a excellent overview in Blazemeter Blog

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top