jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shay Ginsbourg <sginsbo...@gmail.com>
Subject Re: Making HTTP 404 a test success
Date Fri, 06 Jul 2012 16:29:48 GMT
Should add a BeanShell Post-Processor:


if  (prev.getResponseCode().equals("404") == true) {
    prev.setResponseOK();

    /* the same is
    prev.setSuccessful(true);
    prev.setResponseCodeOK();
    prev.setResponseMessageOK();
    */
}


regards.
Shay



On Fri, Jul 6, 2012 at 7:13 PM, Richard Gaywood <richardgaywood@gmail.com>wrote:

> Hi list,
>
> I'm load testing a RESTful web service. One of my scenarios is a GET which
> receives no data, followed by a PUT to populate the web service. The GET,
> naturally, returns 404. However, JMeter insists on tagging this as a failed
> sampler, which is messing up my test stats and meaning I can't catch
> genuine errors in a "errors only" results tree.
>
> How can I convince JMeter to regard 404 as a successful sample result?
>
> I tried adding a Response Assertion with config to state that "Response
> Code", "Contains", "404" (with "Ignore Status" ticked), but the sample
> still fails. I don't understand why; reading the JMeter manual makes it
> sound like that should work. The assertion result says
>
> Assertion error: false
> Assertion failure: true
> Assertion failure message: Test failed: code expected to equal /
> ****** received  : 404[[[ ]]]
> ****** comparison: 404[[[
> ]]]
> /
>
>
> Any help you can render would be gratefully received!
>
> [image: Inline image 1]
>



-- 

 Regards,


Shay Ginsbourg

Regulatory & Testing Affairs Consultant


WWW.GINSBOURG.COM


Providing Regulatory, Medical & Performance Testing services since 2008:


* IEC 62304 Medical Device Software Life Cycle

* IEEE 829 Software Test Documentation

* ISO 14971 Medical Device Risk Management

* FDA 21 CFR Part 11 Software Validation

* IEC 60601-1:2005 3rd ED PEMS - Medical Electrical Equipment

* End-to-end verification, validation, and testing (VV&T)

* FDA and CE submissions

* Open source free testing tools implementation

* Functionality and regression testing

* Software Performance & Load testing

* Software Testing Advanced Automation

* Medical Software Verification & Validation

* Medical Device Verification & Validation

* Medical Device Regulatory Submission

* Organizational Regulatory Qualification


Formerly QA Manager of LoadRunner at Mercury Interactive


M.Sc. cum laude in Bio-Medical Engineering

M.Sc. in Mechanical Engineering


Work:   +972(0)3-5185873

Mobile:  +972(0)54-6690915


Email: sginsbourg@gmail.com


Visit my personal page on LinkedIn at:
http://www.linkedin.com/in/shayginsbourg


Please consider your environmental responsibility before printing this
e-mail.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message