You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Ed Young <ej...@summitbid.com> on 2011/11/01 21:26:44 UTC

Response assertion does not assert http 1.1 404

I have a simple HTTP get request with a View Results Tree and a Response
Assertion. Even though the request returns 404 the response assertion
fails. It seems pretty straight forward, so I can't see what I'm doing
incorrectly.

I've tried all the HTTP Request Implementations.

The response assertion is
Response Field to Test is
Response Code
Equals
404


The request returns
Thread Name: Component Thread Group 1-1
Sample Start: 2011-11-01 13:39:39 MDT
Load time: 201
Latency: 201
Size in bytes: 302
Headers size in bytes: 185
Body size in bytes: 117
Sample Count: 1
Error Count: 1
*Response code: 404*
Response message: Not Found

Response headers:
HTTP/1.1 404 Not Found
Date: Tue, 01 Nov 2011 19:39:40 GMT
Content-Type: application/json;charset=UTF-8
Keep-Alive: timeout=15
Connection: Keep-Alive
Transfer-Encoding: chunked


HTTPSampleResult fields:
ContentType: application/json;charset=UTF-8
DataEncoding: UTF-8



-- 
- Ed

Re: Response assertion does not assert http 1.1 404

Posted by Ed Young <ej...@summitbid.com>.
To answer my own question:

*Are we saying that JMeter will look at the status and fail it if it's in
the 4xx and 5xx range because those are hard failures, even if we are
asserting "I'm looking for a 404 from this request"?*
*
I think the answer is "Yes", which is why we choose "Ignore Status" so it
doesn't fail based either of the 4xx (or 5xx) status.

got it.
*
On Tue, Nov 1, 2011 at 3:56 PM, Ed Young <ej...@summitbid.com> wrote:

> Thanks.
>
> I *did* read the user's guide before posting this, and the "ignore status"
> section,  but I guess I did not quite get it.
>
> Not sure I that I do now either.
>
> from
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Response_Assertion
> Instructs JMeter to set the status to success initially.
>
> The overall success of the sample is determined by combining the result of
> the assertion with the existing Response status. When the Ignore Status
> checkbox is selected, the Response status is forced to successful before
> evaluating the Assertion.
> HTTP Responses with statuses in the 4xx and 5xx ranges are normally
> regarded as unsuccessful. The "Ignore status" checkbox can be used to set
> the status successful before performing further checks. Note that this will
> have the effect of clearing any previous assertion failures, so make sure
> that this is only set on the first assertion.
>
> *Are we saying that JMeter will look at the status and fail it if it's in
> the 4xx and 5xx range because those are hard failures, even if we are
> asserting "I'm looking for a 404 from this request"?
> *
>
>
> On Tue, Nov 1, 2011 at 3:20 PM, sebb <se...@gmail.com> wrote:
>
>> On 1 November 2011 21:16, Ed Young <ej...@summitbid.com> wrote:
>> > 200 works just fine. That is, if I use the Response Assertion set to
>> assert
>> > 200 on a request that returns 200, it behaves correctly. If I change
>> that
>> > same assertion to 209, for example it fails as it should.
>> >
>> > However 404 fails no matter what I set the pattern matching rules to be.
>> >
>> > this is killing me!
>>
>>
>> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Response_Assertion
>>
>> "Ignore status"
>>
>> > On Tue, Nov 1, 2011 at 2:26 PM, Ed Young <ej...@summitbid.com> wrote:
>> >
>> >> I have a simple HTTP get request with a View Results Tree and a
>> Response
>> >> Assertion. Even though the request returns 404 the response assertion
>> >> fails. It seems pretty straight forward, so I can't see what I'm doing
>> >> incorrectly.
>> >>
>> >> I've tried all the HTTP Request Implementations.
>> >>
>> >> The response assertion is
>> >> Response Field to Test is
>> >> Response Code
>> >> Equals
>> >> 404
>> >>
>> >>
>> >> The request returns
>> >> Thread Name: Component Thread Group 1-1
>> >> Sample Start: 2011-11-01 13:39:39 MDT
>> >> Load time: 201
>> >> Latency: 201
>> >> Size in bytes: 302
>> >> Headers size in bytes: 185
>> >> Body size in bytes: 117
>> >> Sample Count: 1
>> >> Error Count: 1
>> >> *Response code: 404*
>> >> Response message: Not Found
>> >>
>> >> Response headers:
>> >> HTTP/1.1 404 Not Found
>> >> Date: Tue, 01 Nov 2011 19:39:40 GMT
>> >> Content-Type: application/json;charset=UTF-8
>> >> Keep-Alive: timeout=15
>> >> Connection: Keep-Alive
>> >> Transfer-Encoding: chunked
>> >>
>> >>
>> >> HTTPSampleResult fields:
>> >> ContentType: application/json;charset=UTF-8
>> >> DataEncoding: UTF-8
>> >>
>> >>
>> >>
>> >> --
>> >> - Ed
>> >>
>> >
>> >
>> >
>> > --
>> > - Ed
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
>> For additional commands, e-mail: user-help@jmeter.apache.org
>>
>>
>
>
> --
> - Ed
>



-- 
- Ed

Re: Response assertion does not assert http 1.1 404

Posted by Ed Young <ej...@summitbid.com>.
Thanks.

I *did* read the user's guide before posting this, and the "ignore status"
section,  but I guess I did not quite get it.

Not sure I that I do now either.

from
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Response_Assertion
Instructs JMeter to set the status to success initially.

The overall success of the sample is determined by combining the result of
the assertion with the existing Response status. When the Ignore Status
checkbox is selected, the Response status is forced to successful before
evaluating the Assertion.
HTTP Responses with statuses in the 4xx and 5xx ranges are normally
regarded as unsuccessful. The "Ignore status" checkbox can be used to set
the status successful before performing further checks. Note that this will
have the effect of clearing any previous assertion failures, so make sure
that this is only set on the first assertion.

*Are we saying that JMeter will look at the status and fail it if it's in
the 4xx and 5xx range because those are hard failures, even if we are
asserting "I'm looking for a 404 from this request"?
*

On Tue, Nov 1, 2011 at 3:20 PM, sebb <se...@gmail.com> wrote:

> On 1 November 2011 21:16, Ed Young <ej...@summitbid.com> wrote:
> > 200 works just fine. That is, if I use the Response Assertion set to
> assert
> > 200 on a request that returns 200, it behaves correctly. If I change that
> > same assertion to 209, for example it fails as it should.
> >
> > However 404 fails no matter what I set the pattern matching rules to be.
> >
> > this is killing me!
>
>
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Response_Assertion
>
> "Ignore status"
>
> > On Tue, Nov 1, 2011 at 2:26 PM, Ed Young <ej...@summitbid.com> wrote:
> >
> >> I have a simple HTTP get request with a View Results Tree and a Response
> >> Assertion. Even though the request returns 404 the response assertion
> >> fails. It seems pretty straight forward, so I can't see what I'm doing
> >> incorrectly.
> >>
> >> I've tried all the HTTP Request Implementations.
> >>
> >> The response assertion is
> >> Response Field to Test is
> >> Response Code
> >> Equals
> >> 404
> >>
> >>
> >> The request returns
> >> Thread Name: Component Thread Group 1-1
> >> Sample Start: 2011-11-01 13:39:39 MDT
> >> Load time: 201
> >> Latency: 201
> >> Size in bytes: 302
> >> Headers size in bytes: 185
> >> Body size in bytes: 117
> >> Sample Count: 1
> >> Error Count: 1
> >> *Response code: 404*
> >> Response message: Not Found
> >>
> >> Response headers:
> >> HTTP/1.1 404 Not Found
> >> Date: Tue, 01 Nov 2011 19:39:40 GMT
> >> Content-Type: application/json;charset=UTF-8
> >> Keep-Alive: timeout=15
> >> Connection: Keep-Alive
> >> Transfer-Encoding: chunked
> >>
> >>
> >> HTTPSampleResult fields:
> >> ContentType: application/json;charset=UTF-8
> >> DataEncoding: UTF-8
> >>
> >>
> >>
> >> --
> >> - Ed
> >>
> >
> >
> >
> > --
> > - Ed
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
>


-- 
- Ed

Re: Response assertion does not assert http 1.1 404

Posted by sebb <se...@gmail.com>.
On 1 November 2011 21:16, Ed Young <ej...@summitbid.com> wrote:
> 200 works just fine. That is, if I use the Response Assertion set to assert
> 200 on a request that returns 200, it behaves correctly. If I change that
> same assertion to 209, for example it fails as it should.
>
> However 404 fails no matter what I set the pattern matching rules to be.
>
> this is killing me!

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

"Ignore status"

> On Tue, Nov 1, 2011 at 2:26 PM, Ed Young <ej...@summitbid.com> wrote:
>
>> I have a simple HTTP get request with a View Results Tree and a Response
>> Assertion. Even though the request returns 404 the response assertion
>> fails. It seems pretty straight forward, so I can't see what I'm doing
>> incorrectly.
>>
>> I've tried all the HTTP Request Implementations.
>>
>> The response assertion is
>> Response Field to Test is
>> Response Code
>> Equals
>> 404
>>
>>
>> The request returns
>> Thread Name: Component Thread Group 1-1
>> Sample Start: 2011-11-01 13:39:39 MDT
>> Load time: 201
>> Latency: 201
>> Size in bytes: 302
>> Headers size in bytes: 185
>> Body size in bytes: 117
>> Sample Count: 1
>> Error Count: 1
>> *Response code: 404*
>> Response message: Not Found
>>
>> Response headers:
>> HTTP/1.1 404 Not Found
>> Date: Tue, 01 Nov 2011 19:39:40 GMT
>> Content-Type: application/json;charset=UTF-8
>> Keep-Alive: timeout=15
>> Connection: Keep-Alive
>> Transfer-Encoding: chunked
>>
>>
>> HTTPSampleResult fields:
>> ContentType: application/json;charset=UTF-8
>> DataEncoding: UTF-8
>>
>>
>>
>> --
>> - Ed
>>
>
>
>
> --
> - Ed
>

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


Re: Response assertion does not assert http 1.1 404

Posted by Ed Young <ej...@summitbid.com>.
200 works just fine. That is, if I use the Response Assertion set to assert
200 on a request that returns 200, it behaves correctly. If I change that
same assertion to 209, for example it fails as it should.

However 404 fails no matter what I set the pattern matching rules to be.

this is killing me!

On Tue, Nov 1, 2011 at 2:26 PM, Ed Young <ej...@summitbid.com> wrote:

> I have a simple HTTP get request with a View Results Tree and a Response
> Assertion. Even though the request returns 404 the response assertion
> fails. It seems pretty straight forward, so I can't see what I'm doing
> incorrectly.
>
> I've tried all the HTTP Request Implementations.
>
> The response assertion is
> Response Field to Test is
> Response Code
> Equals
> 404
>
>
> The request returns
> Thread Name: Component Thread Group 1-1
> Sample Start: 2011-11-01 13:39:39 MDT
> Load time: 201
> Latency: 201
> Size in bytes: 302
> Headers size in bytes: 185
> Body size in bytes: 117
> Sample Count: 1
> Error Count: 1
> *Response code: 404*
> Response message: Not Found
>
> Response headers:
> HTTP/1.1 404 Not Found
> Date: Tue, 01 Nov 2011 19:39:40 GMT
> Content-Type: application/json;charset=UTF-8
> Keep-Alive: timeout=15
> Connection: Keep-Alive
> Transfer-Encoding: chunked
>
>
> HTTPSampleResult fields:
> ContentType: application/json;charset=UTF-8
> DataEncoding: UTF-8
>
>
>
> --
> - Ed
>



-- 
- Ed