Skip to content Skip to sidebar Skip to footer

How To Configure Or Set Cookie As Json Before Making A Post Request In Locust Load Test Tool For Fasthttpuser

Locust is having option to use HTTPUser and FastHTTPUser HTTPUSer internally using python requests which accepts cookies as an argument with json content e.g. self.client.get(url,

Solution 1:

I don't see why you have received downvotes for your question. I found it valid and I think you should create an issue in the locust github page: https://github.com/locustio/locust/issues/

I think you could solve it like this:

from requests.cookies import cookiejar_from_dict

@taskdeftask_cookie(self):
    cookiejar_from_dict(mycookies, self.client.cookiejar)
    self.client.get(url, header=myheader) 

I will try to make a PR to make this automatic

Post a Comment for "How To Configure Or Set Cookie As Json Before Making A Post Request In Locust Load Test Tool For Fasthttpuser"