0

I have the following taurus yaml scenario with 40 iterations and 40 json files. I am passing those 40 body json files in the body-file tag. but when i run the yaml i can see only one request running and not all 40. Please help in this regards.

execution:
- concurrency: 1
  iterations: 40
  hold-for: 0s
  ramp-up: 0s
  scenario: queryData
  delay: 0s

queryData:
    #data-sources:
    #- /bzt/bzt_artifacts/query.csv
      #delimiter: ","
    requests:
    - include-scenario: authCToken
    - label: queryData
      method: POST
      url: ${TARGET_URL}
      headers:
        X-TR-Correlation-Id: ""
        Authorization: "${authc_token}"
        Content-Type: application/json
        Accept: application/json
      #DNT: 1
      body-file: /bzt/bzt_artifacts/test1.json, test2.json etc., test100.json
E. Zeytinci
  • 2,642
  • 1
  • 20
  • 37

1 Answers1

0

Create a file my-sources.csv for data sources:

test1
test2
...
test100

Create a config my-plan.yml:

execution:
  - concurrency: 1
    iterations: 40
    scenario: example1
    # other-settings: blah blah blah

scenarios:
  example1:
    requests:
      - url: http://your-domain:8080/api/id/${test_id}
        method: POST
        body-file: data/${test_id}.json
    data-sources:
      - path: my-sources.csv
        delimiter: ","
        quoted: false
        encoding: "utf-8"
        loop: true
        variable-names: test_id
        random-order: false

The structure of the current directory would look like:

.
├── my-sources.csv
├── my-plan.yml
└── data
    ├── test1.json
    ├── test2.json
    .
    .
    .
    └── test100.json

Then you can run this config via Docker:

$ docker run -it --rm -v `pwd`:/bzt-configs blazemeter/taurus my-plan.yml

References

chehsunliu
  • 1,559
  • 1
  • 12
  • 22