Scripts in API Automation

Modified on Wed, 29 Oct at 5:34 PM

TABLE OF CONTENTS

1. Overview

2. How to Use Scripts in API Project

1. Overview

This article provides detailed information on using Scripts in the Request section tabs of an API project.


2. How to Use Scripts in API Project

Currently, under the Request Section Tabs>>Scripts section, we only support Pre-request scripts.


When you click the Send button, the pre-request script executes before the actual API request URL is called. This allows you to run JavaScript code for example, using pm.environment.set() to assign a random value or dynamically update environment variables.


Once you click on Send, the data will be stored in the Env. You can view this data under the Env tab.


At present, we support adding dynamic environment data through Pre-request scripts.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article