0

The requests containing "/#/" are all seen as "/". Then I'll get a ton of "fails".

from locust import HttpLocust, TaskSet, task
class UserBehavior(TaskSet):

@task(2)
def login_page(self):
    self.client.get("/")

@task(1)
def dashboard_page(self):
    self.client.get("/#/bubblesu")

@task(1)
def parents_page(self):
    self.client.get("/#/pages/parents")

class WebsiteUser(HttpLocust):
    task_set = UserBehavior

This is the result enter image description here

There's no cmd errors in the prompt.

Then I tried to convince locust to name (and use) the proper ones. However naming worked, but it looks like the request are still made against "/". So in result I'm not able to load test each request.

My developer says "The hash sign is there because it's a single page application the path after that is just for routing via javascript. if you remove it the browser would try and find the page"

Here's the script

from locust import HttpLocust, TaskSet, task

class UserBehavior(TaskSet):

    @task(2)
    def login_page(self):
        self.client.get("/")

    @task(1)
    def dashboard_page(self):
        self.client.get("/#/bubblesu", name='dashboard')

    @task(1)
    def parents_page(self):
        self.client.get("/#/pages/parents", name='parents')

class WebsiteUser(HttpLocust):
    task_set = UserBehavior

Executing with this from cmd.

locust -f locustfile2.py --host=https://www.bubblesu.com

This is the URL to the login page.

https://bubblesu.com/#/bubblesu

This is what Locust shows. enter image description here

cmd has no errors displayed.

Using Windows 10, Pycharm

Paul Laguna
  • 65
  • 13

1 Answers1

2

"#" is a fragment identifier, so everything after it is stripped from the URI when sending an HTTP request.

Corey Goldberg
  • 59,062
  • 28
  • 129
  • 143