Reputation: 4332
JMeter provides a simple HTTP server, the HTTP Mirror Server (https://jmeter.apache.org/usermanual/component_reference.html#HTTP_Mirror_Server), which causes JMeter to simply mirror back any request that is sent to it.
Instead of mirroring a given request, is there a way for JMeter to accept a request and then, based on the request, execute a series of actions?
Upvotes: 0
Views: 2543
Reputation: 168002
You can use i.e. a Beanshell Sampler which allows execution of arbitrary Beanshell (or Java) code so you should be able to develop logic parsing incoming request and conditionally switch to this or that actions branch.
Test plan outline
In Beanshell Sampler place custom code which will listen to incoming HTTP connections and set a JMeter variable basing on outcome via vars.put method
In the If Controller you can put a condition checking variable value like
"${myVariable}"=="foo"
"${myVariable}"=="bar"
See How to use BeanShell: JMeter's favorite built-in component for detailed information on Beanshell scripting and pre-defined variables and If Controller documentation entry for information on setting correct conditions.
Upvotes: 1