JMeter Error Checking (Assertions) and Dynamic Requests (Extraction)
Why Stack Overflow recommends it
Stack Overflow users link it when answering JMeter questions about capturing tokens or parameters from one response and reusing them in the next request, such as login and session handling.
Recommended by 2 people across 2 different months, 2013 to 2016.
What it is
A short JMeter tutorial from BlazeMeter's channel showing how to add assertions for error checking and how to use regular expression extractors to build dynamic requests. It walks through capturing values from a response and passing them into later requests in a test script.
What people said
Recommends Ophir Prusak · 2013-10 · Stack Overflow · on “Jmeter. Login stress-testing”
Cookies should work fine if you add a an HTTP cookie mananger. You need to use a regular expression to capture the authentication tokens if you want to pass them as a variable to the next request. If this is an ASP.NET application here's a great tutorial: [LINK] If not, here a video on youtube that also covers the general scenario of extracting parameters to use for future requests: [this video]
Recommends Jo_ · 2016-03 · Stack Overflow · on “Unable to test login using jmeter”
I know this is an old post, but I've been struggling with this exact same query, so I've decided to post my answer in case it helps anyone - it worked first time for me. So after requesting the login page for my site, the following csrf token is embedded in the html response; <input type="hidden" name="csrfToken" value="fe5a48ebda7b98cbbf885b4a220ebe0c23b11125-1459096615520-1ac64aa945986cb1bd318d9c"/> So when making the initial request for the login page, instead of using a Regular Expression Extractor, if the token is in the body of the HTML response, use an XPath Extractor instead. If your response is not XML/XHTML compliant then tick the 'use tidy' checkbox. For reference name add the ref
Cites yes4me · 2014-07 · Stack Overflow · on “Regular expression (.+?) in JMeter”
I am used to Regex in Java, but was confused when I saw them used in JMeter at [this video] What does (.+?) mean? Is there a difference between regex (.+?) and (.*)? Is JMeter regex "$1$" the equivalent to Java regex "$1"? According to Apache Regex ( [LINK] ), it appears to be the same. Is that true?