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
  • Usage
  • DB relay service static IPs
  • Docker image
  1. Integrations

Database Testing

PreviousTestRail integrationNextKafka Testing

Last updated 10 months ago

Loadmill allows users to execute various queries directly to their DB in order to validate data. This is a very powerful feature as it allows users to check data integrity and accuracy.

Usage

Postgres

To execute a database query:

  1. Go to the relevant test flow within your Test Suite.

  2. Request Method: POST.

  3. Request URL: https://db-relay-service.loadmill.com/api/postgres

  4. Content Type: application/json

  5. Request Body:

{
  "connectionString": "postgres://...",
  "query": "SELECT * FROM USERS"
}

See the request example below:

Running this request will return a JSON response with the required data.

MongoDB

To execute MongoDB queries:

  1. Apply the same steps above.

  2. Request URL: https://db-relay-service.loadmill.com/api/mongo

  3. Request Body:

In this example we're searching for a user with the name "John"

{
  connectionString: 'mongodb://...',
  collection: 'users',
  command: 'find',
  query: { "name":"John" }
}

The MongoDB service is initially meant for "read-only" purposes (i.e. find). However, using a Docker image privately allows you to use the environment variable ALLOW_ALTERING=true and by doing so the following options are available: insertOne, insertMany, updateOne, updateMany, deleteOne and deleteMany.

MongoDB Altering Example Options

InsertOne:

{
  connectionString: 'mongodb://...',
  collection: 'users',
  command: 'insertOne',
  query: { "name": "John", "age": "56" }
}

updateOne:

{
  connectionString: 'mongodb://...',
  collection: 'users',
  command: 'updateOne',
  query: { "name":"John" },
  update: { "$set": { "age": "67" } }
}

deleteOne:

{
  connectionString: 'mongodb://...',
  collection: 'users',
  command: 'deleteOne',
  query: { "name":"John" }
}

Additional help regarding update operators can be found here.

Redis

To execute Redis queries:

  1. Request Method: POST.

  2. Request URL: https://db-relay-service.loadmill.com/api/redis

  3. Request Body:

{
    connectionString: "redis://...", 
    command:"get | hget | hgetall",
    key:"any-key",
    field: "any-field"
   }

MySQL

To execute queries directly to MySQL 5.7:

  1. Request Method: POST.

  2. Request URL: https://db-relay-service.loadmill.com/api/mysql

  3. Request Body:

{  
  "connectionString": "mysql://...",
  "query": "SELECT * FROM TASKS"
}

Oracle

  1. Request Method: POST.

  2. Request URL: https://db-relay-service.loadmill.com/api/oracle

  3. Request Body:

https://<www.your-domain.com>/api/oracle

body: {
  connectionString: 'host[:port][/service_name]'
  user: 'database-user'
  password: 'mypw'
  query: 'SELECT * FROM table_name'
}

DB relay service static IPs

Executing queries to your environment DB may require VPN. You can easily overcome this by whitelisting the DB relay service static IPs: [52.42.51.230, 54.190.108.53] in your firewall.

Docker image

You can use a Docker image for DB relay service to deploy it in a specific environment.

Find more information here.