Jmeter Elements | Complete Element reference for Jmeter - jmeter - jmeter tutorial



What is Jmeter Elements?

  • The different components of JMeter are called Elements. Each Element is designed for a specific purpose.
  • The figure below gives the some common elements in JMeter.
 types of jmeter threads
  • Studying all the componens at one go is an invitation to confusion and boredome. Here, we will discuss the must-know components before you can start Testing in JMeter. Remaining components will be discussed as when they are used in the succeeding tutorials. The elements discussed in this tutorial are:
    • Thread Group
    • Samplers
    • Listeners
    • Configuration

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.
  • For example, if you set the number of threads as 100; JMeter will create and simulate 100 user requests to the server under test.
 process of threadgroup
jmeter tutorials - jmeter load testing - jmeter download - download jmeter - apache jmeter

Samplers

  • As we know already that JMeter supports testing HTTP, FTP , JDBC and many other protocols.
  • We already know that Thread Groups simulate user request to the server
  • But how does a Thread Group know which type of requests (HTTP, FTP etc.) it needs to make ?
  • The user request could be FTP Request, HTTP Request, JDBC Request...Etc.
 types of samplers

FTP request:

  • Let imagine you want to performance test an FTP server. You can use FTP request sampler in JMeter to do this task.
  • This controller lets you send an FTP "download file" or "upload file" request to an FTP server.
 process of jmeter FTP server
  • For example, if you want to download a file "Test.txt" from a FTP server under test, you need to configure some parameters in JMeter as figure below
  • JMeter will send FTP command to FTP server ftp.example.com, and then download a file Test.txt from that server.

HTTP request:

  • This sampler lets you send an HTTP/HTTPS request to a web server.
  • Consider the example below. JMeter send a HTTP request to Google website and retrieve HTML files or image from this website.
 process of http request
  • In the tutorial JMeter Performance Testing, we will explain more about this HTTP request.
 configuration of http request defaults

JDBC request:

  • This sampler lets you execute Database Performance Testing. It sends a JDBC Request (an SQL query) to a database.
 process of jdbc request
  • For example, a database server has a field test_result stored in a table name test_tbl. You want to query this data from the database server; you can configure JMeter to send a SQL query to this server to retrieve data.
 configuration of jdbc request
jmeter tutorials - jmeter load testing - jmeter download - download jmeter - apache jmeter

BSF Sampler:

  • This sampler allows you to write a sampler using a BSF scripting language.
  • Here is an example of BSF Sampler in JMeter
 configuration of bsf sampler

Access Log Sampler:

  • This sampler allows you to read access logs and generate http requests. The log could be image, html, css....
 process of access log sampler
jmeter tutorials - jmeter load testing - jmeter download - download jmeter - apache jmeter

SMTP Sampler:

  • If you want to test a mail server, you can use SMTP sampler. This sampler is used to send email messages using SMTP protocol.
 configuration of smtp sampler

Listeners

  • Listeners: shows the results of the test execution. They can show results in different format such as tree, table, graph or log file
 process of listeners execution

Graph

  • Graph result listeners display the server response times on a Graph.
 display of graph result

View

  • View Result Tree show results of user request in basic HTML format.
 display of view result tree output

Table

  • Table Result show summary of test result in table format
 table of view result
jmeter tutorials - jmeter load testing - jmeter download - download jmeter - apache jmeter

Log

  • Log show summary of test result in the text file
 display of log table

Configuration Elements

  • set up defaults and variables for later use by samplers.
  • The figure below shows some commonly used configuration elements in JMeter
 types of configuration elements

CSV Data Set Config:

  • Suppose you want to test a website for 100 users signing-in with different credentials.
  • You do not need to record the script 100 times! You can parameterization the script to enter different login credentials. This login information (e.g. Username, password) could be stored in a text file.
  • JMeter has an element that allows you to read different parameters from that text file.
  • It is "CSV Data Set Config", which is used to read lines from a file, and split them into variables.
 configuration of csv dataset
  • This is an example of CSV Data. It's a text file which contains user and password to login your target website.
 login of csv data

HTTP Cookie Manager

  • Let's understand this with an example -
  • You used your browser (Firefox, IE...Etc) to browse www.wikitechy.com
  • You login with your user and password.
  • Your username and password will be stored in your computer as cookies.
  • Next time, when you visit www.wikitechy.com , you don't need to do login again because your browser will use your cookies as user data to login.
  • HTTP Cookie Manager also has the same feature like a web browser. If you have an HTTP Request and the response contains a cookie, the Cookie Manager automatically stores that cookie and will use it for all future requests to that particular web site.
 configuration of http cookie manager

HTTP request default

  • This element lets you set default values that your HTTP Request controllers use.
  • For example,
  • You are sending 100 HTTP requests to the server wikitechy.com
  • You would have to manually enter server name = google.com for all these 100 requests
  • Instead, you could add a single HTTP request defaults with the "Server Name or IP" field = google.com
  • No need to type 100 times!
 configuration of http request defaults
  • This element will be explained detail in JMeter Performance Testing
jmeter tutorials - jmeter load testing - jmeter download - download jmeter - apache jmeter

Login Config Element

  • The Login Config Element lets you add or override username and password settings in samplers.
  • For example, you want to simulate one user login to website www.facebook.com with user and password.
  • You can use Login Config Element to add these user and password setting in user request
 configuration of login config element
  • The Login Config Element vs. the CSV data Config
Login Config Element CSV Data Config
Used to simulate one user login Suitable Used to simulate multiple user login Suitable for large
for login parameter only (user and password) numbers of parameters

This jmeter tutorial site provides you to the following keypoints on meter interview questions , apache jmeter download , apache jmeter , jmeter load testing , jmeter plugins , jmeter download , download jmeter , jmeter tutorials , load testing jmeter , jmeter summary report , jmeter apache , jmeter api testing , what is jmeter , jmeter load testing example , learn jmeter , how jmeter works , jmeter web service testing , jmeter example , jmeter load testing tutorial , install jmeter , load testing with jmeter , download jmeter for windows , performance testing using jmeter , jmeter functions , mobile app performance testing using jmeter , jmeter gui , install jmeter ubuntu , jmeter stress test , how to use jmeter

Related Searches to Jmeter Elements | Complete Element reference for Jmeter