简体   繁体   中英

Load testing using Jmeter

I have the following scenario:

  1. Users are authenticated through JWT in a Laravel API.
  2. On successful login, the users can navigate to a survey form, where they can answer to a set of questions (multi-selects, selects, radio buttons etc).
  3. A logged in admin can view the answers of the user in real-time ( Web-sockets are used here), being plotted in charts. For example let's say a question is "What's your gender?", a pie chart is shown with 10% male and 90% female.

I'd like to simulate 100 users answering some predefined questions and see the response being plotted in different charts in real-time. I thought of using Jmeter for load testing. But don't know the steps to login those 100 users and simulate answering the questions.

I want to test the response time and just visually see the answers being plotted in real-time.

  1. For authenticating via JWT you need to extract the token from the first response using JSON Extractor and make sure the JWT Token value is being added to the following requests via HTTP Header Manager . Check out Testing Microservices with JMeter article for more details if needed.
  2. I believe you can record all these survey steps using HTTP(S) Test Script Recorder and build the test flow out of the resulting HTTP Request samplers
  3. You can use ie JMeter WebSocket Samplers to simulate admin actions. Most probably you will not see "charts" themselves, however you will be able to observe raw data and use Assertions to check its integrity

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM