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

这一生的挚爱 提交于 2021-01-22 06:00:08

问题


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.


回答1:


Below code is working for me.

"message": 
            {

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


来源:https://stackoverflow.com/questions/48096569/how-to-create-random-string-or-number-in-artillery-load-testing-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!