Image of a python code editor showing "Hello World"

Getting Started With TestChimp

An npm install and a config line. Thats all it takes to enable always-on test session capture and test automation with TestChimp.

Quick Start

Step 1 – Sign Up

Sign up at https://prod.testchimp.io/signup and create a project. Once created, go to Profile (Top Right) -> Project Settings -> Select the project, and copy the project id and the session recording api key values (to use in next step).

Step 2 – Install SDK

Run:

npm install testchimp-js@latest

Step 3 – Configure SDK

Add the following to your index.js (or equivalent)

import { TestChimpSDK } from "testchimp-js";

document.addEventListener('DOMContentLoaded', function() {
TestChimpSDK.startRecording({
projectId: "[PROJECT ID]",
sessionRecordingApiKey: "[SESSION RECORDING API KEY]",
untracedUriRegexListToTrack: ".*\\.your-domain\\.com.*$",
environment:"QA"
});
});

For a more detailed configuration guide (such as sampling probability, enabling recording conditionally on different environments etc.), refer here.

Step 4 – SetCurrentUserId (Recommended)

Call TestChimpSDK.setCurrentUserId(“<user_id>”) anytime during the session to record a readable user identifier (such as email), which will enable finding sessions by those user ids in TestChimp platform.

Step 5 – EndTrackedSession (Recommended)

Call TestChimpSDK.endTrackedSession() when the user logs out.

By default, the tracked session is cleared when the browser is closed. If you want to end the session when the user logs out from your application, call TestChimpSDK.endTrackedSession() when the user logs out.

Enabling Full Stack Capture

The above steps enable capturing frontend API interactions in a session (along with the UI), which can be used to create automation tests covering the API layer.

To enable full stack recording (and tests that cover the entire stack), do the following:

  1. Enable OpenTelemetry in your stack. Guide
  2. Add the relevant TestChimp backend SDK (and configure) in your backend services
  3. Change the untracedUriRegexListToTrack config key to tracedUriRegexListToTrack

See here for a comprehensive guide on enabling OpenTelemetry and exporting to TestChimp.

Currently the following technologies are supported:

NodeJS: Link

Java Spring: Link

Share the Post:

Related Posts