Table of contents
1.
Introduction
2.
Test Warm-up
3.
Test Duration
3.1.
Limiting Load by Test Duration
3.2.
Limiting Load by the Number of Executed Targets
4.
Run Multiple Scenarios
4.1.
Add a scenario
4.2.
Copy scenario configuration
4.3.
Assign virtual users to scenarios
4.4.
Delete a scenario
5.
Frequently Asked Questions
5.1.
What are the major types of assertions available in ready API?
5.2.
What is an API?
5.3.
Is it possible to plan a run in ReadyAPI?
6.
Conclusion
Last Updated: Mar 27, 2024

Warm-up, Durations, and running multiple tests in Ready API

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

ReadyAPI is a low-code API testing platform for development teams that care about creating test automation across any workflow. The ReadyAPI ensures end-to-end quality for all your APIs and web services, connect and tests every API type, adds complex assertion logic without any scripting or code, and provides Flexible API testing options for continuous integration and deployment. In this blog, we will see how it is used for running multiple tests, warm-ups, and duration services related to Ready API.

Test Warm-up

It can take some time for the server to begin reliably responding when the test first starts. The first five seconds of a load test typically don't yield data that we can trust, impacting your overall statistics. As a result, it is wise to include a warm-up period in your test during which requests are made, but no data is gathered. Open the Load Test Editor and enter the test start delay into the Warm-up Time field to establish the warm-up time for your tests.

API load testing with ReadyAPI: Test Warm-Up

Image source

Test Duration

The test duration and the total number of functional tests that have been run can be limited in ReadyAPI. Although limiting test duration is more typical, ReadyAPI can also conduct a certain number of queries if necessary.

Limiting Load by Test Duration

If you utilize this approach, you specify the time for which the test will run. If Duration equals zero, the test will run infinitely. To set load duration:

  • Choose a time unit (seconds, minutes, or hours) from the drop-down list.
  • Write the test duration in the text box.
     
API load testing with ReadyAPI: Setting the Test Duration

Limiting Load by the Number of Executed Targets

If you utilize this approach, you specify the number of functional tests executed during the test run. If Max Target Runs becomes -1, the test will run infinitely. To set the maximum number of executed functional tests:

  • Choose the load test. The Load test will appear.
     

Image source

  • Enter the number of functional tests that will be run during the execution.
     

Image source

Run Multiple Scenarios

On the tested server, virtual users replicate client actions. To do this, each virtual user executes a user scenario—a series of targets or ReadyAPI Test test cases.

The simplest load test scenario has all virtual users replicate the identical client behavior by running one scenario. You can utilize many scenarios in a test to make a load test seem more realistic. This makes it easier to imitate several behavior patterns in the same test, such as having some customers add items to their baskets while others ask about price adjustments.

Additionally, you can mix different load scenarios, for instance, to imitate a slow rise in the server's peak user count throughout an extended soak test.

Add a scenario

To add a scenario to your load test:

  • In the load test editor, click Add Scenario below the existing scenarios.
    – or –
    While a load test editor is open, click on the main ReadyAPI toolbar.
  • Enter the scenario name in the subsequent dialog box:
     
Adding a scenario to a load test

Image source

By default, a new scenario includes the 1st test case found in your ReadyAPI project and utilizes the Fixed load profile and five VUs.

Copy scenario configuration

To copy the configuration of 1 scenario to another scenario:

  • In the load test editor, right-click the scenario the configuration you want to copy and choose Copy Scenario Configuration.
  • Right-click the scenario to which you want to paste the configuration and choose Paste Scenario Configuration:
     
Paste scenario configuration

Image source

ReadyAPI copies the following options:

  • Load profile
  • Load profile settings (VUs, timings)
  • Scenario-level assertions
Scenario configuration: copied options

Image source

Assign virtual users to scenarios

The virtual users who will run a scenario can be specified after it has been created. The Load Allocation setting on the toolbar determines how you should proceed. You can either specify a base number and then set a fraction of this value for each scenario, or you can set a load for each scenario separately:

Load Allocation setting

Image source

Rename a scenario

  • In the load test editor, right-click the needed scenario and select Rename Scenario from the context menu.
    – or –
    Select the scenario in the load test editor, and then click the scenario name in the property editor on the right:
  • Enter a new scenario name in the subsequent dialog box:
     
Rename a scenario

Image source

Delete a scenario

Right-click a scenario in the load test editor, and choose Remove Scenario from the context menu:

Remove a scenario

Image source

Frequently Asked Questions

What are the major types of assertions available in ready API?

Assertions are validation rules applied to test results that check how your target web service performs. In ReadyAPI Test tests, you use assertions to verify response codes, response headers, individual values in response bodies, request execution time and to do other checks.

What is an API?

Application Programming Interfaces (APIs) provide data interchange and communication between two software systems. APIs serve as an interface between two applications, enabling communication between the two computer programs.

Is it possible to plan a run in ReadyAPI?

You can use task scheduling tools or continuous integration (CI) tools to arrange the execution of ReadyAPI functional tests.

Conclusion

In this blog, we discussed how to run multiple tests in Ready API, what are warm-ups and durations and how to use them. Then we discussed various scenarios- how to add them, copy and even delete them along with its limitations.

For more content, Refer to our guided paths on Coding Ninjas Studio to upskill yourself.

Do upvote our blogs if you find them helpful and engaging!

Happy Learning!

Live masterclass