How to handle the dynamic URL path request in JMeter - jmeter

I am a new to jmeter but am aware with the basics to correlate and parameterize values and run scripts for multiple users.
But i am stuck on an issue of correlating the dynamic values found here
This link was helpful in a way but i was not able to correlate the contents.
Any insights would do, Thanks in advance

These 152153667366 and friends seem utterly like Unix Timestamps (time in milliseconds since 1st Jan 1970).
It means you don't need to "correlate" them, you need to "generate" them, check out JMeter's __time() function which returns current time in form of a Unix Timestamp
Just amend your HTTP Request Path to end with ?t=${__time(,)} and that would be it.
Demo:
Check out Apache JMeter Functions - An Introduction article to get familiarized with JMeter Functions concept.

Related

Summary report contain misleaded statistics jmeter

after running my performance script , the statistic report generated is quite confusing.
Response Time :6s minimum
90th pct:4.53s
95th pct:4.9s
How come minimum response time is greater then 90th and 95th percentile , am I doing something wrong here ?
It should not be the case, the relevant code lives under StatCalculator.java class
If you do believe that this is a JMeter bug - you should raise an issue in JMeter Bugzilla
The first thing they will ask you is your .jtl results file so if it doesn't contain top-secret information you can update your question with the .jtl file contents so we would be able to look into the issue as well.
P.S. Any chance you're using a Transaction Controller with non-default naming policy? If yes, it might have an impact on results
P.P.S. Any change you're using JMeter Plugins or amending sample results on the fly via Groovy scripting? If yes, it also may influence the test metrics

Dynamic value changing from server response compare to replace in the JMeter script

Few of the token values are changing compare to response to replaced in the script. please let me know how to over come this issue
1st value
Recorded Server response in JMeter recording log
VI1js8eNsTKaakYaEsdhPPg+nlPY2SL6/0RoyxBL1BE=
Replaced value in the JMeter script
VI1js8eNsTKaakYaEsdhPPg%2BnlPY2SL6%2F0RoyxBL1BE%3D
2nd value
Server response
C/K6QoR6Qjk/pLQAyvQ5FiRXFK9BAxeRJAEDJ+BGA+w=
Replaced value in the JMeter script
C%2FK6QoR6Qjk%2FpLQAyvQ5FiRXFK9BAxeRJAEDJ%2BBGA%2Bw%3D
Please hlep to to over come this issue.
Thanks
Raghav
Most probably there is some form of encryption/decryption logic which is applied to certain request parameters, it's not possible to guess the algorithm so if you don't know it you need to ask around.
Once you will know what exact encryption algorithm is being applied - you should be able to perform the same either using __digest() or __groovy() functions

How do I record a script in JMeter which adds a record in a website?

Currently, I am recording a script in jmeter by which I am adding a record in a website , but a problem is that while recording a script I am able to add a record in a website, but once recording has been done and after that if I will run a script again then, a script is not adding a record in a website.
can you please help me with this?
In the absolute majority of cases you will not be able to replay the recorded script without performing correlation.
Modern web applications widely use dynamic parameters for session management or CSRF protection so once you record your test you get "hardcoded" values and they need to be dynamic.
Assuming all above my expectation is that your test doesn't add record due to failed login or something like that. Inspect requests and responses using View Results Tree listener - this will allow you to identify which exact step is failing.
The process of implementing the correlation looks as follows:
Identify the element which looks to be dynamic either manually inspecting request parameters and look for "suspicious" patterns or record your test one more time and compare the recorded scripts looking for the parameters which differ
Inspect previous response and extract the dynamic value using a suitable post-processor. For HTML response times the best option is CSS Selector Extractor. It will allow you to extract the dynamic parameter value and store in into a JMeter Variable
Replace hardcoded recorded value with the variable from the step 2
Repeat for all dynamic parameters
Don't forget to add HTTP Cookie Manager to your Test Plan.

Jmeter record and play scripts for performance testing

I want to do a performance test of a website so i am creating a script that mimics user behaviour. I am using blazemeter to record those scripts and upload it in jmeter. I have two questions:
1) Do the results of a record and play script vary when run on another machine or a different time ?
2) I am getting a 400 bad request error in one of the steps of the recorded script.
What should i do ?
Is there any other way to test the web pages other than record and play ?
The chance of getting a good load test from recording is minimal as modern web applications widely use dynamic HTTP Cookies HTTP Request Parameters for different reasons (security, tracking client state, etc)
So after recording your test scenario "skeleton" most likely you will need to perform so called correlation - the process of
detecting dynamic parameters
extracting them using JMeter Post Processors and storing into JMeter Variables
and reusing the variables where required
Detecting parameters is quite simple: just record your test 2 times and compare request defaults: if you see differences - you will need to perform the correlation.
Extracting dynamic parameters is a bigger story, choosing the right extractor depends on response type, for example:
for HTML response types use CSS/JQuery Extractor
for XML/XHTML and in some cases HTML use XPath Extractor
for JSON - JSON Extractor
for anything else - Regular Expression Extractor which works with any text (including all above response types)
Also be aware that there is a solution allowing to perform JMeter correlation in an automated manner so you won't to detect and handle the dynamic parameter manually, check out How to Cut Your JMeter Scripting Time by 80% article for more details.

How to decide which value to fetch?

I have jmeter script contains five transactions of which one transaction contains more than one dynamic values. And I want to know how to decide which value to fetch in order to pass it to further transaction?
You need to fetch those values which are required.
Record your scenario 2 times
Inspect request details using View Results Tree listener
Find request parameters (they may be in the request headers as well) which are different between 2 recordings
These are the dynamic parameters you need to correlate (extract from the previous response and pass to the next request)
Alternatively you can use a cloud-based JMeter scripts recording solution which is capable of exporting recorded scripts in "SmartJMX" mode with automatic correlation of all dynamic parameters so you won't have to worry about it. Check out How to Cut Your JMeter Scripting Time by 80% guide for details.

Resources