Skip to content
  • ZipCode Api
  • Blog
  • About RedLine13
RedLine13
RedLine13
Primary Navigation Menu
Menu
  • Start Testing
  • Demo
  • Pricing
  • JMeter
  • Partners
  • Docs
    • Documentation Home
    • AWS Set Up for load testing
    • AWS Approval for Large Tests
    • PHP, NodeJS, Python Load Tests
    • Scalability
    • Jenkins Plugin Setup
    • Premium Features
    • Knowledge Base

How to for JMeter Duration Assertion

By: RedLine13

How to use the Duration Assertion to fail a test?

The Apache JMeter Duration Assertion documentation http://jmeter.apache.org/usermanual/component_reference.html#Duration_Assertion 

Definition: The Duration Assertion validates that each response is received within a given amount of time. Any response that takes longer than the given number of milliseconds (specified by the user) is recorded as a failed response.

Parameter Usage
Duration in milliseconds If the requests take longer than ms supplied, Sampler is considered failed
Apply to

  • Main and Sub-Samples
  • Main Samples Only
  • Sub-Samples Only

This is for use with samplers that can generate sub-samples,

e.g. HTTP Sampler with embedded resources

  1. Create your test plan

    • Here is an example which queries 4 URLS
    • Sample JMeter Test with 4 HTTP Samplers
  2. If you want to test performance of a single URL

    • Add duration assertion under the HTTP Sampler
    • Add Duration Sampler
  3. If you want to apply assertion to all Samplers

    • Add duration at same level
    • Duration Example as sibling
  4. Check it locally

    • We will use the single failure case and set it to 10ms, forcing it to fail in every iteration
    • We can see our test failing
    • Duration Assertion with Failure
  5. Run it on RedLine13

    • We can see error log showing output
    • Duration Assertion with Error Table
    • The error requests will display in Error Metrics graphs
    • Duration Assertion with Error graphs

 

 

 

 

2016-02-29
Previous Post: Help Wanted – Digital Marketing Customer Advocate
Next Post: New Features – Tests Started, Test Completed, Cumulative Graphs

Recent Posts

  • Order of Elements in JMeter
  • The JMeter Synthesis Report
  • Using the JMeter Plugins Manager
  • JMeter Rotating JTL Listener
  • Using Test Fragments in JMeter Tests

Related

  • Order of Elements in JMeter
  • The JMeter Synthesis Report
  • Using the JMeter Plugins Manager
  • JMeter Rotating JTL Listener
  • Using Test Fragments in JMeter Tests
  • Step-by-Step Guide to Testing with JMeter
  • Functional Testing vs Performance Testing
  • A Gentle Introduction to Load Testing
  • Using the JMeter Counter Element
  • Getting a “Grounded” Test to Launch

© RedLine13, LLC | Privacy Policy | Contract
Contact Us: info@redline13.com

Designed using Responsive Brix. Powered by WordPress.