Debugging
Oftentimes you will encounter errors or not get the appropriate load you expect when running tests.
Things you can use to get more information:
Add print statements to your Locust code or the installed
appian-locustlibraryInspect the output of the latencies that Locust periodically prints out, to see if certain requests are much slower than you expect
Verify using the browser console that the requests you are attempting to simulate match up with what Locust/appian-locust is sending
Setting the “record_mode” attribute to True on your HttpUser’s or AppianTaskSequence’s
clientobject will create a “recorded_responses” folder which will contain all requests and responses sent during test execution. You can also set the “record_mode” attribute to True on an AppianTaskSet’sappian.interactorobject. You can do this in the__init__method of your HttpUser, like so:
class DoSomeThing(AppianTaskSequence):
def __init__(self, environment) -> None:
super().__init__(environment)
self.client.record_mode = True
@task
def do_something(self):
#create request here
Use
run_single_userfrom locust to debug using IDE breakpoints. Please refer https://docs.locust.io/en/stable/running-in-debugger.html for more details on run_single_user.
from locust import run_single_user
run_single_user(<UserActor>)