Documentation Index

Fetch the complete documentation index at: https://kb.kentik.com/llms.txt

Use this file to discover all available pages before exploring further.

Transaction Test Scripts

Prev Next

This article covers how to create, validate, and interpret the results of Transaction test scripts in Kentik’s Synthetics.

Note: Only Admin users can manage Synthetics tests in the Kentik portal.

About Transaction Test Scripts

While standard HTTP or Page Load tests measure the performance of a single request or page rendering, Transaction tests are designed to monitor complex, multi-step user journeys (e.g., logging into a portal, adding an item to a shopping cart, or submitting a form).

To execute these journeys, Kentik’s Synthetics uses headless Chrome browsers driven by Puppeteer, a Node.js library. A Transaction test requires a custom JavaScript (Puppeteer) script that instructs the browser exactly which actions to take, elements to click, and inputs to fill.

Creating a Transaction Script

While you can write Puppeteer scripts manually from scratch, the most efficient way to generate a script for a Transaction test is by using the Recorder panel built into Google Chrome’s Developer Tools.

Step 1: Record the User Journey in Chrome

  1. Open Google Chrome and navigate to the starting URL of your transaction.

  2. Open Chrome Developer Tools (Right-click and select Inspect, or press Ctrl+Shift+I / Cmd+Opt+I).

  3. Click the More options (three dots) menu in DevTools, navigate to More tools, and select Recorder.

  4. Click Create a new recording and give it a descriptive name.

  5. Click the red Record button at the bottom of the screen.

  6. Perform the exact sequence of actions you want to test (e.g., click a specific button, type into a text field, navigate to a new page).

  7. When finished, click End recording.

Step 2: Export to Puppeteer

  1. In the Chrome Recorder panel, click the Export icon (a downward-pointing arrow).

  2. Select Puppeteer script from the dropdown menu.

  3. Save the .js file to your local machine or copy the generated code directly to your clipboard.

Step 3: Add to Kentik Synthetics

  1. In the Kentik portal, navigate to the Tests page and either add a new Transaction test or edit an existing one.

  2. Open the Target and Agents tab in the sidebar.

  3. Locate the Puppeteer script text box.

  4. Paste your generated script into the box.

    Note: You may need to review and modify the script to ensure any sensitive data (like hardcoded passwords) is handled appropriately according to your organization's security practices.

Validating a Transaction Script

Because transaction scripts are custom code, it is critical to validate them before activating the test to ensure they execute successfully without syntax errors or broken selectors.

  1. Once your script is pasted into the Puppeteer script box, locate the Validate button below the text area.

  2. Click Validate. Kentik will run a dry-run of the script from a single testing agent.

  3. Review the validation output:

    • Success: The console will confirm the script completed the required steps within the allowed execution time.

    • Failure: The console will return an error log (e.g., TimeoutError: waiting for selector failed). You must debug the script, often by updating a changed CSS selector or adding a wait time (waitForNavigation or waitForSelector), and re-validate until successful.

Viewing Transaction Results

Once your Transaction test is active and collecting data, you can view the execution details in the Synthetics Test Results page.

Because Transaction tests simulate multi-step processes, the results include unique metrics not found in standard HTTP tests:

  • Total Transaction Time: The total time taken to execute the entire Puppeteer script from start to finish.

  • Step-by-Step Execution Time: A waterfall view breaking down how long each discrete action (click, typing, page navigation) took to complete.

  • Failure Screenshots: If a transaction fails mid-execution (e.g., a login button is missing or a page times out), the test results will typically capture and display a screenshot of the browser's state at the exact moment of failure, making it easier to diagnose the root cause.