Skip to content
This repository was archived by the owner on Dec 5, 2023. It is now read-only.

How to simulate GET /login method with locust? #23

@zecoo

Description

@zecoo
  • Describe the expected behaviour and the actual behaviour
self.client.get("/login", headers={"Authorization":"Basic %s" % base64string})

The codes of locustfile.py which simulates the login method to sock-shop seems not work with locust return:

GET /login: "HTTPError('401 Client Error: Unauthorized for url: http://example-sock-shop/login')"  

And I checked the client.js file of sock-shop, the corresponding part of login codes is:

beforeSend: function (xhr) {
            xhr.setRequestHeader("Authorization", "Basic " + btoa(username + ":" + password));
        }

which means the operation of locust is correct, but why does it not work?

Besides, I have already change the "username: password" str to base64 bytes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions