I have a JMeter test that uses a CSV Data Set Config to provide a list of products for each simulated user to purchase.
The test is simple:
login
pick product to add to cart
checkout
logout.
This has worked well and now I want to simulate a user purchasing N products. I first tried duplicating the controllers that pick a product and also tried putting those in a loop controller, but in both cases they just add the same product to the cart repeatedly.
What I want is for each user to pick multiple items from the CSV file. I tried modifying settings for the CSV Data Set Config, but I get the same results no matter what I set it to. Am I missing something or is this expected behavior?
How do I get a thread to pick different items from the CSV file?
Is my only choice to provide multiple CSV files and use multiple CSV Data Set Configs?
Your option is to use __StringFromFile function inside a Loop Controller
You could then use some Beanshell to process the line and split items.
Related
I want to load test following scenario.
1.Submit student details in basic data insert page.
Result : Added record just bind into table grid in same page.
2.Click on edit button of particular added record in table.
3.Change student name and click on save again.
My key load test scenario is record edit scenario. I used CSV data config for test parameters. I want to know is it possible to select different table cells with different thread requests in same sampler to test my scenario in same tread group.
Please refer the attachment for sample screen.enter image description here
CSV Data Set Config element has Sharing Mode setting, by default it is All Threads.
This means that CSV file is shared across all JMeter threads and each Thread (virtual user) takes the next line each iteration so default configuration should be fine for your use case, just add more threads and/or loops in Thread Group or Loop Controller and JMeter will pick up the next line for each thread/iteration.
See CSV Data Set Config in Sharing Mode - Made Easy article for more information.
My scenario is multiple users should login and after login each user should select the each record separately in application.
Define two Thread groups in your test plan. Under these two thread groups use different (Two) CSV files.
For Further Details, see CSV Data Set Config
I am trying to login with different users each time, So I have created CSV data set config but my code is picking only the first user always from CSV file, So I used ForEach loop controller to pick different user from second time.
For every login it should pick the users sequentially from the CSV file
Replace ForEach Controller with Loop Controller and everything should start working as expected (alternative option is remove ForEach Controller and set Loops on Thread Group level)
ForEach controller is designed to iterate through JMeter Variables, it isn't applicable for CSV files.
See Using CSV DATA SET CONFIG for reference configuration.
I use paging in Codeigniter, and I would like to display by default 15 records per page. However, I would like to give the user option to choose how many records per page he would like to see, selecting from the dropdown 30, 50, 100 or all records.
Since I will have this code on more than one place, I would like to avoid repeating same code trough my controllers. Anyone know which is right way how to implement this option according to MVC philosophy? Should this code be placed in some config file?
Either a library, or a helper, would be the best place to have code that is re-used in multiple places
If you want to store the users preference, so your application remembers it, then either store it in the session, or the database.
I am trying to do Multiple Biddings on Multiple Items for different suppliers in Jmeter... Can any one help me...
If I understand correctly, you have an auction site and want to place multiple bids on multiple items for different suppliers.
Start by recording ONE bid on ONE item for ONE supplier. There are lots of tutorials for helping with recording.
After you've recorded this scenario, you want to add parametrization to the script. I would recommend by starting with multiple items for a single supplier. There are lots of ways you can do this. You can give Jmeter a CSV data file to read, or scrape the page. Personally, I would do the following:
- Load Page that shows all items for a specific supplier
-- Do a regular expression extractor to get ALL items on the page
- FOR EACH item (loop)
-- Bid on item
Then I would make the supplier dynamic. Again, you can give Jmeter a CSV data file, or scrape the page. I would do this:
- Load page that shows all suppliers
-- Do a regular expression extractor to get ALL suppliers
- FOR EACH supplier (loop)
-- Load Page that shows all items for the supplier
--- Do a regular expression extractor to get ALL items on the page
-- FOR EACH item (loop)
--- Bid on item
For the multiple bid part, it would depend on how many bids you want, and which users make the bid. Is it the same user making the bids? Or do different users need to make the bids?
If it's the same user, you could add a loop to "Bid on the item" and od it as many times as needed.
If it's different users, create a data file with all the users you need, then loop through the entire scenario multiple times with different users.
The user manual has some examples and lots of use tips and tricks:
http://jmeter.apache.org/usermanual/intro.html
Could you elaborate some more? When you say "Multiple Biddings" I think you're referring to something domain-specific you want to do. Perhaps if you describe first what JMeter components you are using now, an HTTP Request? SOAP/XML request, the nature of the system in question, we could help you.