Skip to content
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

Locust web interface not starting on Windows #436

Closed
Anup-Deo21 opened this issue Jun 22, 2016 · 4 comments
Closed

Locust web interface not starting on Windows #436

Anup-Deo21 opened this issue Jun 22, 2016 · 4 comments

Comments

@Anup-Deo21
Copy link

Anup-Deo21 commented Jun 22, 2016

i am running locust on windows 8.

E:\Downloads\Python\Python programs>locust -f test3.py
[2016-06-22 12:06:08,187] Anup_Deo/INFO/locust.main: Starting web monitor at *:8089
[2016-06-22 12:06:08,187] Anup_Deo/INFO/locust.main: Starting Locust 0.7.5

...And then it never proceeds further. below is my python code for test3.py file

# test3.py

from locust import HttpLocust, TaskSet, task

class UserBehavior(TaskSet):
    def on_start(self):
        # Set any required HTTP Headers
        self.client.headers['Accept-Language'] = "en-US,en;q=0.8"

        # on_start is called when a Locust start before any task is scheduled 
        self.login()

        # POST some form data
    def login(self):
        self.client.post("/consumer-portal/", 
        {"username":"[email protected]", "password":"Cheenu6622##","kaptcha":"aaaaaa","termsAndConditionsAccepted1":"true"})

    # Run this task with weighting 2 (twice as much as the one below)
    @task(2)
    def index(self):    
        # GET the home page
        self.client.get("/consumer-portal/")

    @task(1)
    def history(self):
        # GET the Consumer history page
        self.client.get("/consumer-portal/consumer-history/")

class WebsiteUser(HttpLocust):
    # What task class are we running?  (the one above!)
    task_set = UserBehavior

    # What's the minimum wait time between requests?
    min_wait=5000

    #And the maximum
    max_wait=9000

    # What is our base host for testing (prepended to GETs/POSTs above)?
    host="http://192.168.2.25:7077"
@heyman
Copy link
Member

heyman commented Jun 23, 2016

Did you try to access http://127.0.0.1:8089?

If so, maybe it could be the Windows firewall that is blocking python from listening on ports?

What happens if you run python -m SimpleHTTPServer 8089? Can you access http://127.0.0.1:8089 then?

@Anup-Deo21
Copy link
Author

thanks heyman.... after accessing http://127.0.0.1:8089 it is showing Locust web interface as
test3

but while executing it is showing following error:
SSLError(SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)'),),)

I tried to disable HTTP verification by adding following line in my code

import ssl
try:
_create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
# Legacy Python that doesn't verify HTTPS certificates by default
pass
else:
# Handle target environment that doesn't support HTTPS verification
ssl._create_default_https_context = _create_unverified_https_context

but the error is still existing..

@Anup-Deo21
Copy link
Author

pfa screen shot of the error...
test3_1

@sykezz
Copy link

sykezz commented Mar 5, 2020

Running locust with --web-host localhost solved the issue for me. Quite weird.

Related: #57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants