|
| 1 | +--- |
| 2 | +id: api-testing-chrome-extension |
| 3 | +title: API Test Recorder (Chrome Extension) |
| 4 | +sidebar_label: API Test Recorder |
| 5 | +description: Learn how to install, record, export, and auto-generate Keploy tests straight from your browser. |
| 6 | +--- |
| 7 | + |
| 8 | +Install the extension, hit **Record API Calls**, exercise your web app, then press **Generate Tests** to send the captured traffic to Keploy. |
| 9 | + |
| 10 | +## What the API Test Recorder does |
| 11 | + |
| 12 | +**Browser-side traffic capture** — Sniffs XHR / fetch calls as you click around. |
| 13 | + |
| 14 | +**Instant replay formats** — Export the captured calls as cURL, JSON, or native Keploy YAML. |
| 15 | + |
| 16 | +**URL filtering & debugging** — Limit capture to specific endpoints and auto-repair partial request/response pairs. |
| 17 | + |
| 18 | +**One-click test generation** — Push traffic to Keploy Console and instantly get ready-to-run API tests with assertions. |
| 19 | + |
| 20 | +## Installation |
| 21 | + |
| 22 | +1. [Open the Chrome Web Store listing for **Keploy API Test Recorder**](https://chromewebstore.google.com/detail/keploy-api-test-recorder/ohcclfkaidblnjnggclkiecgkpgldihe) |
| 23 | + |
| 24 | +2. Click **Add to Chrome → Add Extension**. |
| 25 | + Chrome will download the signed build and enable it automatically. |
| 26 | + |
| 27 | +3. Pin the **Keploy API Test Recorder** icon for quick access: |
| 28 | + **Extensions** **⋮ → Pin**. |
| 29 | + |
| 30 | +## Quick-start workflow |
| 31 | + |
| 32 | +1. **Log in** with the same email you use on app.keploy.io. |
| 33 | +2. Click **Record API Calls**. |
| 34 | +3. In another tab, **exercise your app** as a normal user (create an account, add to cart, etc.). |
| 35 | +4. Watch the live counters: |
| 36 | + - **Captured calls** – total XHR/fetch requests intercepted. |
| 37 | + - **Complete req/resp** – pairs where both request _and_ response were fully captured. |
| 38 | +5. If the count of req/res is lower than expected, hit **Debug** to repair missing pairs. |
| 39 | + Example : |
| 40 | + |
| 41 | +``` |
| 42 | +DEBUG SUMMARY: |
| 43 | +
|
| 44 | +Total calls: 33 |
| 45 | +Complete (status+body): 2 |
| 46 | +Incomplete: 31 |
| 47 | +Has status but no body: 13 |
| 48 | +Has body but no status: 0 |
| 49 | +Flagged as complete: 30 |
| 50 | +Records repaired: 15 |
| 51 | +``` |
| 52 | + |
| 53 | +6. Press **Generate Tests**. |
| 54 | + - The extension POSTs the capture set to `https://app.keploy.io`. |
| 55 | + - Your browser opens a new tab showing test-case generation progress. |
| 56 | + - When done, you’ll see a **Test Suite** with runnable cases |
| 57 | +7. From **Export Format**, choose: |
| 58 | + - **cURL Commands** – one-liner per call, shareable in Slack/Gist. |
| 59 | + - **Keploy YAML** – ready for `keploy run`. |
| 60 | + - **JSON** – raw payloads for custom tooling. |
| 61 | +8. Click **Export Data** to download **or** **Copy** to clipboard. |
| 62 | + |
| 63 | +## UI reference |
| 64 | + |
| 65 | +| Button / Field | Purpose | Notes | |
| 66 | +| --------------------- | ------------------------------------------------- | ------------------------------------------ | |
| 67 | +| **Logout** | Clear auth token & stop background listeners. | Re-login any time. | |
| 68 | +| **Record API Calls** | Starts/stops the capture session. | Active state is shown in red. | |
| 69 | +| **Captured calls** | Blue counter of total requests. | Includes incomplete pairs. | |
| 70 | +| **Complete req/resp** | Green counter of fully captured pairs. | This is the number exported. | |
| 71 | +| **Check Status** | Quick health-check of the local capture DB. | |
| 72 | +| **Debug** | Attempts to stitch orphaned requests & responses. | |
| 73 | +| **Reset DB** | DANGER: Wipes all local capture data. | Irreversible; handy before a new test run. | |
| 74 | +| **URL Filter** | Regex or plain URL substring. | Leave blank to capture everything. | |
| 75 | +| **Copy** | Copies the export to clipboard. | Good for quick pastes into terminal. | |
| 76 | +| **Generate Tests** | Sends data to Keploy Console & redirects. | Requires active internet. | |
| 77 | + |
| 78 | +## Best practices |
| 79 | + |
| 80 | +- **Enter URL** – Set the URL Filter to the base domain you want Keploy to record. This keeps captures focused on the traffic that matters. |
| 81 | +- **Keep sessions short** – Generate tests for one functional flow at a time; iterate rather than record everything in one go. |
| 82 | + |
| 83 | +## Troubleshooting |
| 84 | + |
| 85 | +| Symptom | Possible cause | Fix | |
| 86 | +| ------------------------------------------------------------ | -------------------------------------------- | ------------------------------------------------------------------ | |
| 87 | +| `Captured calls` increments, but `Complete req/resp` stays 0 | Responses blocked by CORS or Service Worker. | Click **Debug**, or whitelist the domain in extension permissions. | |
| 88 | +| “Network error” when pressing **Generate Tests** | Auth token expired. | Log out, log back in. | |
0 commit comments