What is Performance Testing
 To Check the Application behaviour to various load condition is called
Performance testing.
Why do Performance Testing?
 Nobody likes using a slow application. Performance testing is necessary to make
sure your application runs quickly, is stable, and can scale.
Attributes of Performance Testing
1.Speed - Determines whether the application responds quickly
2.Scalability - Determines maximum user load the software application can handle.
3.Stability - Determines if the application is stable under varying loads
Performance Testing Process
Types of Testing
 People will be able to make search on travel website portals with Origin, Destination, Departure ,
Arrival date and No.of passengers
 So we are giving the request to the website, Travel API providers are integrated on website then
fetching data from travel API Providers data base and display it to the website.
 And the portal will be integrated with the payment gateway for the customers to pay through
Credit cards, Debit cards and Net banking.
 Finally through travel portal development the customers wiil be able to make search on website ,
book a hotel or flight and pay online which reduce the extra work of travel agents.
Advantages of JMeter
 Booking.com API
Booking.com is leading travel agency with more than 200 thousands of
hotels in different categories in different countries .
 Expedia API
Expedia is a large database of Hotels say 4,35,000 in 1500 destinations. It
is one of the most used API for hotel reservation system.
 Amadeus API
Amadeus API is the best Global distribution system for flight booking site . It has
75,000 travel agencies and 11,000 airlines to run their services.
JMeter Workflow
 API stands for Application Programming Interface.
 API is a software to software interface, not a user interface.
 With APIs, applications talk to each other without any user
knowledge or intervention.
 Implemented by writing function calls in the program.
1. JMeter Introduction
 Definition of JMeter
 History of JMeter
 JMeterFeatures
2.Stepsto Install JMeter
 Installation of Java
 Download JMeter
 Installation of JMeter
3.Building a Test Plan
 Adding and Removing Elements
 Loading and Saving Elements
 Run the Test Plan
 Stop the Test Plan
 Clear Results in Test Plan
 Building a Workbench
4.Elements of a Test Plan
 Thread Group
 Configuration Elements
 Timers
 Pre-Processor
 Post-Processer
 Assertions
 Listeners
 Controllers
 Samplers
5. Application under Test
 Generate script using Test Script Reorder
 Settings to be done for Test Script Recorder
 View the Test Resultsand Analyze the Test Report
1. JMETER Introduction
 Apache JMeter is a pure Java application designed to load test client/server
software (such as a web application). It may be used to test performance both on
static and dynamic resources such as static files, Java Servlets, ASP.NET, PHP, CGI
scripts, Java objects, databases, FTP servers, and more.
 JMeter can be used to simulate a heavy load on a server, network or object to test
its strength or to analyze overall performance under different load types.
1.2 History of JMeter
 Stefano Mazzocchi of the Apache Software Foundation was the original developer
of JMeter. He wrote it primarily to test the performance of Apache JServ (now called
as Apache Tomcat project). Apache later redesigned JMeter to enhance the GUI and
to add functional testing capabilities.
JMeter Features
1. Being an open source software, it is freely available.
2. It has a simple and intuitive GUI.
3. JMeter can conduct load and performance test for many different server types − Web - HTTP, HTTPS,
SOAP, Database via JDBC, LDAP, JMS, Mail - POP3, etc.
4. It is a platform-independent tool. On Linux/Unix, JMeter can be invoked by clicking on
JMeter shell script. On Windows, it can be invoked by starting the JMeter.bat file.
5. JMeter store its test plans in XML format. This means you can generate a test plan using a text editor.
6. Its full multi-threading framework allows concurrent sampling by many threads and
simultaneous sampling of different functions by separate thread groups.
7. It is highly extensible.
8. It can also be used to perform automated and functional testing of the applications.
2. Steps to Install JMeter
 JMeter is pure Java desktop application, it requires a fully compliant JVM 6 or
higher. You can download and install the latest version of Java SE Development Kit.
 The following procedure to check whether Java JDK is installed successfully in your system
 Navigation: Go to Start-->Enter cmd in search --->Double click on cmd icon---
>Enter command java -version in cmd.
Basic Inputs
If Java runtime environment is installed successfully,
you will see the output as figure below
If nothing displays, please re-install Java SE runtime environment by below process
2.1 Installation of Java
Check out Windows Versions:
The JDK software has two different versions: a 32-bit version and a 64-bit Window Version
On Windows 7 you can open the Start menu and choose “Computer” from the list. On the
“Computer” screen, click on the button that says “System Properties”, as seen below:
Downloading the JDK To download
 Downloading the JDK To download the Java Development Kit (JDK), launch your
web browser (e.g. Internet Explorer) and go to this address:
 http://www.oracle.com/technetwork/java/javase/downloads/index.ht
ml
Downloading the JDK To download
Downloading the JDK To download
Downloading the JDK To download
 Once you have accepted the license agreement, you will need to choose a file to
download. The Windows files are at the bottom of the screen. If you have a 32-bit
 Windows system, you will choose the “Windows x86” file. If you have a 64-bit
Windows system, you will need to choose the “Windows x64” file.
2.2 Download JMeter
 Open the URL: http://JMeter.apache.org/download_JMeter.cgi
 Choose the Binaries file (either zip or tgz) to download as shown in figure
below
Invoking Jmeter
2.3Installationof JMeter
Installation of JMeter is extremely easy and simple. You simply unzip the zip/tar file into the directory where
you want JMeter to be installed. There is no tedious installation screen to deal with! Simple unzip and you
are done!
Once the unzipping is done installation directory structure should look like as figure below
Batch File
JMeter Test Plan
JMeter Test Plan
1.Test Plan
2.Work Bench
Elements of a Test Plan
 The elements of the test plan will be added under this item in the left portion of
the window
 Threads - Each thread simulates a single user hitting the web server.
 Note that the actual plan is built under a Thread Group
 Thread Groups are under the Threads menu item
 Test Fragment- A special type of controller.
 You can build a test fragment from other elements under this element
 It can be included in the test plan in multiple places
 An Include Controller is used to include it
Elements of a Test Plan
 Config Element- Various configuration elements are here
 For example the HTTP Request Default element which defines the default host
and port etc.
 when placed at the same level as the Thread Group they become global
configurations.
 Timer - various types of timers that can be used to time the test plan
 Generally JMeter send requests with no pauses between requests
 This does not correspond to the way systems are used by users
Elements of a Test Plan
 Pre Processors - Executes an action prior to a request (Samplers are discussed below)
 For example setting parameters for a request
 There are scoping rules that apply to Pre Processors
 Post-Processors - Executes an action after a request
 usually it processes the response data
 There are scoping rules that apply to Post-Processors
 Assertions - Used to test the responses
 Was the response correct
 If not fail the response
 Generally added as the child of a Sampler (Discussed below)
 Listeners - provide access to the information JMeter gathers during the test
Thread Group
 Thread Groups is a collection of Threads. Each thread represents one user using
the application under test. Basically each Thread simulates one real user request to
the server.
 The controls for a thread group allow you to Set the number of threads for each
group.
 Navigation
 Open JMeter---->Right click on Test Plan----> click on Add--> click on Threads--
-> click on Thread Group
Thread Group
Thread Group
Thread Group
 Thread group elements are the beginning points of any test plan. All controllers and samplers must be under a
thread group. Other elements, e.g. Listeners, may be placed directly under the test plan, in which case they will
apply to all the thread groups. As the name implies, the thread group element controls the number of threads
JMeter will use to execute your test. The controls for a thread group allow you to:
Set the number of threads
Set the ramp-up period
Set the number of times to execute the test
 Each thread will execute the test plan in its entirety and completely independently of other test threads. Multiple
threads are used to simulate concurrent connections to your server application.
 The ramp-up period tells JMeter how long to take to "ramp-up" to the full number of threads chosen. If 10
threads are used, and the ramp-up period is 100 seconds, then JMeter will take 100 seconds to get all 10 threads up
and running. Each thread will start 10 (100/10) seconds after the previous thread was begun. If there are 30 threads
and a ramp-up period of 120 seconds, then each successive thread will be delayed by 4 seconds.
Thread Group
 Ramp-up needs to be long enough to avoid too large a work-load at the start of a test, and short
enough that the last threads start running before the first ones finish (unless one wants that to
happen).
 Start with Ramp-up = number of threads and adjust up or down as needed. By
default, the thread group is configured to loop once through its elements.
 Version 1.9 introduces a test run scheduler. Click the checkbox at the bottom of the Thread Group
panel to reveal extra fields in which you can enter the start and end times of the run. When the test is
started, JMeter will wait if necessary until the start-time has been reached. At the end of each cycle,
JMeter checks if the end-time has been reached, and if so, the run is stopped, otherwise the test is
allowed to continue until the iteration limit is reached.
 Alternatively, one can use the relative delay and duration fields. Note that delay overrides start-
time, and duration over-rides end-time.
4.2 Configuration Elements
 Configuration Elements allow you to create defaults and variables to be used by
Samplers. They are used to add or modify requests made by Samplers. They are
executed at the start of the scope of which they are part, before any Samplers that
are located in the same scope. Therefore, a Configuration Element is accessed only
from inside the branch where it is placed.
 Navigation
 Right click on Test Plan----> click on Add--->Click on HTTP Cache Manager
Configuration Elements
4.3 Timers
 By default, a JMeter thread sends requests without pausing between each request. We recommend that you
specify a delay by adding one of the available timers to your Thread Group. If you do not add a delay, JMeter could
overwhelm your server by making too many requests in a very short amount of time.
 The timer will cause JMeter to delay a certain amount of time before each sampler which is in its Scope
 If you choose to add more than one timer to a Thread Group, JMeter takes the sum of the
 timers and pauses for that amount of time before executing the samplers to which the timers apply. Timers
can be added as children of samplers or controllers in order to restrict the samplers to which they are applied.
 Navigation
 Right click on Test Plan----> click on Add-->click on Timer-->click on constant Timer.
Timers
Pre-processor
 A pre-processor element is something that runs just before a sampler executes.
They are often used to modify the settings of a Sample Request just before it runs,
or to update variables that are not extracted from response text.
 Navigation
 Right Click on Test Plan click on Add Preprocessors
Pre-processor
Post-processor
 A post-processor executes after a sampler finishes its execution. This element is
most often used to process the response data, for example, to retrieve a particular
value for later use.
 Navigation
 Right Click on Test Plan click on Add Post processors
Post-processor
Assertions
 Assertions allow you to assert facts about responses received from the server being tested. Using an
assertion, you can essentially "test" that your application is returning the results you expect it to.
 For instance, you can assert that the response to a query will contain some particular text. The text you
specify can be a Perl-style regular expression, and you can indicate that the response is to contain the text,
or that it should match the whole response.
 You can add an assertion to any Sampler. For example, you can add an assertion to a HTTP Request
that checks for the text, "</HTML>". JMeter will then check that the text is present in the HTTP response.
If JMeter cannot find the text, then it will mark this as a failed request.
 Navigation
 Right Click on Test Plan click on Add  Assertions-->click on Response Assertion
Response Assertions
Listeners
 Listeners provide access to the information JMeter gathers about the test cases
while JMeter runs. The Graph Results listener plots the response times on a graph.
The "View Results Tree" Listener shows details of sampler requests and responses,
and can display basic HTML and XML representations of the response. Other
listeners provide summary or aggregation information.
 Listeners can be added anywhere in the test, including directly under the test
plan. They will collect data only from elements at or below their level.
Listeners
Controllers
 JMeter has two types of Controllers: Samplers and Logical Controllers. These
drive the processing of a test.
 Samplers tell JMeter to send requests to a server. For example, add an HTTP
Request Sampler if you want JMeter to send an HTTP request. You can also
customize a request by adding one or more Configuration Elements to a Sampler.
Controllers
Samplers
 Samplers tell JMeter to send requests to a server and wait for a response. They are
processed in the order they appear in the tree. Controllers can be used to modify the
number of repetitions of a sampler.
 JMeter samplers include:
Ftp Request
Http Request
Jdbc Request
Java Object Request
Ldap Request
Soap/Xml-Rpc Request
Webservice (Soap) Request
Samplers
Application under Test
Generate script using Test Script
Reorder
Settings to be done for Test Script
Recorder
Settings to be done for Test Script
Recorder
Settings to be done for Test Script
Recorder
Follow these steps to change your
proxy setting (for Windows)
1. Click the Chrome menu on the browser toolbar.
2. Select Settings.
3. Click Show advanced settings.
4. In the "Network" section, click Change proxy settings. ...
5. Click LAN settings.
6. Deselect the "Automatically detect settings" checkbox.
 Click on customize and control Google chrome button--- >click on Setting--- >
Enter Proxy in Search Text box--->click on change Proxy button---> Click on LAN
setting Button --- > Deselect the "Automatically detect settings" checkbox ----
>Enable Use Proxy server check box(Proxy server)---- >Enter Address as local
host---- >Enter port as 1234 --- > click on ok button
Script Generated After Recording
Script Generated After Recording
View Results Tree
How to Test Mobile App Performance
using Apache JMeter?
 JMeter records mobile application requests on HTTP(S) Script Recorder and it has
features to prepare and run our mobile application performance test scripts. All we
have to do is to configure JMeter and Mobile device. In JMeter, we can test both
iOS and Android native applications.
 Steps to install the certificate:
1. Go to jmeter/bin directory and find the ApacheJmeterTemporaryRootCA.crt file.
2. (If you cannot find the certificate from bin directory, just go to your HTTP(S) script
recorder screen in Jmeter and click ‘Start’ button.
3. It will generate new certificate on your bin directory automatically).
2. Attach that file and send an email to yourself.
3.Download from your mail and then install on your device.
How to Test Mobile App Performance
using Apache JMeter?
 Go to Settings > Wi-Fi option. (Note: Network should be same for both Mobile
and Laptop/Desktop).
 Click on the Connected network.
 Select “Manual” option from HTTP Proxy.
 Set ‘Server value as system IP address and Port value to 8080 as per JMeter setup.
 Now start the application on the device and its each request will be recorded in
JMeter.
How to Test Mobile App Performance
using Apache JMeter?
How to Test Mobile App Performance
using Apache JMeter?
How to Test Mobile App Performance
using Apache JMeter?
 6. Click on ‘Save’.
 7. Now start the application on the device and its each request will be recorded in JMeter.
 8. Before running the application, make sure that HTTP(S) script recorder was started in JMeter.
 9. Once the application is started, the actions of the script will be recorded under “Recording
Controller.”
 10. Once actions are done in the application, stop the script recording by clicking ‘Stop’ button in
HTTP(S) script recorder screen.
 11. Now, expand the “Recording Controller” in JMeter. You can view all the Recorded scripts of
whatever actions are done in the applications.
 12. Finally, click the ‘Play’ button. It will run recorded scripts as per your Threads setup.
 13. Click on “View Results in Tree”. Here you will see the result of your script.
Apache JMeter Distributed Testing Step-
by-step
1.On the slave systems, go to jmeter/bin directory and execute jmeter-server.bat (jmeter-serveron unix).
2.On master system acting as the console, open windows explorer
and go to jmeter/bin directory
3.Open jmeter.properties in a text editor
4.Edit the line remote_hosts=127.0.0.1
5.Add the IP address. For example, if I have JMeter server running on 192.168.0.10, …, 192.168.0.15,
the entry would like like this:
remote_hosts=192.168.0.10,192.168.0.11,192.168.0.12,192.168.0.13,192.168.0.14
Distributed Testing Step-by-step
Distributed Testing
How Do I Run JMeter in Non-GUI Mode?
 Step 1. Prepare the JMeter test
 Open your *.jmx file
 Remove all graphic data writers
 They will not work in the non-gui mode and there no need to keep them in testing
scenario
Step
 jmeter -n -t C:UserskatamaiahjDesktopapache-jmeter-
2.13binexamplesdemoflipkart29_03_2018.jmx
 -l C:UserskatamaiahjDesktopapache-jmeter-
2.13binexamplesCSVSample_user.csv
Step 2. Run the JMeter test
 Go to bin folder of your JMeter installation from command prompt
 Type the following command:
 JMeter -n -t D:TestScriptsscript.jmx -l D:TestScriptsscriptresults.jtl
 -n [This specifies JMeter is to run in non-gui mode]
 -t [name of JMX file that contains the Test Plan]
 -l [name of JTL file to log sample results to]
 -j [name of JMeter run log file].
References
 http://jmeter.apache.org/
 http://www.oracle.com/technetwork/java/javase/downloads/index.html
http://JMeter.apache.org/download_JMeter.cgi
 http://www.tutorialspoint.com/jmeter/jmeter_tutorial.pdf
http://www.johnandcailin.com/files/ApacheJMeterChapter6.pdf

How to use Jmeter for performance testing

  • 1.
    What is PerformanceTesting  To Check the Application behaviour to various load condition is called Performance testing. Why do Performance Testing?  Nobody likes using a slow application. Performance testing is necessary to make sure your application runs quickly, is stable, and can scale.
  • 2.
    Attributes of PerformanceTesting 1.Speed - Determines whether the application responds quickly 2.Scalability - Determines maximum user load the software application can handle. 3.Stability - Determines if the application is stable under varying loads
  • 3.
  • 4.
    Types of Testing People will be able to make search on travel website portals with Origin, Destination, Departure , Arrival date and No.of passengers  So we are giving the request to the website, Travel API providers are integrated on website then fetching data from travel API Providers data base and display it to the website.  And the portal will be integrated with the payment gateway for the customers to pay through Credit cards, Debit cards and Net banking.  Finally through travel portal development the customers wiil be able to make search on website , book a hotel or flight and pay online which reduce the extra work of travel agents.
  • 5.
    Advantages of JMeter Booking.com API Booking.com is leading travel agency with more than 200 thousands of hotels in different categories in different countries .  Expedia API Expedia is a large database of Hotels say 4,35,000 in 1500 destinations. It is one of the most used API for hotel reservation system.  Amadeus API Amadeus API is the best Global distribution system for flight booking site . It has 75,000 travel agencies and 11,000 airlines to run their services.
  • 6.
    JMeter Workflow  APIstands for Application Programming Interface.  API is a software to software interface, not a user interface.  With APIs, applications talk to each other without any user knowledge or intervention.  Implemented by writing function calls in the program.
  • 7.
    1. JMeter Introduction Definition of JMeter  History of JMeter  JMeterFeatures 2.Stepsto Install JMeter  Installation of Java  Download JMeter  Installation of JMeter
  • 8.
    3.Building a TestPlan  Adding and Removing Elements  Loading and Saving Elements  Run the Test Plan  Stop the Test Plan  Clear Results in Test Plan  Building a Workbench
  • 9.
    4.Elements of aTest Plan  Thread Group  Configuration Elements  Timers  Pre-Processor  Post-Processer  Assertions  Listeners  Controllers  Samplers
  • 10.
    5. Application underTest  Generate script using Test Script Reorder  Settings to be done for Test Script Recorder  View the Test Resultsand Analyze the Test Report
  • 11.
    1. JMETER Introduction Apache JMeter is a pure Java application designed to load test client/server software (such as a web application). It may be used to test performance both on static and dynamic resources such as static files, Java Servlets, ASP.NET, PHP, CGI scripts, Java objects, databases, FTP servers, and more.  JMeter can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types.
  • 12.
    1.2 History ofJMeter  Stefano Mazzocchi of the Apache Software Foundation was the original developer of JMeter. He wrote it primarily to test the performance of Apache JServ (now called as Apache Tomcat project). Apache later redesigned JMeter to enhance the GUI and to add functional testing capabilities.
  • 13.
    JMeter Features 1. Beingan open source software, it is freely available. 2. It has a simple and intuitive GUI. 3. JMeter can conduct load and performance test for many different server types − Web - HTTP, HTTPS, SOAP, Database via JDBC, LDAP, JMS, Mail - POP3, etc. 4. It is a platform-independent tool. On Linux/Unix, JMeter can be invoked by clicking on JMeter shell script. On Windows, it can be invoked by starting the JMeter.bat file. 5. JMeter store its test plans in XML format. This means you can generate a test plan using a text editor. 6. Its full multi-threading framework allows concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups. 7. It is highly extensible. 8. It can also be used to perform automated and functional testing of the applications.
  • 14.
    2. Steps toInstall JMeter  JMeter is pure Java desktop application, it requires a fully compliant JVM 6 or higher. You can download and install the latest version of Java SE Development Kit.  The following procedure to check whether Java JDK is installed successfully in your system  Navigation: Go to Start-->Enter cmd in search --->Double click on cmd icon--- >Enter command java -version in cmd.
  • 15.
  • 16.
    If Java runtimeenvironment is installed successfully, you will see the output as figure below If nothing displays, please re-install Java SE runtime environment by below process
  • 17.
    2.1 Installation ofJava Check out Windows Versions: The JDK software has two different versions: a 32-bit version and a 64-bit Window Version On Windows 7 you can open the Start menu and choose “Computer” from the list. On the “Computer” screen, click on the button that says “System Properties”, as seen below:
  • 18.
    Downloading the JDKTo download  Downloading the JDK To download the Java Development Kit (JDK), launch your web browser (e.g. Internet Explorer) and go to this address:  http://www.oracle.com/technetwork/java/javase/downloads/index.ht ml
  • 19.
  • 20.
  • 21.
    Downloading the JDKTo download  Once you have accepted the license agreement, you will need to choose a file to download. The Windows files are at the bottom of the screen. If you have a 32-bit  Windows system, you will choose the “Windows x86” file. If you have a 64-bit Windows system, you will need to choose the “Windows x64” file. 2.2 Download JMeter  Open the URL: http://JMeter.apache.org/download_JMeter.cgi  Choose the Binaries file (either zip or tgz) to download as shown in figure below
  • 22.
  • 23.
    2.3Installationof JMeter Installation ofJMeter is extremely easy and simple. You simply unzip the zip/tar file into the directory where you want JMeter to be installed. There is no tedious installation screen to deal with! Simple unzip and you are done! Once the unzipping is done installation directory structure should look like as figure below
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
    Elements of aTest Plan  The elements of the test plan will be added under this item in the left portion of the window  Threads - Each thread simulates a single user hitting the web server.  Note that the actual plan is built under a Thread Group  Thread Groups are under the Threads menu item  Test Fragment- A special type of controller.  You can build a test fragment from other elements under this element  It can be included in the test plan in multiple places  An Include Controller is used to include it
  • 29.
    Elements of aTest Plan  Config Element- Various configuration elements are here  For example the HTTP Request Default element which defines the default host and port etc.  when placed at the same level as the Thread Group they become global configurations.  Timer - various types of timers that can be used to time the test plan  Generally JMeter send requests with no pauses between requests  This does not correspond to the way systems are used by users
  • 30.
    Elements of aTest Plan  Pre Processors - Executes an action prior to a request (Samplers are discussed below)  For example setting parameters for a request  There are scoping rules that apply to Pre Processors  Post-Processors - Executes an action after a request  usually it processes the response data  There are scoping rules that apply to Post-Processors  Assertions - Used to test the responses  Was the response correct  If not fail the response  Generally added as the child of a Sampler (Discussed below)  Listeners - provide access to the information JMeter gathers during the test
  • 31.
    Thread Group  ThreadGroups is a collection of Threads. Each thread represents one user using the application under test. Basically each Thread simulates one real user request to the server.  The controls for a thread group allow you to Set the number of threads for each group.  Navigation  Open JMeter---->Right click on Test Plan----> click on Add--> click on Threads-- -> click on Thread Group
  • 32.
  • 33.
  • 34.
    Thread Group  Threadgroup elements are the beginning points of any test plan. All controllers and samplers must be under a thread group. Other elements, e.g. Listeners, may be placed directly under the test plan, in which case they will apply to all the thread groups. As the name implies, the thread group element controls the number of threads JMeter will use to execute your test. The controls for a thread group allow you to: Set the number of threads Set the ramp-up period Set the number of times to execute the test  Each thread will execute the test plan in its entirety and completely independently of other test threads. Multiple threads are used to simulate concurrent connections to your server application.  The ramp-up period tells JMeter how long to take to "ramp-up" to the full number of threads chosen. If 10 threads are used, and the ramp-up period is 100 seconds, then JMeter will take 100 seconds to get all 10 threads up and running. Each thread will start 10 (100/10) seconds after the previous thread was begun. If there are 30 threads and a ramp-up period of 120 seconds, then each successive thread will be delayed by 4 seconds.
  • 35.
    Thread Group  Ramp-upneeds to be long enough to avoid too large a work-load at the start of a test, and short enough that the last threads start running before the first ones finish (unless one wants that to happen).  Start with Ramp-up = number of threads and adjust up or down as needed. By default, the thread group is configured to loop once through its elements.  Version 1.9 introduces a test run scheduler. Click the checkbox at the bottom of the Thread Group panel to reveal extra fields in which you can enter the start and end times of the run. When the test is started, JMeter will wait if necessary until the start-time has been reached. At the end of each cycle, JMeter checks if the end-time has been reached, and if so, the run is stopped, otherwise the test is allowed to continue until the iteration limit is reached.  Alternatively, one can use the relative delay and duration fields. Note that delay overrides start- time, and duration over-rides end-time.
  • 36.
    4.2 Configuration Elements Configuration Elements allow you to create defaults and variables to be used by Samplers. They are used to add or modify requests made by Samplers. They are executed at the start of the scope of which they are part, before any Samplers that are located in the same scope. Therefore, a Configuration Element is accessed only from inside the branch where it is placed.  Navigation  Right click on Test Plan----> click on Add--->Click on HTTP Cache Manager
  • 37.
  • 38.
    4.3 Timers  Bydefault, a JMeter thread sends requests without pausing between each request. We recommend that you specify a delay by adding one of the available timers to your Thread Group. If you do not add a delay, JMeter could overwhelm your server by making too many requests in a very short amount of time.  The timer will cause JMeter to delay a certain amount of time before each sampler which is in its Scope  If you choose to add more than one timer to a Thread Group, JMeter takes the sum of the  timers and pauses for that amount of time before executing the samplers to which the timers apply. Timers can be added as children of samplers or controllers in order to restrict the samplers to which they are applied.  Navigation  Right click on Test Plan----> click on Add-->click on Timer-->click on constant Timer.
  • 39.
  • 40.
    Pre-processor  A pre-processorelement is something that runs just before a sampler executes. They are often used to modify the settings of a Sample Request just before it runs, or to update variables that are not extracted from response text.  Navigation  Right Click on Test Plan click on Add Preprocessors
  • 41.
  • 42.
    Post-processor  A post-processorexecutes after a sampler finishes its execution. This element is most often used to process the response data, for example, to retrieve a particular value for later use.  Navigation  Right Click on Test Plan click on Add Post processors
  • 43.
  • 44.
    Assertions  Assertions allowyou to assert facts about responses received from the server being tested. Using an assertion, you can essentially "test" that your application is returning the results you expect it to.  For instance, you can assert that the response to a query will contain some particular text. The text you specify can be a Perl-style regular expression, and you can indicate that the response is to contain the text, or that it should match the whole response.  You can add an assertion to any Sampler. For example, you can add an assertion to a HTTP Request that checks for the text, "</HTML>". JMeter will then check that the text is present in the HTTP response. If JMeter cannot find the text, then it will mark this as a failed request.  Navigation  Right Click on Test Plan click on Add  Assertions-->click on Response Assertion
  • 45.
  • 46.
    Listeners  Listeners provideaccess to the information JMeter gathers about the test cases while JMeter runs. The Graph Results listener plots the response times on a graph. The "View Results Tree" Listener shows details of sampler requests and responses, and can display basic HTML and XML representations of the response. Other listeners provide summary or aggregation information.  Listeners can be added anywhere in the test, including directly under the test plan. They will collect data only from elements at or below their level.
  • 47.
  • 48.
    Controllers  JMeter hastwo types of Controllers: Samplers and Logical Controllers. These drive the processing of a test.  Samplers tell JMeter to send requests to a server. For example, add an HTTP Request Sampler if you want JMeter to send an HTTP request. You can also customize a request by adding one or more Configuration Elements to a Sampler.
  • 49.
  • 50.
    Samplers  Samplers tellJMeter to send requests to a server and wait for a response. They are processed in the order they appear in the tree. Controllers can be used to modify the number of repetitions of a sampler.  JMeter samplers include: Ftp Request Http Request Jdbc Request Java Object Request Ldap Request Soap/Xml-Rpc Request Webservice (Soap) Request
  • 51.
  • 52.
  • 53.
    Generate script usingTest Script Reorder
  • 54.
    Settings to bedone for Test Script Recorder
  • 55.
    Settings to bedone for Test Script Recorder
  • 56.
    Settings to bedone for Test Script Recorder
  • 57.
    Follow these stepsto change your proxy setting (for Windows) 1. Click the Chrome menu on the browser toolbar. 2. Select Settings. 3. Click Show advanced settings. 4. In the "Network" section, click Change proxy settings. ... 5. Click LAN settings. 6. Deselect the "Automatically detect settings" checkbox.  Click on customize and control Google chrome button--- >click on Setting--- > Enter Proxy in Search Text box--->click on change Proxy button---> Click on LAN setting Button --- > Deselect the "Automatically detect settings" checkbox ---- >Enable Use Proxy server check box(Proxy server)---- >Enter Address as local host---- >Enter port as 1234 --- > click on ok button
  • 58.
  • 59.
  • 60.
  • 61.
    How to TestMobile App Performance using Apache JMeter?  JMeter records mobile application requests on HTTP(S) Script Recorder and it has features to prepare and run our mobile application performance test scripts. All we have to do is to configure JMeter and Mobile device. In JMeter, we can test both iOS and Android native applications.  Steps to install the certificate: 1. Go to jmeter/bin directory and find the ApacheJmeterTemporaryRootCA.crt file. 2. (If you cannot find the certificate from bin directory, just go to your HTTP(S) script recorder screen in Jmeter and click ‘Start’ button. 3. It will generate new certificate on your bin directory automatically). 2. Attach that file and send an email to yourself. 3.Download from your mail and then install on your device.
  • 62.
    How to TestMobile App Performance using Apache JMeter?  Go to Settings > Wi-Fi option. (Note: Network should be same for both Mobile and Laptop/Desktop).  Click on the Connected network.  Select “Manual” option from HTTP Proxy.  Set ‘Server value as system IP address and Port value to 8080 as per JMeter setup.  Now start the application on the device and its each request will be recorded in JMeter.
  • 63.
    How to TestMobile App Performance using Apache JMeter?
  • 64.
    How to TestMobile App Performance using Apache JMeter?
  • 65.
    How to TestMobile App Performance using Apache JMeter?  6. Click on ‘Save’.  7. Now start the application on the device and its each request will be recorded in JMeter.  8. Before running the application, make sure that HTTP(S) script recorder was started in JMeter.  9. Once the application is started, the actions of the script will be recorded under “Recording Controller.”  10. Once actions are done in the application, stop the script recording by clicking ‘Stop’ button in HTTP(S) script recorder screen.  11. Now, expand the “Recording Controller” in JMeter. You can view all the Recorded scripts of whatever actions are done in the applications.  12. Finally, click the ‘Play’ button. It will run recorded scripts as per your Threads setup.  13. Click on “View Results in Tree”. Here you will see the result of your script.
  • 66.
    Apache JMeter DistributedTesting Step- by-step 1.On the slave systems, go to jmeter/bin directory and execute jmeter-server.bat (jmeter-serveron unix). 2.On master system acting as the console, open windows explorer and go to jmeter/bin directory 3.Open jmeter.properties in a text editor 4.Edit the line remote_hosts=127.0.0.1 5.Add the IP address. For example, if I have JMeter server running on 192.168.0.10, …, 192.168.0.15, the entry would like like this: remote_hosts=192.168.0.10,192.168.0.11,192.168.0.12,192.168.0.13,192.168.0.14
  • 67.
  • 68.
  • 69.
    How Do IRun JMeter in Non-GUI Mode?  Step 1. Prepare the JMeter test  Open your *.jmx file  Remove all graphic data writers  They will not work in the non-gui mode and there no need to keep them in testing scenario Step  jmeter -n -t C:UserskatamaiahjDesktopapache-jmeter- 2.13binexamplesdemoflipkart29_03_2018.jmx  -l C:UserskatamaiahjDesktopapache-jmeter- 2.13binexamplesCSVSample_user.csv
  • 70.
    Step 2. Runthe JMeter test  Go to bin folder of your JMeter installation from command prompt  Type the following command:  JMeter -n -t D:TestScriptsscript.jmx -l D:TestScriptsscriptresults.jtl  -n [This specifies JMeter is to run in non-gui mode]  -t [name of JMX file that contains the Test Plan]  -l [name of JTL file to log sample results to]  -j [name of JMeter run log file].
  • 71.
    References  http://jmeter.apache.org/  http://www.oracle.com/technetwork/java/javase/downloads/index.html http://JMeter.apache.org/download_JMeter.cgi http://www.tutorialspoint.com/jmeter/jmeter_tutorial.pdf http://www.johnandcailin.com/files/ApacheJMeterChapter6.pdf