Skip to Content

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 .

Fundamentals

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

Browser performance testing (Playwright)

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

HTTP performance testing

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

Other protocols

NameDescription
Socket.io Load test a Socket.io server with Artillery’s Socket.io engine.
Socket.io with HTTP Mix HTTP and Socket.io requests in your load test with Artillery’s Socket.io engine.
WebSocket Load test a WebSocket server with Artillery’s WebSocket engine.
SOAP Load test a SOAP server by leveraging Artillery’s custom functions.

Extensibility and Integrations

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

CI/CD

NameDescription
Run load tests in parallel on GitHub Actions Run multiple tests in parallel with a matrix strateg on GitHub Actions.
Last updated on