Tuesday, December 22, 2015

Lesson 4 – JMeter Element review (Part 1)

Overview

Now that you know how to build the testing environment for this course, we can start to review the different elements in the JMeter user interface. 

Each Element is unique and designed to serve a specific purpose, therefore you need to understand the capabilities and the power that each element can provide when creating a test Plan.

A JMeter Test plan is built from a few elements (we will review them in the next few paragraphs) that the user can use during the creation of the test plan, the variety of elements will allow the user to gain a more flexible test that he can change based on the test results (the only limitation is that you must use at least one "Thread Group" which holds that combination of one or more elements: Timer..).

 

Thread Group

The Thread Group element is mandatory for every test plan that you build, therefore we can say that this element is the first element that you need to configure during the creation of a test plan.

That's great, but what is the purpose of this element…? The answer is that every Thread Group is a collection of one or more threads (Thread is equal to user) that using the application during the test execution (in other words, every thread that you set in JMeter, is compared to a real user that query the server that is under test).


How can we configure a new "Thread Group"..?


Option 1:  Edit Menu -> Add -> Threads (Users) ->Thread Group
Option 2: On the left Grid -> Right click on "Test Plan" -> Add -> Threads (Users) ->Thread Group

What are the "Thread Group" elements?

 



Name:  The name of the thread group.
Comment: just add a comment if you need one

Number of threads: Remember that each thread is simulate a physical user, this section will determine the number of users that connected a query the server during the test execution.

Ramp-Up Period: How long it takes to JMeter to reach to the full defined number of users. . If, for example, you defined 10 users with ramp-up period of 200 seconds, then JMeter will start all threads within the defined time (Each thread will start 200/10 seconds after the first thread is set to "Running" state (Delay of 20 seconds per thread)).

Loop Count: By default, JMeter will run for a single iteration, if you want to add more iterations you can control it by changing this field value (In other words, it’s the number of times that JMeter will run the test…).

Scheduler/Scheduler configuration: Once selected by the user, a new configuration window will be available with many different options that control the Start\Stop time of the scheduler.

Samplers


As we already know, JMeter uses Thread Groups to simulate a user request to the tested server, but what are the type of requests that we can use? And how JMeter knows which one to send..?
The answer is Samplers, Samplers provide the ability to send a specific types of requests to the target server, and the user can use a predefined list of samplers, some examples:

HTTP Sampler

This sampler allows the thread group to send an HTTP/s Web request to the target server (IIS, Apache…).

Example:

1.       JMeter Send HTTPS Request to a Web Server.

2.       The Server returns his response (HTML page).

3.       JMeter process the server response.

4.       The User receives the analyzed results.



FTP Sampler

This sampler allows the thread group to send an FTP Request to a File Server.

Example:

1.      JMeter Send FTP Request to an FTP Server (We want to examine the response time when requesting to download a file from the server).

2.       The Server returns his response (File objects).

3.       JMeter process the server response.

4.       The User receives the analyzed results.



SMTP Sampler

This sampler allows the thread group to send an SMTP requests to a mail server (Email messages).

Example:

1.       JMeter Send SMTP Request to a Mail Server

2.       The Server returns his response (Server response time).

3.       JMeter process the server response.

4.       The User receives the analyzed results.

Logic Controllers


Logic controllers are assigned at the sampler level and provide the ability to control the sampler's execution and processing order per a sample element (If condition, Loop, Random Controller….). 


No comments:

Post a Comment

My Presentations