SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Downloaden Sie, um offline zu lesen
Automating with
JMeter Apache
Prepared by Wira.
Introduction - Automation
 Automation testing which is also known as Test Automation, is when the tester
writes scripts and uses another software to test the software.
 This process involves automation of a manual process.
 Automation Testing is used to re-run the test scenarios that were performed
manually, quickly and repeatedly (regression).
 Apart from regression testing, Automation testing is also used to test the
application from load, performance and stress point of view.
 It increases the test coverage; improve accuracy, saves time and money in
comparison to manual testing.
What to Automate?
 It is not possible to automate everything in the Software; however the areas
at which user can make transactions such as login form or registration forms
etc, any area where large amount of users accessing.
 Furthermore all GUI items, connections with databases, field validations etc
can be efficiently tested by automating too.
When to Automate?
 Test Automation should be uses by considering the following for the Software:
 Large and critical projects.
 Projects that require testing the same areas frequently.
 Requirements not changing frequently.
 Accessing the application for load and performance with many virtual users.
 Stable software with respect to manual testing.
 Availability of time.
How to Automate?
 Automation is done by using a supportive computer language like scripting
language and an automated software application.
 There are a lot of tools available which can be use to write automation
scripts.
 Software Testing Tools: HP Quick Test Professional, Selenium, JMeter,
IBM Rational Functional Tester, SilkTest, TestComplete, Testing Anywhere,
WinRunner, Load Runner, Visual Studio Test Professional, WATIR.
Introduction - 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 (a project
that has since been replaced by the Apache Tomcat project).
 Apache JMeter is a 100% pure Java desktop 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, 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.
 Additionally, JMeter can help you regression test your application by letting you
create test scripts with assertions to validate that your application is returning the
results you expect. For maximum flexibility, JMeter lets you create these assertions
using regular expressions.
 Note: JMeter is not a browser.
Getting started…
 The easiest way to begin using JMeter is to first download the latest production
release and install it. The release contains all of the files you need to build and
run most types of tests, e.g. Web (HTTP/HTTPS), FTP, JDBC, LDAP, Java, and
JUnit.
 URL: http://jmeter.apache.org/download_jmeter.cgi
 Requirements:
 JMeter requires a fully compliant JVM/JRE 6 or higher.
 JMeter is a 100% Java application and should run correctly on any system that has a
compliant Java implementation.
 Installation: To install a release build, simply unzip the zip/tar file into the
directory where you want JMeter to be installed. Provided that you have a
JRE/JDK correctly installed and the JAVA_HOME environment variable set, there
is nothing more for you to do.
Running – Jmeter…
To run JMeter, run the jmeter.bat (for Windows) or jmeter (for Unix) file. These files are
found in the bin directory. After a short pause, the JMeter GUI should appear.
Building a Basic Web Test Plan…
 In this section, we will learn how to create a basic Test Plan to test a Web site.
 We will create five users that send requests to two pages on the JMeter Web site.
 Also, we will tell the users to run their tests twice.
 So, the total number of requests is (5 users) x (2 requests) x (repeat 2 times) = 20 HTTP requests.
 To construct the Test Plan, we will be using the following elements: Thread Group, HTTP Request,
HTTP Request Defaults, and Graph Results (Note: There are many elements are available in
JMeter – refer below URL: http://jmeter.apache.org/usermanual/index.html --> Section
“Elements of a test plan”
Thread Group - Adding Users
 The Thread Group tells JMeter the number of users we want to simulate, how often the users should
send requests, and the how many requests they should send.
 Go ahead and add the ThreadGroup element by first selecting the Test Plan, clicking your right
mouse button to get the Add menu, and then select Add --> ThreadGroup.
 Next, increase the number of users (called threads) to 5.
 In the next field, the Ramp-Up Period, This property tells JMeter how long to delay between
starting each user. For example, if you enter a Ramp-Up Period of 5 seconds, JMeter will finish
starting all of your users by the end of the 5 seconds. So, if we have 5 users and a 5 second Ramp-
Up Period, then the delay between starting users would be 1 second (5 users / 5 seconds = 1 user
per second). If you set the value to 0, then JMeter will immediately start all of your users.
 Finally enter a value of 2 in the Loop Count field. This property tells JMeter how many times to
repeat your test. If you enter a loop count value of 1, then JMeter will run your test only once. To
have JMeter repeatedly run your Test Plan, select the Forever checkbox.
Adding Default HTTP Request Properties
 Now that we have defined our users, it is time to define the tasks that they will be
performing.
 In this section, we will specify the default settings for your HTTP requests.
 And then, in next section (HTTP Request element), you will add HTTP Request elements
which use some of the default settings you specified here.
 Begin by selecting the JMeter Users (Thread Group) element. Click your right mouse
button to get the Add menu, and then select Add --> Config Element --> HTTP Request
Defaults.
 For the Test Plan that we are building, all HTTP requests will be sent to the same Web
server, jmeter.apache.org. Enter this domain name into the field. This is the only field
that we will specify a default, so leave the remaining fields with their default values.
 Note: Nearly all web testing should use cookie support, unless your application
specifically doesn't use cookies. To add cookie support, simply add an HTTP Cookie
Manager to each Thread Group in your test plan. This will ensure that each thread gets
its own cookies, but shared across all HTTP Request objects. *** To add the HTTP Cookie
Manager , simply select the Thread Group , and choose Add --> Config Element --> HTTP
Cookie Manager.
Note: The HTTP Request Defaults element does not tell JMeter to send an HTTP request.
It simply defines the default values that the HTTP Request elements use.
Adding HTTP Requests
 In our Test Plan, we need to make two HTTP requests. The first one is for the JMeter
home page (http://jmeter.apache.org/), and the second one is for the Changes page
(http://jmeter.apache.org/changes.html).
 JMeter sends requests in the order that they appear in the tree.
 Start by adding the first HTTP Request to the JMeter Users element (Add --> Sampler -
-> HTTP Request).
 Steps:
 Change the Name field to "Home Page".
 Set the Path field to "/". Remember that you do not have to set the Server Name field
because you already specified this value in the HTTP Request Defaults element.
 Next, add the second HTTP Request and edit the following properties:
 Change the Name field to "Changes".
 Set the Path field to "/changes.html".
Listener- Adding a Graph Result
 The final element you need to add to your Test Plan is a Listener .
 This element is responsible for storing all of the results of your HTTP requests in a file and
presenting a visual model of the data.
 Select the JMeter Users element and add a Graph Results listener (Add --> Listener -->
Graph Results).
 Next, we need to specify a directory and filename of the output file. You can either type it
into the filename field, or select the Browse button and browse to a directory and then
enter a filename.
Logging in to a web-site…
 It's not the case here, but some web-sites require you to login before permitting you to
perform certain actions. In a web-browser, the login will be shown as a form for the user
name and password, and a button to submit the form.
 The button generates a POST request, passing the values of the form items as parameters.
 To do this in JMeter, add an HTTP Request, and set the method to POST.
 You'll need to know the names of the fields used by the form, and the target page.
 These can be found out by inspecting the code of the page.
Can we do Recording using JMeter ???
Yes… we can – using one of the best
components called “HTTP Proxy Server”
 The HTTP Proxy Server allows JMeter to watch and record your actions while
you browse your web application with your normal browser.
 JMeter will create test sample objects and store them directly into your test
plan as you go.
 To use the proxy server, add the HTTP Proxy Server element to the
workbench.
 Select the WorkBench element in the tree, and right-click on this element to
get the Add menu (Add --> Non-Test Elements --> HTTP Proxy Server).
Step by step guide using HTTP Proxy
Server…
 This tutorial attempts to explain the exact steps for JMeter's proxy. For those new to JMeter, one easy
way to create a test plan is to use the Proxy. What the proxy does is it records the requests sent to the
server.
1. Go to JMETER_HOME/bin and start JMeter with jmeter.bat (on windows)
2. Select “Test Plan” on the tree.
3. Right click on the “Test Plan” and add a new thread group: Add > Threads (Users) > Thread Group
4. Select the Thread Group.
5. Right click “Add -> Config Element -> HTTP Request Defaults”
6. In new HTTP Request Defaults element: Server name – enter “jmeter.apache.org”
7. Path – leave blank
8. Right click on the “Thread Group” and add a recording controller: Add > Logic
Controller > Recording Controller
9. Next, select WorkBench
10. Right click on WorkBench and add the Http proxy: Add -> Non-Test Elements -> HTTP Proxy Server
11. On HTTP Proxy Server, click the “Add” button in “URL Patterns to Include”. (This will create a blank entry).
12. Enter “.*.html”
13. Click 3 times, the “Add” button in “URL Patterns to Exclude”. (This will create 3 blank entries).
14. Enter “.*.png” pattern, “.*.gif” pattern and “.*.ico” pattern
15. Right click on “HTTP Proxy Server” and add a listener: Add -> Listener -> View Results Tree
16. Return to HTTP Proxy Server, and click the “Start” button at the bottom.
Configure your brower to use the JMeter HTTP Proxy
 At this point, JMeter's proxy is running.
 For this exercise, we will use Firefox to record some pages on JMeter.
17. Start Firefox, but do not close JMeter.
18. From the tool bar, click “Tools > Preferences”. This should bring up the options.
19. Select the “Advanced” tab, and “Network” tab.
20. Click “Settings” button near the bottom.
21. On the new popup, check “Manual proxy configuration”. The address and port fields should be
enabled now.
22. Address – enter “localhost” or the IP address of your system.
23. Port – enter “8080”.
24. Check the “Use this proxy server for all protocols”
25. Click “ok” button
26. Click “ok” button again. This should return you to the browser.
Record your navigation
27. With your brower, in the “Address” bar at the top, enter
“http://jmeter.apache.org/index.html” and hit the “enter” key.
28. Click on a few links on JMeter's pages.
29. Close your browser and bring up the JMeter window.
Expand the thread group and there should be several samplers. At this point,
the test plan can be saved as is.
30. Select “Thread Group”.
31. Right click “Add -> Listener -> Summary Report” to add an summary listener.
32. The summary listener will show some basic statistics.
33. Select “Thread Group”.
34. Number of Threads – enter “5”.
35. Ramp up Period – do not change.
36. Loop Count – enter 100
Start the test (with test plan)…
At this point, we are ready to run our test plan and see what happens. Save the test plan.
When you're ready to run the test, there's two ways:
1. Run -> Start
2. Ctrl–R
Before you start the test, select “Summary Report”. As the test runs, the statistics will change
until the test is done. At the end of the test, the summary report should look like this.
While the test is running, in the upper right-hand corner, there should be a green square.
When the test is done, the box should be grey.
The End…

Weitere ähnliche Inhalte

Was ist angesagt?

Apache JMeter - A brief introduction
Apache JMeter - A brief introductionApache JMeter - A brief introduction
Apache JMeter - A brief introductionsilenceIT Inc.
 
Performance testing jmeter
Performance testing jmeterPerformance testing jmeter
Performance testing jmeterBhojan Rajan
 
Presentation on Apache Jmeter
Presentation on Apache JmeterPresentation on Apache Jmeter
Presentation on Apache JmeterSabitri Gaire
 
Perofrmance testing and apache jmeter
Perofrmance testing and apache jmeterPerofrmance testing and apache jmeter
Perofrmance testing and apache jmeterlethibichhoa
 
Jmeter Performance Testing
Jmeter Performance TestingJmeter Performance Testing
Jmeter Performance TestingAtul Pant
 
Performance testing and reporting with JMeter
Performance testing and reporting with JMeterPerformance testing and reporting with JMeter
Performance testing and reporting with JMeterjvSlideshare
 
Performance Testing With Jmeter
Performance Testing With JmeterPerformance Testing With Jmeter
Performance Testing With JmeterAdam Goucher
 
Performance testing with JMeter
Performance testing with JMeterPerformance testing with JMeter
Performance testing with JMeterMikael Kundert
 
Basic of jMeter
Basic of jMeter Basic of jMeter
Basic of jMeter Shub
 
Performance testing with jmeter
Performance testing with jmeter Performance testing with jmeter
Performance testing with jmeter Knoldus Inc.
 
Performance testing and j meter
Performance testing and j meterPerformance testing and j meter
Performance testing and j meterPurna Chandar
 
Performance testing using jmeter
Performance testing using jmeterPerformance testing using jmeter
Performance testing using jmeterRachappa Bandi
 
Load Testing Using JMeter Tutorial | Edureka
Load Testing Using JMeter Tutorial | EdurekaLoad Testing Using JMeter Tutorial | Edureka
Load Testing Using JMeter Tutorial | EdurekaEdureka!
 
JMeter - Performance testing your webapp
JMeter - Performance testing your webappJMeter - Performance testing your webapp
JMeter - Performance testing your webappAmit Solanki
 
Performance Testing from Scratch + JMeter intro
Performance Testing from Scratch + JMeter introPerformance Testing from Scratch + JMeter intro
Performance Testing from Scratch + JMeter introMykola Kovsh
 
Load and performance testing
Load and performance testingLoad and performance testing
Load and performance testingQualitest
 

Was ist angesagt? (20)

Jmeter From Scratch
Jmeter From ScratchJmeter From Scratch
Jmeter From Scratch
 
Apache JMeter - A brief introduction
Apache JMeter - A brief introductionApache JMeter - A brief introduction
Apache JMeter - A brief introduction
 
Performance testing jmeter
Performance testing jmeterPerformance testing jmeter
Performance testing jmeter
 
Presentation on Apache Jmeter
Presentation on Apache JmeterPresentation on Apache Jmeter
Presentation on Apache Jmeter
 
Perofrmance testing and apache jmeter
Perofrmance testing and apache jmeterPerofrmance testing and apache jmeter
Perofrmance testing and apache jmeter
 
Jmeter Performance Testing
Jmeter Performance TestingJmeter Performance Testing
Jmeter Performance Testing
 
Performance testing and reporting with JMeter
Performance testing and reporting with JMeterPerformance testing and reporting with JMeter
Performance testing and reporting with JMeter
 
Apache jMeter
Apache jMeterApache jMeter
Apache jMeter
 
Performance Testing With Jmeter
Performance Testing With JmeterPerformance Testing With Jmeter
Performance Testing With Jmeter
 
Performance testing with JMeter
Performance testing with JMeterPerformance testing with JMeter
Performance testing with JMeter
 
Basic of jMeter
Basic of jMeter Basic of jMeter
Basic of jMeter
 
Performance testing with jmeter
Performance testing with jmeter Performance testing with jmeter
Performance testing with jmeter
 
Performance testing and j meter
Performance testing and j meterPerformance testing and j meter
Performance testing and j meter
 
Performance testing using jmeter
Performance testing using jmeterPerformance testing using jmeter
Performance testing using jmeter
 
JMeter workshop
JMeter workshopJMeter workshop
JMeter workshop
 
JMeter
JMeterJMeter
JMeter
 
Load Testing Using JMeter Tutorial | Edureka
Load Testing Using JMeter Tutorial | EdurekaLoad Testing Using JMeter Tutorial | Edureka
Load Testing Using JMeter Tutorial | Edureka
 
JMeter - Performance testing your webapp
JMeter - Performance testing your webappJMeter - Performance testing your webapp
JMeter - Performance testing your webapp
 
Performance Testing from Scratch + JMeter intro
Performance Testing from Scratch + JMeter introPerformance Testing from Scratch + JMeter intro
Performance Testing from Scratch + JMeter intro
 
Load and performance testing
Load and performance testingLoad and performance testing
Load and performance testing
 

Andere mochten auch

How to Analyze Reports in Jmeter
How to Analyze Reports in JmeterHow to Analyze Reports in Jmeter
How to Analyze Reports in JmeterViviana Lesmes
 
Interpreting Performance Test Results
Interpreting Performance Test ResultsInterpreting Performance Test Results
Interpreting Performance Test ResultsEric Proegler
 
What Is JMeter?
What Is JMeter?What Is JMeter?
What Is JMeter?QATestLab
 
Load Testing & Apache JMeter
Load Testing & Apache JMeterLoad Testing & Apache JMeter
Load Testing & Apache JMeterWO Community
 
Benchmarking layout
Benchmarking  layout Benchmarking  layout
Benchmarking layout mrhoang_hanam
 
Introduction to JMeter
Introduction to JMeterIntroduction to JMeter
Introduction to JMeterRahul Sudame
 
Using JMeter and Google Analytics for Software Performance Testing
Using JMeter and Google Analytics for Software Performance TestingUsing JMeter and Google Analytics for Software Performance Testing
Using JMeter and Google Analytics for Software Performance TestingXBOSoft
 
uTest Course Summary: Test case writing course
uTest Course Summary: Test case writing courseuTest Course Summary: Test case writing course
uTest Course Summary: Test case writing courseuTest
 
"Introduction to JMeter" @ CPTM 3rd Session
"Introduction to JMeter" @ CPTM 3rd Session"Introduction to JMeter" @ CPTM 3rd Session
"Introduction to JMeter" @ CPTM 3rd SessionTharinda Liyanage
 
Tests for Every Branch Using CircleCI and Sauce Labs to Continuously Test CS ...
Tests for Every Branch Using CircleCI and Sauce Labs to Continuously Test CS ...Tests for Every Branch Using CircleCI and Sauce Labs to Continuously Test CS ...
Tests for Every Branch Using CircleCI and Sauce Labs to Continuously Test CS ...Sauce Labs
 
How To Add Any Feature To Your Selenium Grid
How To Add Any Feature To Your Selenium GridHow To Add Any Feature To Your Selenium Grid
How To Add Any Feature To Your Selenium GridSauce Labs
 
Sqa, test scenarios and test cases
Sqa, test scenarios and test casesSqa, test scenarios and test cases
Sqa, test scenarios and test casesConfiz
 

Andere mochten auch (14)

How to Analyze Reports in Jmeter
How to Analyze Reports in JmeterHow to Analyze Reports in Jmeter
How to Analyze Reports in Jmeter
 
Interpreting Performance Test Results
Interpreting Performance Test ResultsInterpreting Performance Test Results
Interpreting Performance Test Results
 
What Is JMeter?
What Is JMeter?What Is JMeter?
What Is JMeter?
 
Load Testing & Apache JMeter
Load Testing & Apache JMeterLoad Testing & Apache JMeter
Load Testing & Apache JMeter
 
Benchmarking layout
Benchmarking  layout Benchmarking  layout
Benchmarking layout
 
JMeter
JMeterJMeter
JMeter
 
Basics-Test Case Writing
Basics-Test Case WritingBasics-Test Case Writing
Basics-Test Case Writing
 
Introduction to JMeter
Introduction to JMeterIntroduction to JMeter
Introduction to JMeter
 
Using JMeter and Google Analytics for Software Performance Testing
Using JMeter and Google Analytics for Software Performance TestingUsing JMeter and Google Analytics for Software Performance Testing
Using JMeter and Google Analytics for Software Performance Testing
 
uTest Course Summary: Test case writing course
uTest Course Summary: Test case writing courseuTest Course Summary: Test case writing course
uTest Course Summary: Test case writing course
 
"Introduction to JMeter" @ CPTM 3rd Session
"Introduction to JMeter" @ CPTM 3rd Session"Introduction to JMeter" @ CPTM 3rd Session
"Introduction to JMeter" @ CPTM 3rd Session
 
Tests for Every Branch Using CircleCI and Sauce Labs to Continuously Test CS ...
Tests for Every Branch Using CircleCI and Sauce Labs to Continuously Test CS ...Tests for Every Branch Using CircleCI and Sauce Labs to Continuously Test CS ...
Tests for Every Branch Using CircleCI and Sauce Labs to Continuously Test CS ...
 
How To Add Any Feature To Your Selenium Grid
How To Add Any Feature To Your Selenium GridHow To Add Any Feature To Your Selenium Grid
How To Add Any Feature To Your Selenium Grid
 
Sqa, test scenarios and test cases
Sqa, test scenarios and test casesSqa, test scenarios and test cases
Sqa, test scenarios and test cases
 

Ähnlich wie Automate Testing with Apache JMeter

Software testing
Software testingSoftware testing
Software testingnil65
 
Perfromane Test Tool jmeter
Perfromane Test Tool jmeterPerfromane Test Tool jmeter
Perfromane Test Tool jmeterNaga Mallala
 
Performancetestingjmeter 131210111657-phpapp02
Performancetestingjmeter 131210111657-phpapp02Performancetestingjmeter 131210111657-phpapp02
Performancetestingjmeter 131210111657-phpapp02Nitish Bhardwaj
 
JMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeterJMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeterRapidValue
 
Jmeter proxy step_by_step
Jmeter proxy step_by_stepJmeter proxy step_by_step
Jmeter proxy step_by_stepKapil Chawla
 
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip BannonSoft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip BannonDavid O'Dowd
 
Elments Used on Jmeter
Elments Used on JmeterElments Used on Jmeter
Elments Used on JmeterViviana Lesmes
 
Day1_Apache_JMeter_Overview
Day1_Apache_JMeter_OverviewDay1_Apache_JMeter_Overview
Day1_Apache_JMeter_OverviewSravanthi N
 
Performance testing with Jmeter
Performance testing with JmeterPerformance testing with Jmeter
Performance testing with JmeterPrashanth Kumar
 
Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Shivakumara .
 
jmeter - Google Search.pdf
jmeter - Google Search.pdfjmeter - Google Search.pdf
jmeter - Google Search.pdfMohanKoppala3
 
Jmeter interviewquestions
Jmeter interviewquestionsJmeter interviewquestions
Jmeter interviewquestionsgirichinna27
 
Jmeter memory profiling, server-side monitoring, memory and cpu monitoring
Jmeter memory profiling, server-side monitoring, memory and cpu monitoringJmeter memory profiling, server-side monitoring, memory and cpu monitoring
Jmeter memory profiling, server-side monitoring, memory and cpu monitoringPankaj Biswas
 
performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02Gopi Raghavendra
 
performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)QA Programmer
 

Ähnlich wie Automate Testing with Apache JMeter (20)

Software testing
Software testingSoftware testing
Software testing
 
Perfromane Test Tool jmeter
Perfromane Test Tool jmeterPerfromane Test Tool jmeter
Perfromane Test Tool jmeter
 
Performancetestingjmeter 131210111657-phpapp02
Performancetestingjmeter 131210111657-phpapp02Performancetestingjmeter 131210111657-phpapp02
Performancetestingjmeter 131210111657-phpapp02
 
JMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeterJMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeter
 
Jmeter proxy step_by_step
Jmeter proxy step_by_stepJmeter proxy step_by_step
Jmeter proxy step_by_step
 
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip BannonSoft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
Soft Test Ireland - Introduction to Jakarta Jmeter - Philip Bannon
 
JMETER-SKILLWISE
JMETER-SKILLWISEJMETER-SKILLWISE
JMETER-SKILLWISE
 
Jmeter
JmeterJmeter
Jmeter
 
Elments Used on Jmeter
Elments Used on JmeterElments Used on Jmeter
Elments Used on Jmeter
 
JMeter Intro
JMeter IntroJMeter Intro
JMeter Intro
 
Day1_Apache_JMeter_Overview
Day1_Apache_JMeter_OverviewDay1_Apache_JMeter_Overview
Day1_Apache_JMeter_Overview
 
Performance testing with Jmeter
Performance testing with JmeterPerformance testing with Jmeter
Performance testing with Jmeter
 
Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02Performancetestingjmeter 121109061704-phpapp02
Performancetestingjmeter 121109061704-phpapp02
 
jmeter - Google Search.pdf
jmeter - Google Search.pdfjmeter - Google Search.pdf
jmeter - Google Search.pdf
 
Jmeter interviewquestions
Jmeter interviewquestionsJmeter interviewquestions
Jmeter interviewquestions
 
JMeter_ Cubet Seminar ppt
JMeter_ Cubet Seminar pptJMeter_ Cubet Seminar ppt
JMeter_ Cubet Seminar ppt
 
Wap tquickstart
Wap tquickstartWap tquickstart
Wap tquickstart
 
Jmeter memory profiling, server-side monitoring, memory and cpu monitoring
Jmeter memory profiling, server-side monitoring, memory and cpu monitoringJmeter memory profiling, server-side monitoring, memory and cpu monitoring
Jmeter memory profiling, server-side monitoring, memory and cpu monitoring
 
performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02
 
performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)
 

Kürzlich hochgeladen

办理西悉尼大学毕业证成绩单、制作假文凭
办理西悉尼大学毕业证成绩单、制作假文凭办理西悉尼大学毕业证成绩单、制作假文凭
办理西悉尼大学毕业证成绩单、制作假文凭o8wvnojp
 
Call Girls In Dwarka Sub City ☎️7838079806 ✅ 💯Call Girls In Delhi
Call Girls In Dwarka Sub City  ☎️7838079806 ✅ 💯Call Girls In DelhiCall Girls In Dwarka Sub City  ☎️7838079806 ✅ 💯Call Girls In Delhi
Call Girls In Dwarka Sub City ☎️7838079806 ✅ 💯Call Girls In DelhiSoniyaSingh
 
Inspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptxInspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptxShubham Rawat
 
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ EscortsDelhi Escorts Service
 
南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证kbdhl05e
 
西伦敦大学毕业证学位证成绩单-怎么样做
西伦敦大学毕业证学位证成绩单-怎么样做西伦敦大学毕业证学位证成绩单-怎么样做
西伦敦大学毕业证学位证成绩单-怎么样做j5bzwet6
 
Call Girls in Govindpuri Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Govindpuri Delhi 💯Call Us 🔝8264348440🔝Call Girls in Govindpuri Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Govindpuri Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)oannq
 
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...Authentic No 1 Amil Baba In Pakistan
 
E J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxE J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxJackieSparrow3
 
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 AvilableCall Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilabledollysharma2066
 

Kürzlich hochgeladen (12)

办理西悉尼大学毕业证成绩单、制作假文凭
办理西悉尼大学毕业证成绩单、制作假文凭办理西悉尼大学毕业证成绩单、制作假文凭
办理西悉尼大学毕业证成绩单、制作假文凭
 
Call Girls In Dwarka Sub City ☎️7838079806 ✅ 💯Call Girls In Delhi
Call Girls In Dwarka Sub City  ☎️7838079806 ✅ 💯Call Girls In DelhiCall Girls In Dwarka Sub City  ☎️7838079806 ✅ 💯Call Girls In Delhi
Call Girls In Dwarka Sub City ☎️7838079806 ✅ 💯Call Girls In Delhi
 
Inspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptxInspiring Through Words Power of Inspiration.pptx
Inspiring Through Words Power of Inspiration.pptx
 
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
(No.1)↠Young Call Girls in Sikanderpur (Gurgaon) ꧁❤ 9711911712 ❤꧂ Escorts
 
南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证南新罕布什尔大学毕业证学位证成绩单-学历认证
南新罕布什尔大学毕业证学位证成绩单-学历认证
 
西伦敦大学毕业证学位证成绩单-怎么样做
西伦敦大学毕业证学位证成绩单-怎么样做西伦敦大学毕业证学位证成绩单-怎么样做
西伦敦大学毕业证学位证成绩单-怎么样做
 
Call Girls in Govindpuri Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Govindpuri Delhi 💯Call Us 🔝8264348440🔝Call Girls in Govindpuri Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Govindpuri Delhi 💯Call Us 🔝8264348440🔝
 
(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)(南达科他州立大学毕业证学位证成绩单-永久存档)
(南达科他州立大学毕业证学位证成绩单-永久存档)
 
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
Authentic No 1 Amil Baba In Pakistan Amil Baba In Faisalabad Amil Baba In Kar...
 
E J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptxE J Waggoner against Kellogg's Pantheism 8.pptx
E J Waggoner against Kellogg's Pantheism 8.pptx
 
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 AvilableCall Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
Call Girls In Karkardooma 83770 87607 Just-Dial Escorts Service 24X7 Avilable
 
Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Lado Sarai Delhi reach out to us at 🔝9953056974🔝
 

Automate Testing with Apache JMeter

  • 2. Introduction - Automation  Automation testing which is also known as Test Automation, is when the tester writes scripts and uses another software to test the software.  This process involves automation of a manual process.  Automation Testing is used to re-run the test scenarios that were performed manually, quickly and repeatedly (regression).  Apart from regression testing, Automation testing is also used to test the application from load, performance and stress point of view.  It increases the test coverage; improve accuracy, saves time and money in comparison to manual testing.
  • 3. What to Automate?  It is not possible to automate everything in the Software; however the areas at which user can make transactions such as login form or registration forms etc, any area where large amount of users accessing.  Furthermore all GUI items, connections with databases, field validations etc can be efficiently tested by automating too.
  • 4. When to Automate?  Test Automation should be uses by considering the following for the Software:  Large and critical projects.  Projects that require testing the same areas frequently.  Requirements not changing frequently.  Accessing the application for load and performance with many virtual users.  Stable software with respect to manual testing.  Availability of time.
  • 5. How to Automate?  Automation is done by using a supportive computer language like scripting language and an automated software application.  There are a lot of tools available which can be use to write automation scripts.  Software Testing Tools: HP Quick Test Professional, Selenium, JMeter, IBM Rational Functional Tester, SilkTest, TestComplete, Testing Anywhere, WinRunner, Load Runner, Visual Studio Test Professional, WATIR.
  • 6. Introduction - 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 (a project that has since been replaced by the Apache Tomcat project).  Apache JMeter is a 100% pure Java desktop 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, 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.  Additionally, JMeter can help you regression test your application by letting you create test scripts with assertions to validate that your application is returning the results you expect. For maximum flexibility, JMeter lets you create these assertions using regular expressions.  Note: JMeter is not a browser.
  • 7. Getting started…  The easiest way to begin using JMeter is to first download the latest production release and install it. The release contains all of the files you need to build and run most types of tests, e.g. Web (HTTP/HTTPS), FTP, JDBC, LDAP, Java, and JUnit.  URL: http://jmeter.apache.org/download_jmeter.cgi  Requirements:  JMeter requires a fully compliant JVM/JRE 6 or higher.  JMeter is a 100% Java application and should run correctly on any system that has a compliant Java implementation.  Installation: To install a release build, simply unzip the zip/tar file into the directory where you want JMeter to be installed. Provided that you have a JRE/JDK correctly installed and the JAVA_HOME environment variable set, there is nothing more for you to do.
  • 8. Running – Jmeter… To run JMeter, run the jmeter.bat (for Windows) or jmeter (for Unix) file. These files are found in the bin directory. After a short pause, the JMeter GUI should appear.
  • 9. Building a Basic Web Test Plan…  In this section, we will learn how to create a basic Test Plan to test a Web site.  We will create five users that send requests to two pages on the JMeter Web site.  Also, we will tell the users to run their tests twice.  So, the total number of requests is (5 users) x (2 requests) x (repeat 2 times) = 20 HTTP requests.  To construct the Test Plan, we will be using the following elements: Thread Group, HTTP Request, HTTP Request Defaults, and Graph Results (Note: There are many elements are available in JMeter – refer below URL: http://jmeter.apache.org/usermanual/index.html --> Section “Elements of a test plan”
  • 10. Thread Group - Adding Users  The Thread Group tells JMeter the number of users we want to simulate, how often the users should send requests, and the how many requests they should send.  Go ahead and add the ThreadGroup element by first selecting the Test Plan, clicking your right mouse button to get the Add menu, and then select Add --> ThreadGroup.  Next, increase the number of users (called threads) to 5.  In the next field, the Ramp-Up Period, This property tells JMeter how long to delay between starting each user. For example, if you enter a Ramp-Up Period of 5 seconds, JMeter will finish starting all of your users by the end of the 5 seconds. So, if we have 5 users and a 5 second Ramp- Up Period, then the delay between starting users would be 1 second (5 users / 5 seconds = 1 user per second). If you set the value to 0, then JMeter will immediately start all of your users.  Finally enter a value of 2 in the Loop Count field. This property tells JMeter how many times to repeat your test. If you enter a loop count value of 1, then JMeter will run your test only once. To have JMeter repeatedly run your Test Plan, select the Forever checkbox.
  • 11.
  • 12. Adding Default HTTP Request Properties  Now that we have defined our users, it is time to define the tasks that they will be performing.  In this section, we will specify the default settings for your HTTP requests.  And then, in next section (HTTP Request element), you will add HTTP Request elements which use some of the default settings you specified here.  Begin by selecting the JMeter Users (Thread Group) element. Click your right mouse button to get the Add menu, and then select Add --> Config Element --> HTTP Request Defaults.  For the Test Plan that we are building, all HTTP requests will be sent to the same Web server, jmeter.apache.org. Enter this domain name into the field. This is the only field that we will specify a default, so leave the remaining fields with their default values.  Note: Nearly all web testing should use cookie support, unless your application specifically doesn't use cookies. To add cookie support, simply add an HTTP Cookie Manager to each Thread Group in your test plan. This will ensure that each thread gets its own cookies, but shared across all HTTP Request objects. *** To add the HTTP Cookie Manager , simply select the Thread Group , and choose Add --> Config Element --> HTTP Cookie Manager.
  • 13. Note: The HTTP Request Defaults element does not tell JMeter to send an HTTP request. It simply defines the default values that the HTTP Request elements use.
  • 14. Adding HTTP Requests  In our Test Plan, we need to make two HTTP requests. The first one is for the JMeter home page (http://jmeter.apache.org/), and the second one is for the Changes page (http://jmeter.apache.org/changes.html).  JMeter sends requests in the order that they appear in the tree.  Start by adding the first HTTP Request to the JMeter Users element (Add --> Sampler - -> HTTP Request).  Steps:  Change the Name field to "Home Page".  Set the Path field to "/". Remember that you do not have to set the Server Name field because you already specified this value in the HTTP Request Defaults element.  Next, add the second HTTP Request and edit the following properties:  Change the Name field to "Changes".  Set the Path field to "/changes.html".
  • 15.
  • 16. Listener- Adding a Graph Result  The final element you need to add to your Test Plan is a Listener .  This element is responsible for storing all of the results of your HTTP requests in a file and presenting a visual model of the data.  Select the JMeter Users element and add a Graph Results listener (Add --> Listener --> Graph Results).  Next, we need to specify a directory and filename of the output file. You can either type it into the filename field, or select the Browse button and browse to a directory and then enter a filename.
  • 17.
  • 18. Logging in to a web-site…  It's not the case here, but some web-sites require you to login before permitting you to perform certain actions. In a web-browser, the login will be shown as a form for the user name and password, and a button to submit the form.  The button generates a POST request, passing the values of the form items as parameters.  To do this in JMeter, add an HTTP Request, and set the method to POST.  You'll need to know the names of the fields used by the form, and the target page.  These can be found out by inspecting the code of the page.
  • 19.
  • 20. Can we do Recording using JMeter ???
  • 21. Yes… we can – using one of the best components called “HTTP Proxy Server”  The HTTP Proxy Server allows JMeter to watch and record your actions while you browse your web application with your normal browser.  JMeter will create test sample objects and store them directly into your test plan as you go.  To use the proxy server, add the HTTP Proxy Server element to the workbench.  Select the WorkBench element in the tree, and right-click on this element to get the Add menu (Add --> Non-Test Elements --> HTTP Proxy Server).
  • 22. Step by step guide using HTTP Proxy Server…  This tutorial attempts to explain the exact steps for JMeter's proxy. For those new to JMeter, one easy way to create a test plan is to use the Proxy. What the proxy does is it records the requests sent to the server. 1. Go to JMETER_HOME/bin and start JMeter with jmeter.bat (on windows) 2. Select “Test Plan” on the tree. 3. Right click on the “Test Plan” and add a new thread group: Add > Threads (Users) > Thread Group
  • 23. 4. Select the Thread Group. 5. Right click “Add -> Config Element -> HTTP Request Defaults” 6. In new HTTP Request Defaults element: Server name – enter “jmeter.apache.org” 7. Path – leave blank
  • 24. 8. Right click on the “Thread Group” and add a recording controller: Add > Logic Controller > Recording Controller
  • 25. 9. Next, select WorkBench 10. Right click on WorkBench and add the Http proxy: Add -> Non-Test Elements -> HTTP Proxy Server
  • 26. 11. On HTTP Proxy Server, click the “Add” button in “URL Patterns to Include”. (This will create a blank entry). 12. Enter “.*.html” 13. Click 3 times, the “Add” button in “URL Patterns to Exclude”. (This will create 3 blank entries). 14. Enter “.*.png” pattern, “.*.gif” pattern and “.*.ico” pattern
  • 27. 15. Right click on “HTTP Proxy Server” and add a listener: Add -> Listener -> View Results Tree
  • 28. 16. Return to HTTP Proxy Server, and click the “Start” button at the bottom.
  • 29. Configure your brower to use the JMeter HTTP Proxy  At this point, JMeter's proxy is running.  For this exercise, we will use Firefox to record some pages on JMeter. 17. Start Firefox, but do not close JMeter. 18. From the tool bar, click “Tools > Preferences”. This should bring up the options. 19. Select the “Advanced” tab, and “Network” tab. 20. Click “Settings” button near the bottom.
  • 30. 21. On the new popup, check “Manual proxy configuration”. The address and port fields should be enabled now. 22. Address – enter “localhost” or the IP address of your system. 23. Port – enter “8080”. 24. Check the “Use this proxy server for all protocols” 25. Click “ok” button 26. Click “ok” button again. This should return you to the browser.
  • 31. Record your navigation 27. With your brower, in the “Address” bar at the top, enter “http://jmeter.apache.org/index.html” and hit the “enter” key. 28. Click on a few links on JMeter's pages. 29. Close your browser and bring up the JMeter window. Expand the thread group and there should be several samplers. At this point, the test plan can be saved as is.
  • 32. 30. Select “Thread Group”. 31. Right click “Add -> Listener -> Summary Report” to add an summary listener. 32. The summary listener will show some basic statistics.
  • 33. 33. Select “Thread Group”. 34. Number of Threads – enter “5”. 35. Ramp up Period – do not change. 36. Loop Count – enter 100
  • 34. Start the test (with test plan)… At this point, we are ready to run our test plan and see what happens. Save the test plan. When you're ready to run the test, there's two ways: 1. Run -> Start 2. Ctrl–R Before you start the test, select “Summary Report”. As the test runs, the statistics will change until the test is done. At the end of the test, the summary report should look like this. While the test is running, in the upper right-hand corner, there should be a green square. When the test is done, the box should be grey.