Search code examples
node.jstestingautomated-testsweb-testing

Web testing with multiple logins


I have a chat room written in node.js.

This chat room uses cookie on the client side to identify the user; which means that when I log in the chat room as user A with my Chrome browser, I cannot log in the chat room as user B with Chrome. Because the server would find out that user A and user B share the same cookie.

An example of this situation I mention above can be found at http://www.e-chat.co/

So my question is: How can I test the situation when maybe 1000 users log in my chat room at the same time? (I want to know the number of users my chat room can hold.)

I'm not able to log-in with multiple accounts simultaneously in a browser (unless I change the structure of my chat room, which isn't the thing I'm going to do).

I've found that the Chrome extension https://chrome.google.com/webstore/detail/multilogin/nccllfnllopfpcbjdgjdlfmomnfgnnbk allows me to log in my chat room with multiple accounts. But typing lots of user accounts manually is a tedious work. Is there a way to automize the process of entering a lot (for example, 1000) of accounts?


Solution

  • Quick and dirty solution...

    ...only to manually check whether your chat room accepts > 1 user:

    Use CTRL+SHIFT+N (or CMD+SHIFT+N on Mac) in order to open an incognito window in Chrome. This window will not share cookies with any other Chrome windows and will give you an opportunity to have as many opened Chrome windows as you need for manual testing.

    More advanced solution...

    ...which will allow you to check how many user your application can handle:

    Use JMeter in order to quickly create the test that will have so many simultaneous users you need (they all will have different cookies).

    Your project should look like this:

    - Test Plan
     - Thread Group
      - Cookie Manager
      - HTTP Request (performs login to your application)
    

    Briefly here "Thread Group" will define the number of users which will perform "HTTP Request" to the application in order to log in, and "Cookie Manager" will take care of cookies (each user will get a unique ones).

    In order to get more info about JMeter and test plan elements visit these pages: