Skip to main content

Testing Web Applications with Apache JMeter

Apache JMeter is a tool that allows you to test your application by creating different types of loads on a web application.
Seyfettin Kahveci
Seyfettin Kahveci
10 min. read
Apache JMeter İle Web Uygulamalarını Test Etmek

Protocols Supported by JMeter

  • HTTP, HTTPS web applications
  • SOAP (Web services)
  • Database drivers via JDBC
  • LDAP
  • JMS
  • POP3, IMAP, SMTP
  • FTP

Features of JMeter

  • It is open source.
  • It is developed with Swing GUI (Graphical User Interface) framework using Java.
  • Other written Swing components can be integrated into Jmeter.
  • JMeter saves test plans in XML format and allows them to be reused.
  • It is a multi-thread application.
  • It provides many performance tests and load tests.

A number of tests performed to determine whether websites reach the desired performance values before interacting with real users and to determine the usability limits are called functional test, load test, stress test and performance test. With JMeter, it is possible to measure the performance of your web application by applying these tests and receiving reports.

User scenarios simulated with JMeter, the inputs requested by the web application can be differentiated and constructed to create the desired load on the system.

JMeter tests the application by using it as a virtual user. It uses the HTTP protocol to appear as a virtual user. The test plan given to JMeter determines which page is called, when and with what information. If the test plan is processed in line with this information, JMeter will connect to the application via HTTP protocol and start travelling your web pages with the requested data.

The application is tested with more than one different test scenarios for proximity to reality, and the reports are analysed with the test results obtained such as http response times, the amount of increase and decrease of the resources used, memory leak impression.

A Sample Home Page Test

After JMeter is opened, we change its name from the "Test Plan" page according to our example. In our example, since we will test the home page of drupart.com.tr, we changed its name to "Drupart Test Plan".

Right click on "Drupart Test Plan" and select Add->Threads (Users)->Thread Group.

In the "Thread Group" tab, we set the number of users, the test second interval, the number of repetitions and the decision to be taken when a sampler error is encountered.

Right click on "Thread Group" and select Add->Config Element->HTTP Request Default.

"HTTP Request Default" is an element added to use the same settings on all pages to be requested. We fill the server name and protocol fields according to our scenario.

Right click on "Thread Group" and select Add->Sampler->HTTP Request.

"HTTP Request" is the element used to make a request to the page. In the "HTTP Request Default" element, we can leave this field blank because we assign drupart.com.tr as default to the "Server Name or IP" field.

Since we will not post data on the page to be requested, the "Method" in the Basic tab is set to GET. Since the page to be requested is the homepage, the "Path" field is entered as /. In the Advanced tab, Retrieve All Embedded Resources is selected.

Right click on "Thread Group" and select Add->Listener->View Results Tree.

"View Results Tree" is one of the most used result screens where we can follow and record the test results. "Sampler Result" under this field returns test results related to request time, number of errors and many request pages. "Request" returns the request information sent. "Response Data" is the field that will allow us to see the source code of the page returned as a result of the request according to the selection type. We can enter the file name to be recorded in the "Filename" field and specify the fields to be recorded with "Configure".

The relevant sample and format are selected according to how we want the response to be returned from the server.

Right click on "Thread Group" and select Add->Listener->View Results in Table.

We can run it with the Start button and see our results in a table and record them at the same time. We can enter the file name to be saved in the "Filename" field and specify the fields to be saved with "Configure".

 

Our Offices

Drupart Locations

Our Officess

London

151 West Green Road, London, England

442038156478

[email protected]

Drupart R&D

GOSB Teknopark Hi-Tech Bina 3.Kat B3 Gebze - KOCAELİ

+90 262 678 8872

[email protected]

Newark

112 Capitol Trail Suite, A437 Newark DE, 19711

+17406666255

[email protected]

Wiesbaden

Hinterbergstraße 27
65207 Wiesbaden
Deutschland

+49 (0) 6151 – 492 70 23

[email protected]