Loadmill
Learn moreSchedule a demo
  • Introduction
    • Loadmill - AI - Powered Solution
    • Deviceless mobile testing
      • Capturing traffic with Loadmill MITM Proxy
      • Loadmill desktop recorder
        • Generating test flows
      • Installing certificate on mobile devices
        • iOS certificate installation
        • Android certificate installation
      • Configuring proxy on mobile devices
        • iOS Wi-Fi settings
        • Android Wi-Fi settings
      • Troubleshooting
    • What is an API
      • API - Data Fetching
      • Quick examples of API requests
      • What is an API endpoint?
    • API Server Testing
      • Contract testing
      • Regression Testing
  • Quick Guide
    • Create Account
    • Download Test Composer
    • Register your first API flow
    • Running Your API Test
  • Loadmill Test Composer
    • Quickstart
    • Composer Layout
    • Filter Settings
  • Test Editor
    • Layout
    • Flows
      • Generated Flow Code
      • Test Flow editor
      • Flow Controls
      • Add CSV to Flow
      • Flow Execution
    • Steps
      • Request step
      • Code step
      • Extraction & Assertion step
      • Web Socket step
    • Extractions - Set Parameters
    • Assertions - Verify Response
    • Parameters
      • Parameter Execution Order
      • Test Suite Parameters
      • Parameters Sets
    • ⨍(⨯) FUNCTIONS
    • Postscript
      • Running Postscript
      • Accessing w/ Postscript
      • Validating Postscript
    • Login/Authentication Flow
    • Before & After Hooks
  • Load Testing
    • Load Test Editor
    • Load Testing Guide
    • Analyzing Load Test Results
    • Parameterized Load Test
    • Domain Verification
    • Configuration Files
    • Load Testing FAQs
    • Load Testing Troubleshooting
  • User Behavior Testing
    • Overview
    • Setup
    • Recording troubleshooting
    • Additional recording methods
    • Recording settings
    • How to work with Recordings
  • Auth
    • Okta SSO integration
    • API Tokens
    • Testing with CORS
    • REST API
  • Integrations
    • Loadmill Agent
    • CI integration
    • GitHub
      • CI integration
      • Data sync
    • GitLab
    • Bitbucket
    • Jira
    • New Relic
    • Slack integration
    • TestRail integration
    • Database Testing
    • Kafka Testing
    • Datadog Integration
    • ✉️Email Testing
    • Webhook Testing
    • Integrations FAQs
    • XRay
    • TestRail
    • gRPC Support
  • Collaboration
    • Collaboration
    • Teams
    • Groups & Reports
    • Test Suite Collaboration
    • Reviews
    • Shared Flows
    • Labels
  • Reporting
    • API Catalog & Coverage
      • API Catalog
        • Unique Entity ID's Mapping
        • Domain Mapping and grouping
        • Endpoints grouping
        • OpenAPI upload
      • Test Coverage
        • Generating API test coverage report
  • General
    • Billing
      • Usage report
    • Settings
      • 📈Analytics
        • Flow Run History
      • 🧳Import & Export
    • General FAQs
    • General troubleshooting
    • Comparisons
      • Loadmill vs. SoapUI
      • Loadmill vs. JMeter
      • Loadmill vs. Blazemeter
      • Loadmill vs. WebdriverIO
      • Loadmill vs. Potato
    • Miscellaneous
      • Running a Test Suite
      • Test Plan
      • API Testing troubleshooting
      • API Testing FAQs
      • Test Editor
        • API Tests - Data from CSV files
Powered by GitBook
On this page
  1. Load Testing

Parameterized Load Test

Creating a load test by using parameters and extracting response values

PreviousAnalyzing Load Test ResultsNextDomain Verification

Last updated 2 years ago

In our we have simulated users loading the homepage of our blog, our second test is going to simulate several users publishing new entries to the blog.

  • First create a new empty test. Only logged in users can post to our blog, so let's start by executing a login request and store the authentication token returned by it into a parameter for later use.

  • Give your new test a short description Login & Create a blog post

  • Update the request description to Blog Login

  • Set the Request #1 method to POST and its URL to - https://loadmill-test-blog.herokuapp.com/ghost/api/v0.1/authentication/token/

  • Click the "ADVANCED" button to expand the advanced section of the request.

  • Set the Content-Type to application/x-www-form-urlencoded (last in the list).

  • And paste this as the request body - grant_type=password&username=a@b.com&password=Test1234&client_id=ghost-admin&client_secret=b91601629baf

  • Expand the “Extractions - Set Parameters” card and set a value to a parameter named access_token using a JSONPath extractor querying for access_token. This will create a value extractor that will execute a against the JSON response of the request and extract the authentication token into a parameter named access_token.

  • Verify that a value was set to the parameter access_token by the JSONPath extractor by expanding the ‘Verify Response’ card of the request and creating an assertion. Add an assertion that states that the access_token parameter Is True (Use the "Exists" assertion type).

  • Click DRY RUN and execute a trial run to make sure it is working.

  • Now that we have the authentication token stored in access_token we can use it to publish on our blog

    • Create a new request by clicking the "+ ADD REQUEST" button below the first request.

    • Set its description to Publish Blog Post

      Set it as a POST request to https://loadmill-test-blog.herokuapp.com/ghost/api/v0.1/posts/

    • Click on the "ADVANCED" button and set the Content-Type to application/json and the body to this JSON-

    {
       "posts": [
          {
             "title": "Title ${__random_chars}",
             "slug": "${__random_chars}",
             "markdown": "Text ${__random_chars}",
             "status": "published"
          }
       ]
    }
    • Now, let's use the access_token parameter value we extracted from the login response to authenticate this request. Expand the header card of publish request and add a header with the name Authorization and the value Bearer ${access_token}

    • Run a trial of the whole scenario and go to https://loadmill-test-blog.herokuapp.com/ to see that our blog posts are getting published.

Now that we know that our full scenario is working we can run it as a load test. Click the "RUN TEST" button at the bottom of the test and run the test 🎉

This JSON body defines the blog post that we are going to publish. Notice that we have used one of to make it a little more interesting - ${__random_chars}. The __random_chars parameter will change to 10 random characters during test/trial execution.

Loadmill's functions
first simple test
JSONPath query