Requestly
HTTP InterceptorPricingRequestly vs PostmanBlogDocsDownload

Home / Guides / How to Insert Smoke Test Script on Production for New Builds

How to Insert Smoke Test Script on Production for New Builds

Introduction

Ensuring stability in new production builds is crucial, and smoke tests are a quick way to check key functionalities. Running these tests without disrupting users can be tricky, but Requestly simplifies this process. In this blog, we’ll show you how to use Requestly to insert smoke test script into the production environment, ensuring your builds are reliable before full deployment.

Why Smoke Testing is Important on Production

  • Quick Validation: Smoke tests provide a fast and efficient way to validate the core functionalities of your application.
  • Catch Critical Issues Early: Detect any critical issues in the new build before they impact end users.
  • Minimize Downtime: Ensures that the application remains stable and minimizes the risk of downtime.

Using Requestly to Insert Smoke Test Scripts

1. Install Requestly

First, install the Requestly extension from the Chrome Web Store or Requestly’s official website. Once installed, you’ll see the Requestly icon in your browser.

Add to Chrome Add to Safari Add to Edge Add to Firefox Open App Download for other platforms

Other Browser Extensions

Desktop Clients

2. Set Up an Insert Script Rule

The Insert Script Rule in Requestly allows you to inject custom JavaScript into web pages, enabling you to run scripts like smoke tests in a production environment. This feature helps you test new builds or configurations without altering the live codebase.

Insert Smoke Test Script

  • **Code Editor →**Add your smoke test script.
  • ****Source Condition →****Specify which URLs this rule should affect.

Install Requestly Browser Extension if not installed already Try This Rule

Or create your own Rule by following the steps below

Here’s how you can insert a smoke test script using Requestly:

  1. Open Requestly: Open Requestly app.
  2. Create a New Rule: Click on New Rule and choose Insert Script.
  3. Enter the URL Pattern: Add the URL pattern for the pages where you want to insert the smoke test script. This specifies where the script will be injected.
  4. Add the Script: Paste your smoke test JavaScript code into the provided field. This script will run on the specified pages, performing the necessary checks.
  5. Save the Rule: Click Save to apply the rule.

Interactive Guide

Here’s the guide to understanding the Insert Script rule.

Best Practices for Smoke Testing on Production

  • Limit Scope: Focus only on critical functionalities to minimize risks.
  • Monitor Performance: Keep an eye on application performance to ensure that the smoke test doesn’t introduce latency or other issues.
  • Use Version Control: Version your smoke test scripts to ensure traceability and easier rollbacks if necessary.

Conclusion

Smoke testing on production is a vital step in ensuring the reliability of new builds. With Requestly, you can seamlessly insert and manage smoke test scripts in your production environment without disturbing your end users. By following the steps outlined in this blog, you can automate and streamline your smoke testing process, leading to more robust and stable deployments.

Explore More:

Try it in Requestly, the free, privacy-first API client and HTTP interceptor for developers.

Download Free →