Jmeter multi-user execution - performance

I have a JMeter execution scenario. Here it goes:
Login with 1 credential.
Perform an operation.
Logout.
Now, issues:
I need to login using 1 credential and play the operation part with multiple concurrent users, even though I have just 1 login credential. How do I execute such a scenario ?
Please explain the whole procedure in detail as following an instructional overview sometimes leads to blockage in moving further.
Thanks!

Go through the following guide to setup the rest of the test
https://www.blazemeter.com/blog/getting-started-jmeter-basic-tutorial/
You need to use once only controller for login action. Ideally you want to use different users to avoid race conditions caused by using the same user.

If your system allows multiple logins with the same credentials it should not be a problem, just add as many users as you need in the Thread Group and each of the virtual users will execute these 3 requests upside down.
You can add __threadNum() function as the request label prefix or postfix in order to be able to distinguish virtual users and ${__jm__Thread Group__idx} pre-defined variable to track Thread Group loops/iterations.

Related

Jmeter multiple same Requests

I could somehow run JMeter test for a user but running HTTP requests a few time such like (multiple users). The problem is that authentication only supports one session and I don't think it's ok to create 50 users in LDAP to be able to test. I tried to use 'Parallel Controller' but after executing the first request the others have the status 'Socket closed'.
I don't think it's ok to create 50 users in LDAP to be able to test
I think this is what you should be really doing.
Parallel Controller is a kind of workaround to bypass JMeter Threads Model limitation when it comes to implementing specific test scenarios like simulating AJAX requests because it assumes several requests executing in parallel triggered by a single thread (virtual user)
In the majority of cases user does sequential actions like open login page -> login -> navigate somewhere -> type something -> etc.
Ideally each JMeter thread (virtual user) must represent a real user with unique credentials so I would strongly recommend either creating as many users as you need to simulate in LDAP, if you're not allowed to have test users in LDAP on permanent basis you can even create them from JMeter like:
setUp Thread Group - create users
normal Thread Group with your main test actions
tearDown Thread Group - delete users
See How to Load Test LDAP with Apache JMeter article to learn more about different types of LDAP requests you can send from JMeter

How to configure Concurrent testing in Jmeter ?

I need to perform the task to include the following scenerio :
2 different admin edit the same customer profile concurrently
What shall i be doing to configure this concurrent testing .
I have made Login thread Group where i used CSV config element to have different login at same time . But i have kept header manager which extract the authentication token from the last login only and edit customer profile is done through the last logged in admin . How can i make 2 different users to edit the customer profile at the same time i.e concurrently ?
As per JMeter Documentation
Variables are local to a thread
So if you have 2 threads (virtual users) each of them will have its own authentication token (given you really have 2 admin accounts and use different credentials)
Also be aware that the only way to ensure concurrency in order to have requests occur at exactly the same moment is using Synchronizing Timer. If you don't use the timer - JMeter will be trying to send requests by each thread as fast as it can, it may lead to concurrent requests but you don't have any guarantee, especially when it comes to 2 users only.

Jmeter workflow for Login with access token with multiple threads

I have a django application to be tested using Jmeter. Here is the Workflow
Admin user logs in , gets back access_token
Creates a user, using access_token ,unique mobile and email
Created User resets its password using OTP and a new password
Created user logs into the application.
I am using Reg Ex. extractor for accessing access_token and OTP
I am able to perform this with 5 threads, but as I increase the threads, it fails. Let me know what am I missing. Below is the screen shot Of My Jmeter.
It is not clear what exactly fails. Whole JMeter test? Some specific sampler? Your application? How many users do you add, is it 6 or 600? You need to be more specific and include at least essential failure details.
In the meantime I would suggest the following troubleshooting options:
Add HTTP Cookie Manager to your Test Plan. Given you use > 1 user you need to maintain a separate session for each login.
You need to use a separate admin account for each thread. If you have only one admin account - create users in loop using Loop Controller as your test needs to be realistic.
Run your test in command-line non-GUI mode
Disable all the listeners during test run as they consume a lot of resources (especially View Results Tree one) therefore your test may simply fail due to lack of RAM, see Greedy Listeners - Memory Leeches of Performance Testing for detailed explanation.

How to create multiple threads in JMeter

I recently started learning jmeter. Please help me
How can i create a multiple thread groups which performs same actions but with different credentials.
Issue is - in the current application i am testing ,if 5 users hit the refresh btn at the same time its crashing the system.
so my Requirement is - Login with 2 different users and hit refresh button
I created 2 thread groups -for user A and user B but when i run the test plan its executing simultaneously.its checking multiple threads with same credentials of user A ,Which is not my requirement. What is the way to deal with it?
I would suggest the following:
Use single Thread Group, you don't need separate Thread Groups as they are designed to represent different groups of virtual users.
Make sure you use different credentials for users A and B. Normally people use CSV Data Set Config for keeping users credentials so JMeter threads (virtual users) could read CSV file and pick up login and password combinations from there
To ensure that users A and B (or whatever will be the number) "refresh" the page at exactly the same moment - use Synchronizing Timer

JMeter: run parameterized threads

I've written simple test plan in JMeter, plan consists of one thread group and one controller with "HTTP request" elemets. Plan performes login to website, session refresh and logout.
Is there a way to preform thread running, with different params (login/password) each time?
thanks.
There are lots of different ways to parametrize your test. If you have a lot of users you want to use, I would recommend using a CSV Data Set Config. If you only have a few you want to use, you can try User Defined Variables or User Parameters. Make sure you check out the documentation, as each one is used slightly differently.

Resources