You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by "Andrew Ralph Feller, afelle1" <af...@lsu.edu> on 2008/11/20 16:24:45 UTC

Skip remaining samples if an assertion fails but don't stop the Thread

We have a test that consists of 5 HTTP Requests to check whether the
throughput and relative error of a particular service.  When the test is
executed, we typically use 10 ­ 40 threads depending on whether we want a
long lasting or heavy load stress test.  After each HTTP Request, I use an
Assertion to check whether the HTTP request was successful or not.  I would
to selectively decide when a thread should skip the remaining HTTP requests
and restart the test; if either the first or second HTTP request fail, then
skip the remaining three, however I don¹t want to skip if any of the last
three HTTP requests fail.

1. HTTP Request on machine A (GET)
   - Response Assertion (check for form field)
   - Regular Expression Extractor
   * Would prefer to skip remaining HTTP Requests if this fails
2. HTTP Request to machine A (POST)
   - Response Assertion (check for multiple set-cookie headers)
   * Would prefer to skip remaining HTTP Requests if this fails
3. HTTP Request on machine B (GET)
   - Response Assertion (check for specific HTML content)
4. HTTP Request on machine C (GET)
   - Response Assertion (check for specific HTML content)
5. HTTP Request on machine D (GET)
   - Response Assertion (check for specific HTML content)

I would appreciate any help yall could provide!
Andrew
-- 
Andrew R. Feller, Analyst
Information Technology Services
200 Fred Frey Building
Louisiana State University
Baton Rouge, LA 70803
(225) 578-3737 (Office)
(225) 578-6400 (Fax)


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Skip remaining samples if an assertion fails but don't stop the Thread

Posted by sebb <se...@gmail.com>.
On 21/11/2008, Andrew Ralph Feller, afelle1 <af...@lsu.edu> wrote:
> Andrey,
>
>  Thanks!  I was starting to look into that, however I was stumped as I didn't
>  know about the ${JMeterThread.last_sample_ok}.
>

It's mentioned here:

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#If_Controller

and here

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#assertions

>  A-
>
>
>  On 11/21/08 2:26 AM, "Andrey Beznogov" <an...@googlemail.com> wrote:
>
>  > Hi,
>  >
>  > you could use the If controller.
>  >
>  > http://jakarta.apache.org/jmeter/usermanual/component_reference.html#If_Contro
>  > ller
>  >
>  > If an Assertion for some Sample fails, that Sample will be marked as
>  > failed. Using that, your test plan may be something like
>  >
>  > * 1.
>  > * If (${JMeterThread.last_sample_ok})
>  > * * 2.
>  > * * If (${JMeterThread.last_sample_ok})
>  > * * * 3.
>  > * * * 4.
>  > * * * 5.
>  >
>  > Regards,
>  > Andrey
>  >
>  > 2008/11/20 Andrew Ralph Feller, afelle1 <af...@lsu.edu>:
>  >> We have a test that consists of 5 HTTP Requests to check whether the
>  >> throughput and relative error of a particular service.  When the test is
>  >> executed, we typically use 10 ­ 40 threads depending on whether we want a
>  >> long lasting or heavy load stress test.  After each HTTP Request, I use an
>  >> Assertion to check whether the HTTP request was successful or not.  I would
>  >> to selectively decide when a thread should skip the remaining HTTP requests
>  >> and restart the test; if either the first or second HTTP request fail, then
>  >> skip the remaining three, however I don¹t want to skip if any of the last
>  >> three HTTP requests fail.
>  >>
>  >> 1. HTTP Request on machine A (GET)
>  >>   - Response Assertion (check for form field)
>  >>   - Regular Expression Extractor
>  >>   * Would prefer to skip remaining HTTP Requests if this fails
>  >> 2. HTTP Request to machine A (POST)
>  >>   - Response Assertion (check for multiple set-cookie headers)
>  >>   * Would prefer to skip remaining HTTP Requests if this fails
>  >> 3. HTTP Request on machine B (GET)
>  >>   - Response Assertion (check for specific HTML content)
>  >> 4. HTTP Request on machine C (GET)
>  >>   - Response Assertion (check for specific HTML content)
>  >> 5. HTTP Request on machine D (GET)
>  >>   - Response Assertion (check for specific HTML content)
>  >>
>  >> I would appreciate any help yall could provide!
>  >> Andrew
>  >> --
>  >> Andrew R. Feller, Analyst
>  >> Information Technology Services
>  >> 200 Fred Frey Building
>  >> Louisiana State University
>  >> Baton Rouge, LA 70803
>  >> (225) 578-3737 (Office)
>  >> (225) 578-6400 (Fax)
>  >>
>  >>
>  >> ---------------------------------------------------------------------
>  >> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  >> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  >>
>  >>
>  >
>  >
>
>  --
>  Andrew R. Feller, Analyst
>  Information Technology Services
>  200 Fred Frey Building
>  Louisiana State University
>  Baton Rouge, LA 70803
>  (225) 578-3737 (Office)
>  (225) 578-6400 (Fax)
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Skip remaining samples if an assertion fails but don't stop the Thread

Posted by "Andrew Ralph Feller, afelle1" <af...@lsu.edu>.
Andrey,

Thanks!  I was starting to look into that, however I was stumped as I didn't
know about the ${JMeterThread.last_sample_ok}.

A-

On 11/21/08 2:26 AM, "Andrey Beznogov" <an...@googlemail.com> wrote:

> Hi,
> 
> you could use the If controller.
> 
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#If_Contro
> ller
> 
> If an Assertion for some Sample fails, that Sample will be marked as
> failed. Using that, your test plan may be something like
> 
> * 1.
> * If (${JMeterThread.last_sample_ok})
> * * 2.
> * * If (${JMeterThread.last_sample_ok})
> * * * 3.
> * * * 4.
> * * * 5.
> 
> Regards,
> Andrey
> 
> 2008/11/20 Andrew Ralph Feller, afelle1 <af...@lsu.edu>:
>> We have a test that consists of 5 HTTP Requests to check whether the
>> throughput and relative error of a particular service.  When the test is
>> executed, we typically use 10 ­ 40 threads depending on whether we want a
>> long lasting or heavy load stress test.  After each HTTP Request, I use an
>> Assertion to check whether the HTTP request was successful or not.  I would
>> to selectively decide when a thread should skip the remaining HTTP requests
>> and restart the test; if either the first or second HTTP request fail, then
>> skip the remaining three, however I don¹t want to skip if any of the last
>> three HTTP requests fail.
>> 
>> 1. HTTP Request on machine A (GET)
>>   - Response Assertion (check for form field)
>>   - Regular Expression Extractor
>>   * Would prefer to skip remaining HTTP Requests if this fails
>> 2. HTTP Request to machine A (POST)
>>   - Response Assertion (check for multiple set-cookie headers)
>>   * Would prefer to skip remaining HTTP Requests if this fails
>> 3. HTTP Request on machine B (GET)
>>   - Response Assertion (check for specific HTML content)
>> 4. HTTP Request on machine C (GET)
>>   - Response Assertion (check for specific HTML content)
>> 5. HTTP Request on machine D (GET)
>>   - Response Assertion (check for specific HTML content)
>> 
>> I would appreciate any help yall could provide!
>> Andrew
>> --
>> Andrew R. Feller, Analyst
>> Information Technology Services
>> 200 Fred Frey Building
>> Louisiana State University
>> Baton Rouge, LA 70803
>> (225) 578-3737 (Office)
>> (225) 578-6400 (Fax)
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>> 
>> 
> 
> 

-- 
Andrew R. Feller, Analyst
Information Technology Services
200 Fred Frey Building
Louisiana State University
Baton Rouge, LA 70803
(225) 578-3737 (Office)
(225) 578-6400 (Fax)


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Skip remaining samples if an assertion fails but don't stop the Thread

Posted by Andrey Beznogov <an...@googlemail.com>.
Hi,

you could use the If controller.

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#If_Controller

If an Assertion for some Sample fails, that Sample will be marked as
failed. Using that, your test plan may be something like

* 1.
* If (${JMeterThread.last_sample_ok})
* * 2.
* * If (${JMeterThread.last_sample_ok})
* * * 3.
* * * 4.
* * * 5.

Regards,
Andrey

2008/11/20 Andrew Ralph Feller, afelle1 <af...@lsu.edu>:
> We have a test that consists of 5 HTTP Requests to check whether the
> throughput and relative error of a particular service.  When the test is
> executed, we typically use 10 ­ 40 threads depending on whether we want a
> long lasting or heavy load stress test.  After each HTTP Request, I use an
> Assertion to check whether the HTTP request was successful or not.  I would
> to selectively decide when a thread should skip the remaining HTTP requests
> and restart the test; if either the first or second HTTP request fail, then
> skip the remaining three, however I don¹t want to skip if any of the last
> three HTTP requests fail.
>
> 1. HTTP Request on machine A (GET)
>   - Response Assertion (check for form field)
>   - Regular Expression Extractor
>   * Would prefer to skip remaining HTTP Requests if this fails
> 2. HTTP Request to machine A (POST)
>   - Response Assertion (check for multiple set-cookie headers)
>   * Would prefer to skip remaining HTTP Requests if this fails
> 3. HTTP Request on machine B (GET)
>   - Response Assertion (check for specific HTML content)
> 4. HTTP Request on machine C (GET)
>   - Response Assertion (check for specific HTML content)
> 5. HTTP Request on machine D (GET)
>   - Response Assertion (check for specific HTML content)
>
> I would appreciate any help yall could provide!
> Andrew
> --
> Andrew R. Feller, Analyst
> Information Technology Services
> 200 Fred Frey Building
> Louisiana State University
> Baton Rouge, LA 70803
> (225) 578-3737 (Office)
> (225) 578-6400 (Fax)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>



-- 
diem perdidi

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org