May I suggest an additional approach?
Create a Switch Controller to select a particular "child" sampler on the
basis of a numeric control value. [Should be easy enough to use the
Interleave or Random controller as the basis for this.]
With one child the Controller would function as an IF statement; with two,
it would be equivalent to IF/ELSE.
There would need to be some way to pick up the value of the last assertion
for the thread (perhaps assertions could be extended to store their result
in a specified thread variable?). And TRUE/FALSE would need to be
interpreted as 1 and 2 (or perhaps 0 and 1).
Your specific test could then be implemented as:
- HTTP sampler
- Assertion (saved in ${assert_1})
- Conditional controller on ${assert_1}
- - Simple Controller (if True)
- - - Sample etc
- - Simple Controller (if False) - optional
This would not be as convenient to use for some test scenarios, but it
should be reasonably easy to implement.
Just a thought.
--
The opinions expressed herein are my own, and are not necessarily endorsed
by my employer ...
-----Original Message-----
From: Matt Innes [mailto:[EMAIL PROTECTED]
Sent: 04 September 2003 10:26
To: [EMAIL PROTECTED]
Subject: Conditional Controller
Hi,
Case for extending JMeter:
I have need for conditional control logic. I am writing load test plans
for www.assertahome.com property searching. If the name of a town is
entered, if it is an exact match for one in the database, the property
search will be executed immediately. In the event the town name matches
multiple locations, a town selection screen will be presented. I need to
be able to trap the case where the selection screen is presented and
generate an additional request to specify the town. I have scanned the
archive and have found a couple of requests for something similar,
generally replied to with a "don't think one exists".
Proposed Extension:
Create a logic controller that may contain samplers (ordered) and
assertions (in scope, but order unimportant). The samplers are executed
in order, with the assertions checked after each execution. The
controller returns as soon as the first assertion fails. I am unsure as
to how sub-controllers would be best handled. Should the assertions be
checked after the completion of the controller or after the exectuion of
each sampler (if this is possible)?
I would appreciate a sanity check of the approach, as this is my first
attempt to extend JMeter.
Many thanks,
Matt Innes.
Matt Innes ([EMAIL PROTECTED]),
Technology Team,
asserta home
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]