1
votes

I am using Jmeter(2.3.2) to create script for one of my application with a scenario which has flow for 4 to 5 pages. I have recorded the script using HTTP Proxy Server. The scripts has been generated successfully under Thread Group >> Recording Controller.

After running the scripts (Threads- 1, Ramp Up period - 1, Loop Count - 1 ), below are the observations I noted in View Results Tree:

  1. The Result Tree view shows all as Checked(Green) - OK
  2. The Sample result for all screens shows Error Count as 0 - OK
  3. But in the response tab when I try to view the results by using 'Render Html' response data - the response data shows the same response for all the requests.

I am getting the response data of the first request for all the other requests.

I am not sure, whether the Jmeter script generated is functional or not? What is the cause for getting the same response data for all the requests?

Please, can anyone let me know what may the issue?

2

2 Answers

2
votes

I bet that the same page you're observing is a kind of login page or dashboard which is accessible by unauthenticated user.

First of all make sure that you have HTTP Cookie Manager added to your test plan. It represents browser cookies and deals with user sessions and cookie-based authentication.

If it doesn't resolve your issue the problem is bigger and you will need to do some extra stuff. Modern web applications use multiple mechanisms of current state of things storing and managing, security enhancements and so on. From JMeter's point of view it results in dynamic mandatory parameters. The process of these dynamic parameters extraction from previous request and adding them to next request is called "correlation". So you need to do the following:

  1. Detect which parameters being sent by a recorded script are dynamic. The easiest way is to record the same scenario several times and inspect request bodies to see what is being static and what changes.
  2. Once you figure out which parameters are "interesting" you need to locate them in the first response body/headers/etc.
  3. As soon as you have identified what necessary parameters are and where they live you need to use one of JMeter's PostProcessors to extract required values from previous response and save them to JMeter Variables
  4. Once you have a JMeter Variable it can be used wherever required.

Depending on response data type the most commonly used JMeter's Post Processors which provide correlation capabilities are:

So for putting everything together loog for "jmeter correlation" in your favorite search engine or see ASP.NET Login Testing with JMeter guide.

1
votes

First JMeter 2.3.2 is WAY TOO OLD (10 years old), upgrade to JMETER 2.11.

Second, Jmeter cannot guess that the response if KO if the returned code is 200, so you need to add Response Assertion that will check for some text you expect in the page.