So I have a scenario where a couple of users go to the specified website, login, then give some text input (literally enter some text).
Now, the problem is that the script initially recorded my input and now every user in the thread group simply repeats my actions and everybody enters the same input (mine).
What I need to achieve is that every user enters his own unique input. How can I achieve that?
You need to parameterize the input variable.
Use "CSV DATA SET CONFIG" to provide the input.
https://guide.blazemeter.com/hc/en-us/articles/206733689-Using-CSV-DATA-SET-CONFIG
Hope this helps.
Related
I am new to jmeter, so please bare with me if I have asked a silly question. I have a thread where I want to run that thread like 100 times. In the thread I have scripts like
Add a member to a mailbox,
Get the mailbox details and confirm the member added was displayed
update the member role in that mailbox
Delete the member from that mailbox
I am using same mailbox and user for my test for my loop. Here the issue is the same member cannot be added to the same mailbox unless we delete that member from that mailbox.
So when I run the test with just 5 iterations, the add script for first iteration was passed and next 4 iterations for that add script getting failed. Because the first thread already added the user to that mailbox and while the second user tries to add the same user it fails, that's expected.
Steps I tried:
I even tried using constant timer in my add script to wait for 4secs so my previous user actions should be done. That's my understanding. Please correct me if that's wrong.
The other thing I tried was ramp-up time to 8 secs and then the script for 5 users ran fine. But when I increase the users to 50 then almost 50% of the scripts failed.
Here comes my problem. How do I make the second user to wait until the first user done with the delete script, so second user can use the same data and so on.
Attached are some screens of my scripts
Please let me know if you need any other information.
Thanks
Each JMeter thread (virtual user) should represent a real user with its own credentials and mailbox. Credentials and/or mailbox can be parameterized, normally people use CSV Data Set Config to provide test data for JMeter scripts
If you have only one user/mailbox - you won't be able to use more than 1 thread (virtual user) in the Thread Group, to wit if you need to run the scenario 100 times - you need to set it up like:
Another option is using Critical Section Controller. But be aware that there will be no concurrency (only 1 user will be running the test at a time), if you need to have more - you will need to use different credentials for different users
Currently, I am recording a script in jmeter by which I am adding a record in a website , but a problem is that while recording a script I am able to add a record in a website, but once recording has been done and after that if I will run a script again then, a script is not adding a record in a website.
can you please help me with this?
In the absolute majority of cases you will not be able to replay the recorded script without performing correlation.
Modern web applications widely use dynamic parameters for session management or CSRF protection so once you record your test you get "hardcoded" values and they need to be dynamic.
Assuming all above my expectation is that your test doesn't add record due to failed login or something like that. Inspect requests and responses using View Results Tree listener - this will allow you to identify which exact step is failing.
The process of implementing the correlation looks as follows:
Identify the element which looks to be dynamic either manually inspecting request parameters and look for "suspicious" patterns or record your test one more time and compare the recorded scripts looking for the parameters which differ
Inspect previous response and extract the dynamic value using a suitable post-processor. For HTML response times the best option is CSS Selector Extractor. It will allow you to extract the dynamic parameter value and store in into a JMeter Variable
Replace hardcoded recorded value with the variable from the step 2
Repeat for all dynamic parameters
Don't forget to add HTTP Cookie Manager to your Test Plan.
The sceanrio is: change user password(User will change password to new password).
I have to run a fixed number of users for 1hr duration.
Input I have is: A fixed number of userids set to the same password.
The data file (username,password,newpassword) in case of 3 users ( users can vary Up to 200) is like:
u1,p1,newp1
u2,p1,newp1
u3,p1,newp1
u1,newp1,newp2
u2,newp1,newp2
u3,newp1,newp2
u1,newp2,newp3
u2,newp2,newp3
u3,newp2,newp3....
The mode used for csv data config is shared across " all threads".
So basically all users will start with password p1 and change it to newp1 in the first iteration. Then for next iteration the current password will be newp1 and it will changed to newp1.
Initially I will use a 5-10 minute ramp up.
The doubt is: This is working in case of few users. But is it sure that all the users will pick the data from csv in the correct order for a prolonged duration?
For example if some of the users finish the iteration earlier will they pick the userids already in process by other ids?
Any miss match will affect the execution since assumption is the users will pick the correct current and new passwords. Also one failure will fail all reamaining iterations.
Please check this approach is correct and suggest modifications if needed. Also feel free to suggest if you have a better approach for the scenario.
I am new user to j-meter and try to record some script; I have done some recording with Firefox
Now i want to record script for Multiple log-in at one time how can i do that with "CSV Data Set Config" can any one guide me step by step
Thanks in advance
Refer to the link below:
http://ivetetecedor.com/how-to-use-a-csv-file-with-jmeter/
hope this will help.
Just add a CSV Data Set Config test element as a child of the request which performs login
Make sure that your parent Thread Group has enough virtual users and/or loops
And you're following steps from Using CSV DATA SET CONFIG guide.y
I need to Load Test a page that requires login. I have recorded a login action already. VS 2013 Ultimate has two options for Load test:
Under Scenario Wizard -> "Constant Load -> User Count: 25 users".
User CSV file with usernames and passwords.
The "Constant Load" option seems to work good as it will ramp up users, but will it perform the logins and with unique session id?
The two options can be chosen independently, you do not have to choose one or the other.
A constant load will not "ramp up users", the test will start with (in your case) 25 users and maintain that number. If you want to "ramp up users" then use the step load pattern.
Independently of the load setting you can data drive the Web Performance Test with a CSV file. There are three methods of reading data from the file. First "Sequential" means data is read in order from the file, after the last line of the file is read then reading starts again at teh top of the file. Next "Unique" also means read in order from the file, but in this case after the last line of the file is read then the test reading that data will stop. Third "random" reads lines in random order.