Overview

This page documents the Testing Guide feature of Request Man.

Test Scripts & Assertions Request GET https://api.example.com/users/123 Params Tests Pre-request Script // Test: Status code is 200 rm.test( "Status code is 200" , function () { rm.response.to.have.status( 200 ); }); // Test: Response has user data rm.test( "Response has user data" , function () { const jsonData = rm.response.json(); rm.expect(jsonData).to.have.property( "name" ); }); Test Results (2/2 passed) Status code is 200 12ms Response has user data 8ms
Documentation in Progress: Full documentation for this feature coming soon!

Key Features

The Testing Guide feature provides powerful capabilities for API testing and development.

Powerful Assertions ✓ Status code validation ✓ Response body checks ✓ Header verification 📚 Chai BDD Syntax ✓ expect(), to.equal(), to.have ✓ Readable test assertions ✓ Full Chai library support 📝 JavaScript Tests ✓ Full JavaScript support ✓ rm.* API for testing ✓ Pre/Post request scripts 📦 Collection-Level Tests ✓ Run tests on all requests ✓ Shared test logic ✓ Batch testing {{}} Variable Management ✓ Set variables in tests ✓ Share data between requests ✓ rm.environment.set() 📊 Test Reports ✓ Visual test results ✓ Pass/fail statistics ✓ Execution time tracking

Getting Started

Access the Feature

Navigate to Testing Guide in the Request Man interface.

Configure Settings

Set up your Testing Guide preferences.

Start Using

Begin using Testing Guide in your API workflows!

Step 1: Write test script rm.test( "User created successfully" , function() { rm.response.to.have.status( 201 ); const json = rm.response.json(); rm.expect(json.id).to.be.a( "number" ); }); Step 2: Send request with tests POST https://api.example.com/users Send Step 3: View test results ✓ Test Results: All tests passed (3/3) User created successfully 15ms Status code is 201 8ms Response has user ID as number 5ms

Examples

Here are practical examples of using Testing Guide:

Example: Complete Test Suite for User API Test Scripts // Test 1: Status code validation rm.test("Status code is 200", function() { rm.response.to.have.status(200); }); // Test 2: Response time check rm.test("Response time is less than 200ms", function() { rm.expect(rm.response.responseTime).to.be.below(200); }); // Test 3: Data validation rm.test("User has required fields", function() { const user = rm.response.json(); rm.expect(user).to.have.all.keys("id", "name", "email"); }); Response 200 OK 145ms { "id": 123, "name": "John Doe", "email": "john@example.com" } Test Results ✓ All tests passed (3/3) • Total time: 28ms Status code is 200 Response time is less than 200ms User has required fields

Tips & Best Practices

Tip 1

Learn the keyboard shortcuts for faster workflow.

Tip 2

Use variables for flexibility across environments.

Tip 3

Save and organize your work in collections.

Tip 4

Check the console for detailed logging information.