Skip to content

TCBE 001

Test Case Description Verify that JMeter can fetch data from backend
Test Case ID TCBE-001
Author/Designer Otto Nordling
Date of Creation 04.07.2023
Class Backend

Test Description/Objective

JMeter can be used to load test the server. The objective of this test is to create a very simple test plan for the backend in JMeter.

Test Pre-state

The server is hosted locally in port 3001.

Test Steps

Step No. Step Description Expected Result
1 Open JMeter JMeter should open
2 Right click on 'Test Plan' and add a thread group (Add > Threads (Users) > Thread Group) Thread group should appear under test plan
3 Change 'Number of Threads (users)' and 'Ramp-up period (seconds)' The higher the users to seconds ratio, the bigger the load
4 Right click on the thread group and add a HTTP request (Add > Sampler > HTTP Request) An HTTP Request should appear under the thread group
5 Change 'Server Name or IP' to 'localhost', 'Port Number' to '3001', Path to '/api-docs', and 'Name' to something appropriate like 'Documentation' This makes the JMeter GET localhost:3001/api-docs
6 Right click the previous HTTP request and duplicate it There should be another HTTP request of the same name under the thread group
7 Change the name to 'Statinos' and path to /stations This tells the thread group to fetch all the stations
8 Duplicate an HTTP request again Another HTTP request should appear under the thread group
9 Change the path of the new HTTP request to '/stations/24607?includeSensors=true' and rename the HTTP request to 24607 This tells the thread group to GET station with the station ID '24607'
10 Right click on 'Thread Group and add 'View Results Tree' (Add > Listener > View Results Tree) 'View Results Tree' appears under the thread group
11 Hit 'Start' All the thread groups appear under 'View Results Tree' as many times as there were users, and have a green check mark next to them signifying that the tests passed

To be taken into account during the test

  • Load testing can put a significant load on your server, so make sure you perform these tests in a controlled environment and avoid testing on production systems without proper planning.

Test Result (Pass/Fail Criteria)

  • PASS condition: The 'View Results Tree' shows all users with all green check marks
  • FAIL condition: Pass condition is not fulfilled