Jmeter
Jmeter
newtours.demoaut.com
the internet herokuapp
192.168.0.108:1080/webTours/
Aggregate report
http cookie manager will store all the cookies and use it for other steps
Controller-
Multiple requests placed inside a container is called as Controller
Transaction controller
Simple controller adds them in separate folder but doesn't grup the
samplers(requests)
Module controller - to re run a module rather than recording to get the samplers
Interleave controller - One sampler per iteration is executed in top to bottom
order
Runtime controller - controls the execution of its samplers/requests for the given
time
(Rigorously put load on the server for a specific time)
Random controller - plays only one of its children samples picking it randomly
Timers:
Is used to add sleep
Constant timers
Gaussian Random timer - Changes timer with a deviation
Constant Throughput timer
Throughput - how many bytes per min
Regular Expression -
When you want to enter dynamic inputs regular expression is used.
Regular Expression Extractor
https://rexegg.com/ - Learn
Beanshell Scripting -
//User of vars and ctx
String newUsername;
log.info(vars.get("country")); //display output in the console
log.info(ctx.getThreadNum() + "is the thread number");
prefix = ctx.getThreadNum() +2;
String country = vars.get("country"); //to get value of variable
if(country.equals("China")){
newUsername=prefix.toString()+vars.get("username")+"China";
}
else{
newUsername=prefix.toString()+vars.get("username");
}
vars.put("username",newUsername); //to update the variable values
log.info("New user name is" + newUsername);
//use of prev
prev - holds the results of your previous http samplers
log.info(prev.getResponseCode().toString());
helpful to validate result
if there are multiple threads and if you want to access variables of another thread
then we need to have them under test plan and to access taht we use props