-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URL requests containing “/#/” are all seen as “/” then failing when running on Locust.io #768
Comments
Another way of stating the problem. Let's assume you have the locustfile described above. Run this Flask mini-app to determine where the request really go (it just echoes URLs it receives):
Run the app:
And run locust against this app: It turns out, that Locust cuts the requested URL just after '#'. This way On the other hand, it may be some "pythonic requests/flask issue". If you do |
Looks the problem was noticed before: #187 On the other hand, it's worth considering if testing single page applications this way (described in the issue) is really a way to go... |
I think Locust (well, actually Requests library) is handling this properly. in the URL "http://foo/bar#baz", you have a network resource (URI) named "http://foo.bar/bar#" followed by a Fragment. hash sign ("#") is the Fragment Identifier. The actual URI is everything up to and including the hash sign. Everything after the hash is the optional Fragment, which is not sent in HTTP requests. From Wikipedia:
|
Thanks for the resourses @cgoldberg and @karol-brejna-i. Just for the heck of it I tried adding percent-encode and it didn't bite. Thanks for the quick responses. I'll close the issue. |
The requests containing "/#/" are all seen as "/". Then I'll get a ton of "fails".
This is the result
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
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.
cmd has no errors displayed.
Using Windows 10, Pycharm
The text was updated successfully, but these errors were encountered: