0
votes

Why im getting this exception in POST request?

I'm trying to login with JMeter, but no matter i do it won't work. I have Cookie Manager HC4CookieHandler/standard, Regular Expression Extractor too jsfViewState/name="javax.faces.ViewState" id="javax.faces.ViewState" value="(.+?)" checked Main and sub-samples/Body.

But still in POST login i'm getting this.

What i'm missing? Is it in regular expression value? javax.facesViewState has value "-2918962836342094824:7411539759421041608", but doesn't range "(.+?)" should catch it?

1

1 Answers

0
votes

Looking into your request details it appears that you're sending ${jsfViewstate} instead of the numeric value so your Regular Expression Extractor doesn't seem to be capturing it from the response for some reason. The reasons could be in:

  1. Parent sampler doesn't contain the javax.faces.ViewState input, it comes in sub-samples. In that case you will need to switch Regular Expression Extractor scope to "Main sample and sub-samples"
  2. Response markup assumes that "ViewState" input is broken into 2 lines so your single-line regular expression cannot match it.

Some suggestions:


You can consider using XPath Extractor as an alternative.

  1. Add XPath Extractor as a child of the first request
  2. Configure it as follows:
    • Apply to: Main sample and sub-samples
    • Check Use Tidy
    • Reference Name: anything meaningful, i.e. jsfViewState
    • XPath query: //input[@id='javax.faces.ViewState']/@value
  3. Disable (or delete) your Regular Expression Extractor
  4. Refer extracted value as ${jsfViewState} where required

XPath Extractor Configuration:

XPath Extractor Configuration

Demo:

XPath Demo