For bombarding the server with multiple request with random data in parameters, how can I do it?
the message block in artillery script is as below,
"message":
{
"order1": "jngfj2434",
"size": "4433",
}
I need to send order1 with randomstring and size in the range of 1 to 10,000 randomly.
Sometimes it's necessary to generate a random string, number, or UUID/GUID in your load test script. To do this, you can call any of these functions: randomalpha(len) - Generates a random alphabetic string of the specified length (consisting of all ASCII letters).
You can set your headers in default parameter inside config like this: config: target: "http://localhost:3000" phases: - duration: 10 arrivalRate: 100 defaults: headers: authorization: token ...
Four kinds of phases are supported: A phase with a duration and a constant arrival rate of a number of new VUs per second. A linear ramp-up phase where the number of new arrivals increases linearly over time. A phase that generates a fixed count of new arrivals over a period of time.
Below code is working for me.
"message":
{
"order1": "{{ $randomString() }}",
"size": "{{$randomNumber(1,10000)}}",
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With