问题
I want to perform performance testing using JMeter, I have the following scenario which i want to record and run 5 min 300 users(Login) -> 20 min 150 users(assessment save) -> 5 min 40 users (Submit assessment) when users login simultaneously 20 min 50 users (Browsing). Please refer screenshot for reference. I want to create a script on the basis of the scenario.
回答1:
- Record all your use cases separately using JMeter's HTTP(S) Test Script Recorder. After recording make sure to correlate any dynamic parameters and validate your test by running it with 1-2 users/loops and looking into View Results Tree listener to inspect request and response details.
- When it comes to distributing virtual users to perform different workload tasks normally different real user groups should be represented by different Thread Groups. Other options are in using Throughput Controller, Switch Controller or Weighted Switch Controller, the choice depends on your requirements and user use cases implementation. See Running JMeter Samplers with Defined Percentage Probability guide for comprehensive information on using above test elements for custom workload distribution.
来源:https://stackoverflow.com/questions/48729112/how-to-create-a-script-using-jmeter-for-scenario-based