Skip to content

Executing An API test case

Amanpreet Singh edited this page Jun 28, 2024 · 2 revisions

Test runs in JMeter use 2 different terminals

  1. Faveo Server terminal: Terminal for Server, here Faveo is running , used to run top command.
  2. JMeter Terminal: Terminal for JMeter , here jmeter test execution command is running , used to get summary and execution updates.

Steps to Execute an API Test Plan

Check Network Performance with iPerf (Installation required if not already installed):

Before Running Test Run , Use iPerf to check the bitrate between the server and tester:

  • iperf -s # On server
  • iperf -c server_ip # On client

Update your test plan from JMeter GUI

  1. Pull the script from the Repository.
  2. Open the script in JMeter GUI.
  3. Update the API endpoint and Instance URL details
  4. Check and update the path and content of CSV files (containing user details , ticket details , reply details) in CSV Config module.
  5. Check and update the path of attachments in "Ticket Detail" CSV.
  6. Check and update the variable being fetched from the CSV files or handled using cookie manager module.
  7. Save Your Test Plan from JMeter GUI: File > Save.

Run the test on personal command line/terminal

For better and more accurate test results, run the test on a command line terminal in Linux and store the results in a JTL file. This avoids the overhead introduced by the GUI.

Use the following command to run the test: jmeter -n -t your_test_plan.jmx -l results.jtl

  • -n specifies non-GUI mode.
  • -t specifies the path to the test plan file.
  • -l specifies the path to the results file.

Monitor Server Performance

While the test is running, monitor CPU, RAM, and average load.

Here are the steps to do this:

  1. Open a New Terminal: Launch a terminal on your local machine.

  2. SSH to the Server: Connect to the server where the Faveo instance is running. Replace username and server_ip with your actual server credentials. command: ssh username@server_ip

  3. Run the top Command: Once connected to the server, run the top command to monitor CPU, RAM, and average load in real-time. command: top

Analyze Results

Once the test is complete, open the JTL file in JMeter GUI to check the results.

  • In the GUI, right-click on Test Plan > Add > Listener > View Results Tree.
  • Right-click on Test Plan > Add > Listener > Summary Report.
  • Load the JTL file in these listeners to analyze the test results.

Check for Undesired Responses

In the View Results Tree listener, check if any undesired responses are received or not.

Note required values

  • From the Summary Report, note the required values such as maximum time, minimum time, average time and error percentage etc., and document these in Google Sheets for further analysis.
  • Include the server status from monitored terminal where the top command is running.