CSS/JQuery extractor is extracting default value in case of load test, for the random threads - jmeter

Performing a login and update user test with multiple users.
I have created a CSV file with 200 username and passwords. Running 200 threads
Performing login and update user, with 200 users.
I am extracting the value of csrf token in a variable after the login request. Then, I am passing that csrf variable in the user update, post request.
Running the same request with 100 users, I am able to log in and update the user's details.
Running the same request with 200 users.
getting the connection timeout exception.
Some of the update user post requests are getting failed because csrf variable is extracting the default values of CSS/JQuery extractor. CSRF token actual value is not getting extracted to the variable.
I have also added Authorization, Cookie, Cache and Header Manager in my test plan.
The constant timer is also being used after login request.
I have set the value of timeouts to 120000 in the HTTP request defaults. Even if I am increasing the timeouts, getting the same exception.

Most probably your application under test simply gets overloaded therefore it cannot respond in a timely fashion.
With regards to CSS/JQuery extractor which is failing to get CSRF token - my expectation is that the token is not present in the response for failing samplers.
So I would recommend taking the following troubleshooting steps:
Completely remove Connect and Response timeouts in the HTTP Request Defaults so JMeter will wait for response forever.
Configure JMeter to save responses for failed samplers by adding the next 2 lines to user.properties file:
jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.response_data.on_error=true
this way you will be able to see how does response look like for failing requests. See Results File Configuration User Manual chapter to learn what other metrics could be useful for your analysis.
Check your application and middleware (web/application/database server/load balancer logs)
Make sure to set up monitoring of baseline OS health metrics on the application under test side. You can do this using JMeter PerfMon Plugin
Just in case double check you're following JMeter Best Practices

Related

Jmeter __RequestVerificationToken extracting problem

I recording login with jmeter. I test with 1 user but jmeter cannot login because of __VerificationToken.
I parsed token with CSS Selector Extractor
I'm sure the token has been moved in the cookie.
But I saw two __VerificationToken. Error return request:
GET data:
Cookie Data:
ASP.NET_SessionId=xxxxxxxxxxxxxx;
__RequestVerificationToken=hYTIRJryyxCBfF7vYlAnkPSM-JB0o- Zp41pqFGk30cLyPAehA22k69VOU3NhY-abVbxuEZDgZHnF-bTFHf_4g1HwkuQ1;
__RequestVerificationToken=${token}
It's impossible to say what's wrong without seeing what parameters and headers does real browser send, however it seems you're doing something weird.
You shouldn't manually create the __RequestVerificationToken cookie as it seems to be properly handled by the HTTP Cookie Manager
Given you have the token value already stored in the HTTP Cookie Manager there is no need to extract it, if you need to send it as the parameter in the HTTP Request sampler you can add the next line to user.properties file:
CookieManager.save.cookies=true
and once you restart JMeter to pick up the property you will be able to access the token value as ${COOKIE___RequestVerificationToken} where required
More information: HTTP Cookie Manager Advanced Usage - A Guide

Jmeter Log On in SAP CRM web client Error

I used Jmeter's HTTP(S) Test Script Recorder to record the Log in in SAP CRM Web client. I configured HTTP Cookie Manager using the cookies that I saw in browser developer tools ( MYSAPSSO2, Session ID, Sap-usercontext).
In the same recording test I filled some fields in SAP. I stopped the recording test.
I did it multiple times to see what parameters were dynamic and I realized that wfc-secure-id and C5_confighash and c7_confighash were dynamic. So I used regular expression to extract the dynamic values and I applied it in the requests where I filled the fields.
In View Results Tree I can see the HTML response in the Requests' response bodies that the log in was successful and the fields were filled. I also checked the SAP sessions metrics that the users are logging in.
After the successful login I went and did some recordings of a User roaming around inside the web client performing some operations and saving the results. I changed the dynamic values to fit the previously values I obtained in the login process.
The issue lies in the fact than when i went back to JMeter to do a test run, I get a logon error on the response header between the login and the new recordings. The response body of the new recordings also return empty.
I'm thinking that between the recordings, jmeter is losing the user session information
How can I connect the new records with the log in record?
You should not be hard-coding cookies in the HTTP Cookie Manager.
JMeter doesn't record cookies
headers.removeHeaderNamed(HTTPConstants.HEADER_COOKIE);// Always remove cookies
hence you should not be manually adding the cookies you see in browser to the HTTP Cookie Manager, adding an empty HTTP Cookie Manager should be enough to let JMeter automatically take care of incoming cookies.
If you don't see the cookies being added to the request(s) it usually means that:
Your HTTP Request sampler is not configured properly, i.e. "Server Name or IP" field is empty
Your server is not configured properly (i.e. it returns cookies which doesn't comply with the standard hence JMeter fails to add them)
The steps you could take are:
Enable debug logging for the HTTP Cookie Manager by adding the next line to log4j2.xml file:
<Logger name="org.apache.jmeter.protocol.http.control" level="debug" />
Use less-restrictive cookie policy, i.e. netscape
Add the next line to user.properties file:
CookieManager.check.cookies=false
Check out HTTP Cookie Manager Advanced Usage - A Guide for more information on JMeter's HTTP Cookie Manager usage/troubleshooting

Need to handle duplicate session in jmeter scipt

Below is my Jmeter script flow:
-Thread group
- Test Plan
- Login scripts
- Http header manager
- CSRF authorization using css/Jquery extractor
- Dashboard
- Graph Listener.
Problem is: When i run this test plan with 1 user hit, it passes but when i try it with 50 users(more than 1 user) it fails As in our website Multi sessions are not allowed.
Any help would be appreciated !!
Try adding HTTP Cookie Manager to your Test Plan, if your application manages session basing on cookies - it should fix the issue
It might be the case your application uses URL parameter for session management - in that case go for HTTP URL Re-writing Modifier
Inspect your script more carefully as it might be not only one dynamic parameter (CSRF token), there could be more parameters requiring correlation. Record the same scenario 2 times using HTTP(S) Test Script Recorder and compare 2 results scripts. All parameters which are different need to be correlated.

Getting Insufficient Privilege error in Jmeter for Oracle Application

While doing performance testing for Oracle Application, facing the Insufficient Privilege error on submitting one of the form from Jmeter. There is no issue manually in application not any error in debug logs. This is happening only from Jmeter. Have checked with Fiddler no requests are getting missed and also all the correlations are in place.
JMeter error :
You have insufficient privileges for the current operation. Please contact your System Administrator.
Most probably you're simply not getting logged in. Double check the following:
HTTP Cookie Manager is added to your Test Plan. In some cases you will need to add CookieManager.check.cookies=false line to user.properties file or amend Cookie Policy to something less-restrictive, i.e. netscape. Check out HTTP Cookie Manager Advanced Usage - A Guide
Make sure that you perform correlation of dynamic request parameters. Pay attention to literally everything as parameters may be present as a part of the URL, or it may be a HTTP Header
Run your test with 1 user and monitor the request and response details using View Results Tree listener. Check Response Data tab for each request to ensure that your test is doing what it is supposed to be doing
Make sure to compare the requests originating from JMeter and from the real browser, normally if you're sending the same requests - you should be receiving the same responses. Pay attention to redirects

Session Expired Response in JMeter

I am testing particular application using JMeter 2.9.There My test plan is Thread group--> Transaction Controller.Inside that various recorded requests are there.I am using HTTP request defaults,HTTP Cookie manager and HTTP header manager,and a view result tree for validation.I found one token i.e. CSRF token to be correlated and I did correlation.But for a particular request I am finding "Session expired..Login again" response much before the logout request.My transaction flow is to Login--> Search a content-->Logout.
Please help me finding a solution.
Try put the element: HTTP Cookie Manager in Thread Group, first item.
the problem can be in the following areas:
-you were redirected automatically instead of following redirects
-login hasn't succeeded
-the session id has not been successfully passed on to the request after login
The JMeter documentation states this:
I've set up JMeter to sample the same URLs as my browser, why is JMeter not seeing the same responses?
There are various different reasons for this:
Cookies - make sure you added a Cookie Manager. Browsers process cookies unless you set them up otherwise, but JMeter does not process cookies unless you add a Cookie Manager.
User-Agent - the User-Agent is a header that is sent by browsers; it identifies the browser type. Some servers are sensitive to this setting and generate different results for what they think are different browsers. The Header Manager is used to add headers such as User-Agent.
Hidden fields - if you did not use the JMeter Proxy (or other application) to record the test plan, then it is easy to miss hidden fields from forms.
Dynamic field names/content - some servers use varying names for fields. So although the test plan may be correct at the time of creation, it does not work when replayed.
URL rewriting - TBA
from http://wiki.apache.org/jakarta-jmeter/DifferentBehaviour

Resources