Get Started
Examples

Artillery Examples

Artillery comes with a lot of examples of common scenarios to help you get started. If you'd like to see an example that's not covered here, please open a discussion (opens in a new tab).

Fundamentals

NameDescription
Automated checks (opens in a new tab)Make your tests actionable by using the apdex, ensure and expect plugins.
Reuse load tests as functional tests (opens in a new tab)Reuse performance tests as functional tests by using the expect plugin.
Scenario weights (opens in a new tab)Use scenario weights to recreate real-world patterns by controlling the distribution of VUs across different scenarios.
Test data using CSV (opens in a new tab)Use test data from CSV files in load tests.
Test data using Redis (opens in a new tab)Make test data uniquely available to each VU in distributed load tests by using Redis.
Table-driven functional tests (opens in a new tab)Reduce duplication in functional tests by using a table-driven approach.
Organize multiple scenarios (opens in a new tab)Organize scenarios into multiple files with a shared config for better maintainability
Dynamic values in scripts (opens in a new tab)Use dynamic values in test scripts with environment variables.

Browser performance testing (Playwright)

NameDescription
Playwright smoke test (opens in a new tab)Run a simple smoke test of your website using Artillery and Playwright.
Track timings of steps (opens in a new tab)Automatically track performance timings for the various steps in your tests.
Reuse TypeScript E2E tests (opens in a new tab)Reuse a pure Playwright codebase written in TypeScript as Artillery tests.
Reuse authentication (opens in a new tab)Log in once and reuse authentication in Artillery Playwright tests with sessionStorage.

HTTP performance testing

NameDescription
Generating API tokens (opens in a new tab)Generate unique API tokens for each VU or reuse a shared token for all VUs.
Refresh auth token (opens in a new tab)Automatically refresh short-lived authentication tokens during load tests.
Set custom header (opens in a new tab)Set a custom header in HTTP requests.
Cookies (opens in a new tab)Use cookies in HTTP requests.
GraphQL (opens in a new tab)Load test a GraphQL API server.

Other protocols

NameDescription
Socket.io (opens in a new tab)Load test a Socket.io server with Artillery's Socket.io engine.
Socket.io with HTTP (opens in a new tab)Mix HTTP and Socket.io requests in your load test with Artillery's Socket.io engine.
WebSocket (opens in a new tab)Load test a WebSocket server with Artillery's WebSocket engine.
SOAP (opens in a new tab)Load test a SOAP server by leveraging Artillery's custom functions.

Extensibility and Integrations

NameDescription
Track custom metrics (opens in a new tab)Create custom metrics to track domain-specific parts of your system.
Custom engine (opens in a new tab)Create a custom engine for more advanced or domain-specific requirements.
Custom plugin (opens in a new tab)Create a custom plugin for your specific use case.
Tracetest (opens in a new tab)Use the tracetest plugin to assert on your system's distributed traces using Tracetest (opens in a new tab).