0
votes

I am trying to automate testing of a web application.
I have recorded the test using JMeter proxy template (JMeter version is 3.2) and couple of times when I ran the test in the JMeter it ran properly but after sometime only some part runs properly.

Following are the steps I am doing:

  1. Hitting the URL

  2. Logging into the application

  3. changing some feature in the application

and so on.

All the steps ran perfectly first few times but then after that only till login everything runs properly.
Just to be sure I tried passing the jsessionid from the first request to the next requests using the Regular "Expression Extractor". I can see in the View Results Tree that jsessionid is passed properly but next page after the step two still takes me into the login screen.

Any help will be very much appreciated.
I have attached screenshot for better understanding:

enter image description here

The response header of logged in page includes a sessionid which is used by another request while logging in.
All the sessionID are properly maintained still after logging in the next page takes me to the login page instead displaying what was done next in the recording.

1

1 Answers

0
votes

When it comes to load testing of JSF-based web applications you need to take care at least of the following dynamic parameters:

  1. JSESSIONID
  2. javax.faces.Viewstate

JSESSIONID is a normal HTTP cookie so it is quite enough to add a HTTP Cookie Manager to deal with it

javax.faces.Viewstate is client state management mechanism which also acts as a security token to verify user's origin. So you will need to properly correlate it, i.e. extract from previous response using one of JMeter PostProcessors, store into a JMeter Variable and add as a parameter to the next request. Remember to do this for each and every request.

There might be more application specific dynamic parameters, the easiest way of detecting them is recording the same request (or scenario) 2 times, compare the recorded scripts, detect and work around the differences.