Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
Targets
2.1.
Add targets
2.2.
Targets toolbar
2.3.
 
2.4.
 
2.5.
Change Targets
2.6.
Modify test steps
3.
Target Loops
3.1.
Definition
3.2.
Create a Loop
3.3.
Disable a Loop
3.4.
Delete a Loop
4.
Frequently Asked Questions
4.1.
What are the targets in an API?
4.2.
What is an API?
4.3.
What are the three types of API?
5.
Conclusion
Last Updated: Mar 27, 2024

Targets in Ready API

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. This blog will see targets and their various usage in ready API.

Targets

Targets are single pieces of a test scenario that run one after another. You can add a target loop if you need to repeat targets in a cycle.

You can see and change targets in the Targets section of the Load Scenario panel.

Targets

Image source

Add targets

  1. Click Add target.
  2. In the subsequent Add Target dialog, select what a new target will test.
     
Load testing with ReadyAPI: Add Target dialog

Image source

3. Click OK.

A new target will be added to the scenario and executed during each test run.

Targets toolbar

The Targets section has a toolbar with the following commands:

Command Action
Add target

Adds a new target to a test scenario.

It opens the Add Target dialog where you can select the target type of the new target and specify the desired test case, request, or URL.

Remove target

Deletes the selected target.

Alternatively, you can right-click the desired target and select Delete from the context menu.

Add target loop Creates a Target loop.
Moves the target up and Moves the target down Moves the selected target up and down.

 

 

Change Targets

To change a target, right-click the desired target and select Change Target from the context menu.

Modify test steps

To edit test steps:

  • Double-click the desired test step or test case, and select the test case or test step response.

OR

  • Select a test case or a test step and click Edit Test Case or Edit Test Step in the inspector.

Target Loops

Definition

  • During a test run, targets of a scenario run one after another. Target loops help you run some targets several times if needed.
  • A loop can include one or multiple targets.
  • You can create multiple loops in a scenario.
  • Loops can be nested.
  • You can disable loops, when you need normal execution flow of targets (see below).

Create a Loop

  • Click on the toolbar of the scenario section:
     
Add Target Loop

Image source

  • In the subsequent Add Flow dialog, specify the start and end targets for the loop and the number of iterations:
     
Add Flow Dialog

Image source

  • The Number of loops field defines how many times ReadyAPI executes the target. For example, if you input 5, the target will be run 5 times. If you input -1, the loop will run indefinitely.

Change Properties of a Loop

  • Select a loop in the editor.
  • Modify the loop properties in the load test inspector on the right of the screen:
     
API load testing with ReadyAPI: Modifying Loop Properties

Image source

Disable a Loop

  • Select a loop to view its properties.
  • Select the Disable check box in the load test inspector the right of the screen.

To enable the loop, simply clear the Disable check box.

Delete a Loop

  • Select the desired loop in the scenario section.
  • Click Remove target on the toolbar.

Frequently Asked Questions

What are the targets in an API?

A target service defines a web service that you want to use in your API definition.

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.

What are the three types of API?

There are also 3 common types of API architectures: REST, a collection of guidelines for lightweight, scalable web APIs. SOAP, a stricter protocol for more secure APIs. RPC is a protocol for invoking processes that can be written with XML (XML-RPC) or JSON (JSON-RPC).

Conclusion

In this blog, we discussed how to use targets in Ready API. We understood its definition, how to add, change and modify them. Along with this we also learned about target loops, how to create them, disable then delete them.

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