
> pip install locustio
Some feature / deficiency of Locust:
- You can write your test case in Python
- You can define the user time consumption on a page with min_wait and max_wait as milliseconds in locust class so that get a real user simulation.
- You can give weight for each test cases so you can simulate real user behaviours like during a specific period of time: 1 person signs up, 10 persons login, 60 persons visit pages, ...
- You can make http request as you do in your code such as get, post, put, delete, head, patch and options. So you can send request directly to your api, like: self.client.post("/login", {"username":"testuser", "password":"secret"})
- While Jmeter is thread based so it uses a separate thread to create a user but Locust id co-routine and work asynchronously as you see after running the number of user for each case. This means that you can create more user in Locust than in Jmeter.
- With the PyQuery library, you can query throughout your interface. For example you can find all the links in html and then send requests to respondent pages.
- There is some problem with single page application like if there is "#" in your url it behaves as there is no url.
- There is no graphic option but you can hack everything.
You can check the script below which is written for www.myhabit.com to run performance testing for the link on "/my-account" page. With the script, we are loging on the page and then we can open the my account page. The result may not be different when you want to test because it depends on many factors.