Intellisense

Welcome to PruTAN's Intellisense feature — an intelligent code assistance tool that boosts productivity by offering context-aware suggestions for environment variables, predefined functions etc. during script writing.
With Intellisense, you can discover available commands, environment variables, and built-in methods without memorizing syntax, making script creation faster, more accurate, and error-free.

Image 1 : Request Body

Image 2 : Pre-request Script

Image 3 : Validation Tab

Overview

Intellisense in PruTAN provides predefined code completion suggestions for PruTAN's built-in functions, environment variables, and chained methods. It offers a fixed set of intelligent suggestions that adapt based on the editor context — whether in request bodies, pre-request scripts, rules, or validation tabs.

How to Use Intellisense

PruTAN's Intellisense is activated using the keyboard shortcut:

Ctrl + Space

Depending on the active editor context, Intellisense displays relevant options such as environment variables, functions, and chained methods.

In Request Body

When editing request body content, Intellisense provides two essential prefixes for accessing dynamic data:

  • {{ → Access Global and Selected Environment Variables
  • {{$ → Access Pre-defined PruTAN Functions

Example Usage:

{
  "productId": "{{$generateRandomNumber(5)}}",
  "productName": "{{productName}}",
  "price": "{{$generateAmount(4,2)}}"
}

Explanation:

  • {{productName}} → Retrieves a value from the global or selected environment
  • {{$generateAmount(4,2)}} → Utilizes a built-in PruTAN function

In Pre-request Scripts & Rules

Within Pre-request Scripts or Rules, Intellisense detects available script-level objects and functions. Pressing Ctrl + Space displays options including:

OptionDescription
reqAccess and modify request body, headers, or params
resAccess and update response data
fnUse predefined PruTAN functions in rules and pre-request space
envAccess Global or Selected Environment variables
preReqAccess parent collection's pre-request data
preResAccess parent collection's pre-response data
{{Access environment variables
{{$Access predefined functions in req/response fields

Example:

// Using Intellisense in Pre-request Script
let id = fn.generateRandomNumber(6);
req.setBody("Request.Customer.Id", id);
print("Generated ID:", id);

Method Chaining Support

PruTAN's Intellisense supports method chaining, enabling interactive exploration of nested commands.

After selecting an object (like req, res, or env), type a dot (.) followed by Ctrl + Space to see all available sub-properties or methods.

Example:

req. // Press Ctrl + Space

// Will display suggestions like:
getBody()   setBody()   addHeader()   getHeader()   getParam()

// Complete usage:
req.getBody("Request.Customer.Id");

In Validation Tab

In the Validation tab, Intellisense provides objects and functions for writing JavaScript-based validation scripts.

Available objects include:

  • req → Access request data
  • res → Access response data
  • pv → Execute test validations or assertions

Example:

pv.expect(res.getStatus()).toBe(200);
// Check JSON response property
pv.test("Check JSON response property value", res.isValuePresent("address.country", "India"));

Example Use Case

Scenario: Creating a dynamic API request with environment variables and functions.

{
  "userId": "{{userId}}",
  "sessionToken": "{{$guid()}}",
  "timestamp": "{{$generateDate('yyyy-MM-dd HH:mm:ss')}}",
  "amount": "{{$generateAmount(4,2)}}"
}
// Pre-request script
let token = fn.guid();
req.setHeader("Authorization", token);
req.setBody("requestId", fn.generateRandomNumber(10));

This demonstrates how Intellisense helps create dynamic, data-driven requests efficiently.

The Intellisense feature in PruTAN serves as an intelligent coding companion — enabling faster automation, easier method discovery, and improved scripting accuracy across all modules. Whether you're a beginner or expert, Intellisense makes PruTAN more accessible and productive.