首页 > 解决方案 > 如何为蝗虫中的用户共享所有请求的cookie?

问题描述

我想_profiler为用户的所有请求共享 cookie,无论如何要在 locust 中执行此操作?

 self.client.post(
    "/customer/account/loginPost/bind/no/",
    headers = headers, 
    data = {
        'login[username]': email, 
        'login[password]': password, 
        'form_key': form_key
    },
    cookies={
        '_profiler': True
    }
)

//Another request in another task, I hope the `_profiler` cookies exists here.
self.client.get('/customer/section/load?sections=cart&force_new_section_timestamp=false',headers=headers)

标签: locust

解决方案



推荐阅读