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

How to stop once a user finishes it's set of Tasks. #567

Closed
thekgt44 opened this issue Mar 27, 2017 · 5 comments
Closed

How to stop once a user finishes it's set of Tasks. #567

thekgt44 opened this issue Mar 27, 2017 · 5 comments

Comments

@thekgt44
Copy link

Hi, I am using locust for load testing of my app. I am using it with Selenium. The Flow of test is :

  1. User opens the web app, which takes him to login page.

  2. Web-driver finds elements for username, password, and Sign in button. Enters respective values, and when clicks sign in buttons.

  3. then navigates to a page, lets call it page X. (Page X is protected by login).

  4. When page X load, it triggers 5 queries in the back-end. I want to get the number-of-queries/Sec.

    Everything goes fine till step 3, but after opening, page X, it gives me 'NoSuchElmentException'. Reason: after finishing the task, Locust fires the task again for that particular user. Now browser is on page X, the test started again, so it searches username and password field on page X, which triggers, aforementioned exception. I thought to get around this problem by closing driver, but then I get no such window exception.
    So, I want to stop the test for that particular user, after he gets into page X.

@cgoldberg
Copy link
Member

try setting --num-request

but usually it's not very useful to just run one iteration

@aldenpeterson-wf
Copy link
Contributor

Won't this work: http://docs.locust.io/en/latest/writing-a-locustfile.html#the-on-start-function ?

or am I missing something as to what you are trying to do?

@thekgt44
Copy link
Author

Okay if anyone can help me with this:
I want to remove phantomjs as it is heavy, and I can't run multiple instances of it (more than 60-70). I tried with distributed locust but I am still not able to send more than 2-3 requests per second. I am planning to use HtmlUnitWithJS, but can't get it work with Locust. What I need to pass in LocustUser class? Thanks in advance

@cgoldberg
Copy link
Member

@thekgt please open a new issue rather than hijacking this one

@mjohnson767
Copy link

Did this every get resolved?
I'm building a script that will run as a synthetic monitoring script that will run once every 15 minutes. If it fails it'll kick off an alert via Grafana. How can I set the script to run just once? I tried the --num-request and it doesn't seem to be part of locust.

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

4 participants