Performance Testing is a type of testing to ensure software applications will perform well under certain workload. Load testing is a simplest
for m of performance testing. Stress testing, volume testing, integration testing.
for m of performance testing. Stress testing, volume testing, integration testing.
- Why this testing is necessary for every application?
- Performance of application: write a script to buy a product -1000,10k 5 hours.
- How does load testing tools help us to measure the performance of application
- Popular tools: JMeter, LoadRunner.
- Whats a advantage of JMeter ?
JMeter is a open source , cross platform support, scripting is not necessary to learn JMeter. and it is a user friendly.
Jmeter Installation:
Tool overview:
Only one project can be seen on window.
What is record and play back?
Test - go and perform actions in browser.
To record test script:
To test we need requests and responses. load bans: Gif, banners.
To test we need requests and responses. load bans: Gif, banners.
Recording also many types;
- Jmeter
- Firefox browser
install certificate on browser for Jmeter
Firefox browser setting for recording
please provide Jmeter certificate on Firefox browser for recording
https- that https webside needs certificate - Jmeter
http://blazedemo.com ..starts recording botton on jmeter and stop after doing some action o
How to record in Jmeter using firefox with proxy
handling https website with jmeter certificate imporing into browser
..For chrome add blazemeter
add plugin and sign in
Balzmeter initallly record. .jmx file and can import to jmeter.
Jemeter resulet
What is thread group:
A thread group is a set of threads/users executing the same scenario.
Listener: View results, aggregate report, graph result are important.
...Created Jmeter script.
ThreadGroup 1
view results tree
200 status code - response may be wrong one.
AddEmployee - Employee is successfully added 200 status
- employee already exists - 200 status
• What is Thread Group?
....................................
A thread group is a set of threads/users executing the same scenario.
• Understand the Process of applying the Load using Thread Group
• Introduction to Listeners:
...................................
View Results tree
Aggregate Report
Graph Results
• Understand the Jmeter Load parameters to analyze results
Samples : No of users hit that specific request = 2153
Average: It is the average time taken by all the samples to execute specific label. = 129 Milli seconds
Min: The shortest time taken by a sample for specific label.
Max: The longest time taken by a sample for specific label
Std. Dev.: This shows the set of exceptional cases which were deviating from the average value of sample response time. The lesser this value more consistent the data. Standard deviation should be less than or equal to half of the average time for a label.
• Error%: Percentage of Failed requests per Label.
• Throughput: Throughput is the number of request that are processed per time unit(seconds, minutes, hours) by the server. This time is calculated from the start of first sample to the end of the last sample. Larger throughput is better.
Median: It is the time in the middle of a set of samples result. It indicates that 50% of the samples took no more than this time i.e the remainder took at least as long.
90% Line: 90% of the samples took no more than this time. The remaining samples took at least as long as this. (90th percentile)
• Additional Plugins for Simulating real time Load
Download the jar from
https://jmeter-plugins.org/wiki/PluginsManager/
Concurrency Thread Group
Ultimate Thread Group
Created Jmeter script
ThreadGroup – 1
View results tree-
200 response Green tick-
200 status code – response may be the wrong one-
AddEmployee - employee is successfully added 200 status
- Employee already exists – 200 stats
3 users
12 15 30
12+15+30/3 = average
Min=12 Max=30
With 100 users of load, through put is 300 Requests/Sec for reserve.php
200 requsts
added jmeter plugin manager from https://jmeter-plugins.org/wiki/PluginsManager/
install custom thread group and lock file config on jMeter .go to options and plugin manager and...select.
concurency thread group, Ultimate thread group. are imp
Ultimate Thread group:
HTTP cookies manager:
saves the browser.
How to validate Jmeter test - pass/fails:
response assertion, json assertion, size assertion, duration assertion imp
Http cookie Mangager..Assertion results. view results tree..
can assert text response, response code.
size assertion:
size of bytes..
duration assertion: time
download web tours for run local server. user name manojadqa@gmail.com Pass Automation.1
download Web Tours Sample Application
install and go to browser..user name manojbiotect pass Automation.1
Controller: its a container where you save all your request.
eg. login
search for flight and give all details and select flight - 7 request
book a flight- passenger details and confirm booking = Reservation
Transaction controller, loop controller, runtime controller, recording controller, module controller are commonly used
module controller is used repeat many times script certain module to login.
logic controller is used for loop , if else
Interleave controller - 5 requests : one sample per iteration is executed in top to bottom order
Runtime controller: runtime controller controls the execution of its samplers/requests for the given time.
if you only run certain work done many times we need to do runtime controller.
Random controller: Random controller plays only one of its children samples picking it randomly
If controller: not written real time. condition should be true or false. you can write test condition on test plan eg store 11
and write if inside if controller condition: "${store}"=="11" then condition will satisfy and execute
loop controller: how many times you want to loop
Timer does not work a lot of times.. constant timer helps to pause one test case to looping second time same test case.
Gaussian random timers has constant delay and deviation time.
Constant throughout timer.- target throughput samples per minute. eg 4 petrol bunk - 100 liters. 2 car into 200 liters per minute when there are 2 cars. 200 requests per minute when there are 2 users. 4 users 4 requests. 10 users 400 requests.
Important 28 / 29 .. how to make dynamic password and username in jmeter...use regular expression extractor
see how to write regular expression: https://www.rexegg.com/regex-quickstart.html
Debug sampler helps to find pass and fail test very quickly.
power of single regular expression extractor
combining multiple expression in to single extractor.. making more dynamics:
adding assertion for response header
32: data driven testing using jmeter
save file: data.csv with username,password,confirm,firstname
data.csv
total 7 threads..
Correlation function: handles dynamic session id -36 lecture
Do not predict test case is pass by looking green tick mark. please go through inside response data and validate the result.
creating session id dynamic .regular expression extractor:
making dynamic username and pass
VALIDATION OF JMETER ON NON GUI MODE: try refereccnce 7 .
you can run test through command prompt too.
open command prompt from administration mode
cd C:\Dev\apache\apache-jmeter-5.2.1\binj
C:\Dev\apache\apache-jmeter-5.2.1\bin>jmeter -n -t RequiresGetApiHTTP Request.jmx -l C:\Results.jtl
//it hits a jmeter -n, l means result and save on Results folder.-n flg means run Jmeter in non-gui mode, -t means to specify path to jmx file
monitor jmeter results throgh
practice on blazemeter cloud https://a.blazemeter.com/app/#/accounts/495933/workspaces/497170/dashboard
you want to run your app 5000 times, you will see wrong result. So it is not recommend to use more users from single machine. In this case , distributed mode helps.
make one master machine and other slave, in master machines, go to jmeter.properties and server.rmi.ssl.disable=true and start jmeter server and you see message.
then in slave machine: go to jmeter.properties and make a remote_host=127.0.0.1 ( ip address make same as master machine)
restart jmeter and run it. go to run option and presss on Remote start and run to the slave id address. your test runs on slave machine. and you can see the result on Master jmeter result.
Beanshell Scripting
you can write a logic to manipulate variable.
dynamic:
Selenium Integrating with Jmeter:
export java jar file project ..
paste jar file inside apache lib junit
headless browser //htmlunitdriver- browser doesnot invoke
Restful WebServices:
"REST". Representational State Transfer Rest is alternative to Soap Protocol Though SOAP is considered as the standard protocol for web services communication,it is not the only possible transport protocol which is used The WS-* extensions such as WS-Security, WS-Addressing, and WSReliableMessaging are associated with SOAP messaging due to this extensible nature
RESTful web services can be considered as a lightweight alternative Rest is not a protocol
Rest Service:
Resources
We will use standard HTTp Methods to access the resources They are GET, POST, DELETE, and PUT
Rest follows Stateless Communication
Get-Read
Post: Create logging into facebook….session is creating
Resource identifier will not be passed from the URL.
Create a Google account if you do not already have one.
2. Access the Google Developers portal at https://developers.google.com/.
3. Click on the API Console which can be found under the Developer Tools.
4. Log into the API console (https://code.google.com/apis/console/)
using your Google account.
5. Click on Create project to start using Google APIs.
6. You will find the list of Google API offerings such as Analytics API,
Blogger API, Places API, and so on. For our demonstration, we will use
Google Places API. Locate the Places API in the services list and click on
the on/off icon to make it active.
7. You will be prompted to register your organization and website URL.
Enter something valid and click on Submit. This will direct you to the
terms of services page. Accept the terms and conditions.
8. Now, go to the API Access page by clicking on API Access in left menu.
You will find your API key at the bottom of the page under the Simple
API Access section.
google api search place
parameter
serviceendpoint/resourceendpoint/output?parameters
Importance of server Monitoring:
Use Yourkit.
Bugzilla: Bug tracker tools and testing tool. used and developed by Mozilla project.
Steps to reproduce:
Expected:
Actual:
Timestamp
Screenshot
Reference
- Best practice automation:
- Best practice Blaze demo :
- Practice:
- web tour :
- local host Jmeter
- details:
- Blazemeter- jmeter result on non gui -
- J meter context variable:
- way of writing regular expression:
- Blazemeter cloud:
- server, cpu performanece:
No comments:
Post a Comment