Search code examples
websocketartillery

How to create random string or Number in artillery load testing script?


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.


Solution

  • Below code is working for me.

    "message": 
                {
    
                "order1": "{{ $randomString() }}",  
                "size": "{{$randomNumber(1,10000)}}",
                }