hi
for any error or just the specfic error that you are looking for?
If specific error that you seem to have mentioned then you could try adding
a BeanShell listener(scoped to the if statement) to set the variable.

http://jakarta.apache.org/jmeter/api/org/apache/jmeter/samplers/SampleResult.html#getAssertionResults()
The listener could check which assertion failed and set the variable
accordingly. You could also have an if controller that checks the value of
this variable and evaluates this for every child so that the other requests
dont get executed . But im not sure whether this all happens synchronously
(calling the listener after the sampler and before calling the next sampler)
which would be needed for this to work. give it a try and see.
Note that your assertions remain the same you dont have to change what
asserter you are using


regards
deepak


On Thu, Jan 20, 2011 at 8:00 AM, Jens Müller <jen...@hotmail.com> wrote:

>
> Hi,
>
> I would like to have a test that logs in, does some actions for a specified
> runtime. If during the runtime an assertion fails (session expired), the
> virtual users should go back and login again.
>
> How can I achieve this in the nicest way?
>
> I could use the following, but I don't know how to set a variable if the
> assertion fails for example
> runtime controller
>  if controller (if no session)
>    login
>    beanshell set session=true
>  request1
>    assertion1
>  request2
>    assertion2
>  request3
>  ...
>
> I probably (?) would then need to use bean shell assertions that set the
> session variable to false if they find out that it has expired. In the next
> loop of the runtime controller the test would then login again.
>
> I don't like this solution as I cannot make use of the exisiting JMeter
> assertions (response assertion) but would need to code it myself in all the
> beanshell assertions, only to be able to set a variable. Maybe I could
> access the assertion results form a post processor - somewhat better except
> it fills my tree with more and more elements.
>
> Another problem with this approach is that I use module controllers to re
> use elements like login in a way that login must not be child element of my
> test case's runtime controller...
>
> In fact what I would need is a "On error goto x" and "resume" construct
> which would jump to login in case of this specific error. I guess this is
> not foreseen, right?
>
> Thank you,
> Jens
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscr...@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-h...@jakarta.apache.org
>
>

Reply via email to