0% found this document useful (0 votes)
55 views2 pages

Jmeter

Uploaded by

ImthiyazImthi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views2 pages

Jmeter

Uploaded by

ImthiyazImthi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

practice sites:

newtours.demoaut.com
the internet herokuapp
192.168.0.108:1080/webTours/

Aggregate report

Samples = No of users hit the specific request


Avg =avg time taken by all request to execute specific operation
Min = min time taken by a user to get the result(in milli seconds)
max = longest time taken to get the result
Error % = Percentage of failed requests
Throughput = time taken by the server in handling the process and users

session cookie is attached to you to identify you are logging in


cookie is there only for secured area not for all pages

http cookie manager will store all the cookies and use it for other steps

Assertion to validate response


Assertion results- displays the results of the assertions added
Response Assertion(to verify response), Size assertion(to verify size in bytes),
duration assertion(how much time to generate response)

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

If controller - if a condition is satisfied then only the if controller will


execute
Loop controller - How many times to loop, it will run that many specific times

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

A sentence(.+?) has (username)


$1$ gets the value from first bracket
If you need value from 2nd bracket then it should be $2$
Debug sampler - Displays all the request entered and the response passed.
Combine multiple expressions into single reg extractor using global g0 g1 data.
Data driven testing with Jmeter -
How to create http request samplers without recording?
Better to use recorder rather than manualy creating

How to data drive into application?


easy to add data or perform login using csv - jmeter

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

Running tests in non GUI mode-


Sometimes its reccommended to run tests in non gui mode.
cmd
jmeter-n -t (testcaseName).jmx
to view results we need to add one more parameter to the command
jmeter -n -t (testcaseName).jmx -l D:\Results.jtl
jmeter -n -t Assertions.jmx -l D:\Results.jtl
-l stands for results

Monitor Jmeter results via Taurus

Jmeter distributed mode

You might also like