I\'m currently passing custom parameters to my load test using environment variables. For example, my test class looks like this:
from locust import HttpLocust,
You could use like env <parameter>=<value> locust <options>
and use <parameter>
inside the locust script to use its value
E.g.,
env IP_ADDRESS=100.0.1.1 locust -f locust-file.py --no-web --clients=5 --hatch-rate=1 --num-request=500
and use IP_ADDRESS inside the locust script to access its value which is 100.0.1.1 in this case.
It is not recommended to run locust in command line if you want to test in high concurrency. As in --no-web
mode, you can only use one CPU core, so that you can not make full use of your test machine.
Back to your question, there is not another way to pass custom parameters to locust
in command line.