JMeter page response is not complete or empty, what to do? - jmeter

I'm running my JMeter scripts for only 5 virtual users. The scenario is: each user logs in to a system using credentials, checks some boxes and clicks the submit button. For the first 4 users, it works fine. I could see the successful submit button response. But often time for the last user, it seems the response page is not complete, though there's no errors.
Can anyone please tell me how can I ensure a complete page response? I'm attaching a screenshot if that helps.
Thanks!
--Ishti

With the listener on the thread where the request is sent, you might find the thread has been terminated before the response has been consumed.
You have another results tree listener at global scope, does it show the response?
Check jmeter.log to determine the time the thread ended.
Try adding a post-processor to force the thread to wait for response.

Related

How to click a button on pop uo URL in jmeter without recording the script so that a data can be saved in the application

i have a web application which has confirmation pop up to save a record . i have used post on the HTTP request sampler and used parameter body , but still the record is not getting saved in the web application using jmeter . i have to click save then yes on the confirmation pop up
JMeter doesn't actually perform "clicks", it sends HTTP Requests, in your case this "popup" seems to be used for populating the USER_COMMENT section:
with regards to "record is not getting saved in the web application" - it indicates that your script fails somewhere somehow, you should inspect response details using View Results Tree listener, it might be the case the application will tell you what's wrong with your request.
The most common reasons are:
Your login request fails hence all subsequent requests are landing at the login page. JMeter automatically treats HTTP status codes below 400 as successful therefore you can see them as "green" or false-positive so check that all previous responses return expected data using the aforementioned View Results Tree listener
The request may fail due to missing or improperly implemented correlation, i.e. you're updating the record which was created during recording instead of adding a new one

JMeter : How to run Multiple Samplers under a single Thread group for multiple concurrent users?

I am new to JMeter and trying to learn JMeter by doing performance testing for one of the application in my organization.
I am facing the blow issue with the concurrent execution of a single thread for multiple users.
Base URL: http://xyz.abc.com/app/
Complete URL : http://xyz.abc.com/app/{RandomSesionID}/Account/Login
I've create a Thread with HTTP Requests as show below.
Thread Group
Hit Base URL
It Loads Login URL
Post Credentials and Click Login
Navigate to Landing Page(baseURL/{RandomSessionID}/Main/Home)
Click Logout(It will navigate to BaseURL/{RandomSessionID}/Main/Home)
When I let the thread count to its default value 1, Everything is working fine. However , The moment I set it to more than 1 (with ramp up time to 10sec), below thing happening.
User 2--->
Hit Base URL
Get The Login URL
Post The Credential
It again goes back to Request 2 (Get The Login URL)
and all the steps of the user are getting redirected to the second request irrespective of what I am requesting.
I tried organizing everything into Simple Controllers to see if the sequence will remain for all users but no avail, I am still running into the same issue.
please help me to understand what is going wrong here and how I can resolve these errors to test the application with more concurrency.
EDIT 1
I did a further investigation on this issue from my end and here are the observations I had.
Case 1: When I create two separate JMeter instances and run the same test parallel with different users, The Thread completely successfully without any errors.
Case 2: Wile Running the Thread with 2 users as mentioned above, The second HTTP request for BaseURL:/Home/Main redirecting the request to /Account/Main instead of going to the next step as shown below.
Image 1 :All The HTTPRequests In Order
Image 2 : This Is the Navigation Request For User 1
Image 3 :User 2 Hitting /Home/Main and Getting Redirected To /Account/Login As Response
Image 4 : User 2 Hitting /Home/Main and Got /Home/Main response
Image 5: User 2 Hitting The /Home/Main and Getting Redirected in Response
As you can see in Image 1, Those are the series of requests which I am making through the thread group and these requests are the same for all the users in the thread.
In Image 2, You can see /Home/Main is a Single GET request with a valid /Home/Main response without any issues.
However, In the Subsequent Images 3-5, You could see that the GET /Home/Main-134 making sub-request and 134-0 and 134-1 with 134-0 to GET /Home/Main and 134-1 to GET /Account/Login.
My Observation: I doubt that JMeter is using a single tab/ instance of the browser and hitting those web requests in the same tab where the first request was initiated. Due to which for the second user, it is always redirecting to the Login Page even though the session ID is valid.
To Confirm whether what I observed is correct, I tried replicating the same scenario in the Chrome Browser as mentoined below.
1. Open Chrome broswer and Access the Base URL.
2. Login and Navigate to Home/Main
3. Now In the same Tab, Type BaseURL and It redirected me to the Login page.
4. Now Enter Credentials of User 2 and login and nvaigate to Home/Main.
5. Now I Try accessing the firt User URL by going back by 3-4 tabs.
However, This won't replicate the exact steps as we are using the browser normally whereas in the requests, we are directly hitting the urls with the GET/POST requests.
I am in a fix and unable to understand what I should do to get through this issue.I am not even sure whether it is the issue with the Application or issue with the Jmeter.
Are there any setting in JMeter which will make sure each Thread (user) of the Thread group gets the option to have a dedicated request instead of using the single instance of the browser internally ?
My expectation is that your It again going back to Request 2 statement is wrong.
Each JMeter thread (virtual user) executes Samplers upside down (or according to Logic Controllers)
So most probably your Get The Login URL is being executed by the second user and given the label of the request is the same you cannot distinguish which user is executing which sampler.
You can add i.e. __threadNum() function as the postfix for the request label like:
Hit Base URL user: ${__threadNum}
this way you will get the information regarding which virtual user is executing which request at each moment of time:
Check out Apache JMeter Functions - An Introduction article to learn more about JMeter Functions concept

Concurrent thread group execution on same application is failing few sampler in jmeter

I am rookie to Jmeter.
I have been asked to run multiple thread groups where there is a single Testplan.
All these Thread groups perform different scenarios on same application.
but running them concurrently is failing few samplers, on the other hand if i run them sequentially then everything works well.
so can anyone guide me on this as what can be done.
Details:
there are 3 samplers.
1. Login with post form
2. Get case status page
3. Logout
Unique key generated from Login page response is RANDOM_TOKEN_KEY which I am capturing and passing it to "Get case status page".
JsessionID is getting generated uniquely for individual steps hence i have skip that one.
From case status page I am directly clicking on Logout page which is working fine.
Issue: when this test is triggered for more than 1 threads, example 10 at same time. then Login is working fine but "Get case status page" sample is throwing error as "Your current session has expired. Please log in again."
Script failed when run concurrently with same user credentials
You should check the checkbox "Delay Thread creation until needed" in Thread Group.
This way threads will work without interrupting the flow.

Why is only my first HTTP request running?

I'm still pretty new to jmeter. I'm using jmeter 2.9.
I have created a thread group with two threads in it. I have set up an HTTP Request Defaults for the thread group. I have created User Parameters to define person IDs that I'm going to be working with in each thread.
I then set up two HTTP requests. One for login, one for retrieve person. For the login one, I created a regular expression extractor to extract the session key that comes back. I then supply the session key as the parameter for the retrieve person request.
I then sniffed the net traffic and started jmeter test. I wanted to make sure the session key was getting passed into the second parameter OK, but it appears to be running on the login twice and then ending. I am getting a 200 return on the HTTP packet and my jmeter test was set to continue regardless.
I believe I followed chapter 5 of the jmeter user manual to set up this test with the addition of parameters, user parameters, and the regex extractor.
Can anyone give me an idea what i might have done so that the second request never runs?
Add "View Results Tree" listener to see what jMeter is actually doing? You should also check jmeter.log to see if there are any exceptions while generating the 2nd request.

How can I cancel request in Django

I have writen searching in my site and now I am trying to make it search every time I start printing. So now I am sending many requests which contains different text to search for using AJAX one by one and every next reqest has to wait, before previous one is finished. Apperently I dont need old requests to be answered, but I need the only one response for the last request.
How can I kill the queue of not actual requests in Django?
Does anybody know the answer?
On the server side, it's probably too late to cancel requests, but you can ignore the responses on the client side. I would suggest aborting a pending AJAX request before sending a new one.
Here is how:
Abort Ajax requests using jQuery
An easier way to do this could be by waiting a bit before sending your request to the server. After each input, set up a timer that stops the previous (setTimout) and only send the request if the timeout is met.
If a request was already performed and has not returned you can still kill it as suggested in another answer.
I'm not aware of how to stop other requests using django -- hope that it's not even possible, it would be a security thread if requests could be killed by others.

Resources