LF BLOG // Changes to tests using random

If you use random features in your tests you may notice a new limitation when saving tests, which is that your requests must all be named. This is a minor change and easy to correct as you can see in our full guide.

In summary if you import random you must change from non-named get/post requests to named ones as shown below:

# old
self.client.get("/api/user/" + random.randint(0,100000))

# new
self.client.get("/api/user/" + random.randint(0,100000), name="User API")

The reason for this is that the reporting system would store the old one as 100,000 unique urls, which causes a huge amount of data to be stored. It's also worse for you as you cannot see the real average or median results for it. With the new method they will all be named User API instead.

This will not effect many users, but just a heads up in case you see it. You can completely override the limit if you know what you are doing by adding this comment anywhere in your test:


Ready to run that test?
Start your first test within minutes.