Could not handle View/state and Event validation in Jmeter Load testing

You can handle dynamic POST parameters between requests in JMeter very easily. For viewstate and eventvalidation, add two regex extractors to your web load test.

Name: Regex Extractor - ViewState
Reference Name: v
Regular Expression: name="__VIEWSTATE" id="__VIEWSTATE" value="(.+?)"
Template: $1$
Match No.(0 for Random): 1

and

Name: Regex Extractor - EventValidation
Reference Name: e
Regular Expression: name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="(.+?)"
Template: $1$
Match No.(0 for Random): 1

After your recording you have to edit every HTTP Request in your Recording Controller by replacing the values of __VIEWSTATE and __EVENTVALIDATION with ${v} or ${e}.

This will effectively pass the viewstate and eventvalidation of the latest response in your next request.


You need to use one of the following PostProcessors in order to extract VIEWSTATE and EVENTVALIDATION values and get them converted to JMeter variables:

See ASP.NET Login Testing with JMeter guide for real-life example and sample configuration of the extractors.

Also don't forget to add HTTP Cookie Manager to your test plan to represent browser cookies, deal with cookie-based authentication and simulate browser session.


You should check when view-State and _Event-Validation parameters changes.(you can easily do it with right click and view page source). As these ones identify at which page you are.

In my last script I had 23 different places where viewState changes and I had to extract and change it for 23 times. So no one can answer where you should change them as we do not see the responses and the app you are testing.


Comments

  1. Rizzo

    • 2020/12/8

    You can handle dynamic POST parameters between requests in JMeter very easily. For viewstate and eventvalidation, add two regex extractors 

  2. Adonis

    • 2015/4/24

    And as its a .Net application server will do some authentication using view-State and _Event-Validation. But to handle that thing I am not sure from which request I need to fetch those 2 Parameter and pass it to which request, as this scenario is a combination of GET and POST requests.Here are the order of requests.

  3. Max

    • 2016/12/30

    Essentially, JMeter is sending a stale value for VIEWSTATE since it is If you run your test plan now, you will see that it is still not 

  4. Petit

    • 2021/4/14

    Could not handle View/state and Event validation in Jmeter Load testing I am currently load testing a .Net web application. In which scenario is like, user will login and will do certain steps of navigation then he/she will fill one evaluation form, submit it and then

  5. Walker

    • 2019/10/2

    Extract ViewState value from the response using a suitable JMeter You need to use correlation to store ViewState, EventValidation, 

  6. Pellegrini

    • 2019/10/20

    I'm trying to load test the ASP.net website that I had developed using JMeter. The reason for using JMeter is that its an open source tool having lots of fame and credibility. I referred to this link in order to take care of viewstate which is a typical feature of ASP.net. However my requirements are not that simple as stated there.

  7. Bowen

    • 2016/3/6

    Testing ASP. This can be achieved by creating two post Processor elements of the type NET pages: +PREVIOUSPAGE, +VIEWSTATE, __EVENTVALIDATION .

  8. Brown

    • 2021/1/4

    It seems that the JSF ViewState value is getting hard-coded when I record the requests due to which when the steps are played the new ViewState values generated from the server do not match. I tried using solutions given in these links to handle ViewState values: Testing a JSF Application with JMeter; How to handle JSF viewstate with jmeter

  9. Franco

    • 2018/4/6

    In our case we have one more dynamic parameter which is called __EVENTVALIDATION which can be handled using the same approach. Repeat these “ 

  10. Collin

    • 2019/12/10

    Load Testing is among the most critical of these tests as it helps to assess the performance and capability of an app to handle the estimated user load. Load testing with JMeter. There are several tools available in the market for load testing. The most widely used are JMeter, WebLOAD, NeoLoad, Loadster, Load Impact, and Load Runner. Apache

  11. Landry

    • 2020/11/7

    JMeter, the most popular open source performance testing tool, can In my case, im able to extract viewstate and eventvalidation from 

  12. Tyler

    • 2016/5/14

    Tags: JMeter, Load Testing, Performance Testing, Stress Load Testing Abstract The targeted audience of this article, who wants to know the necessity of doing performance testing during the mobile and web application development so that when the user database gets increased many factors such as response time, throughput and hits per second

  13. Jackson

    • 2017/12/12

    NET web site using JMeter It is similar to sending POST data to any other I have passed the view state event validation and eventtarget values in the.

  14. Armando

    • 2015/7/2

    Stress Testing: Every web server has a maximum load capacity. When the load goes beyond the limit, the web server starts responding slowly and produce errors. The purpose of the Stress Testing is to find the maximum load the web server can handle. The figure below shows how JMeter load Testing simulates the heavy load:

  15. Palumbo

    • 2016/11/30

    One example of an item that might be stored in the __VIEWSTATE field is the text of a Button control. If a user clicks the button, the Button_Click event 

  16. Kace

    • 2015/10/29

    As you can see, the assertion failed because the expected value doesn't match the received one, which is “Mary Gay”. If you update the JSON 

Comments are closed.

Recent Posts