On 2 October 2013 09:11, Nicola Ambrosetti Brolin
<[email protected]> wrote:
> I have several samplers in a thread group, each retrieving a piece of
> information. I then need to validate the consistency of the results from
> two (or more) different samplers. In particular I need to assert whether a
> field in one sampler response equals a field in the JDBC response. What is
> the best way to do something like that?
Use Regex Post-Processor to extract the information and store it in
variables, one for each sample.
Then use Response Assertion to compare the JMeter variables against each other.
Provide one variable using the variable name, and the other as the
text to match using the ${varname} syntax.
> I have thought about adding a beanshell postprocessor to each sampler in
> order to extract the field value from each sample and save it in two
> variables and then adding a beanshell assertion that accesses those
> variables, but I wonder if there is a more direct approach.
See above.
> In the JMeter API documentation I could not see anything to access another
> sampler response other than the previous one.
You cannot do so.
>
> Any thoughts?
>
> Nicola
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]