YAML format

An as-code project describes its test elements in YAML: SLA profiles, variables, servers, virtual user paths, populations, and scenarios. Each file must use the .yaml or .yml extension.

For the full syntax, including every element and the properties it accepts, check out the YAML syntax documentation (opens in new tab).

Example

The following project defines an SLA profile with four thresholds, a CSV file variable, a server, a virtual user path with two requests, and a scenario that runs 500 virtual users at a constant load:

Copy
name: MyProject
sla_profiles:
- name: MySlaProfile
  thresholds:
  - avg-request-resp-time warn >= 200ms fail >= 500ms per test
  - perc-transaction-resp-time (p90) warn >= 1s fail >= 2s per test
  - error-rate warn >= 2% fail >= 5% per test
  - error-rate warn >= 5% per interval
variables:
- file:
   name: products
   path: data/list_of_products.csv
   is_first_line_column_names: true
servers:
- name: mypc
  host: mypc.intranet.company.com
user_paths:
- name: MyUserPath
  actions:
   sla_profile: MySlaProfile
   steps:
   - request:
      url: http://www.company.com/select?name=${products.col_0}
   - think_time: 1s
   - request:
      server: mypc
      url: /valide
populations:
- name: MyPopulation
  user_paths:
  - name: MyUserPath
    distribution: 100%
scenarios:
- name: MyScenario
  populations:
  - name: MyPopulation
    constant_load:
     users: 500