JMeter's IP spoofing technology (simulating concurrent requests from different IP addresses)

When we are doing stress testing, we have such a scenario and requirement that we hope to simulate batches of users from different IP addresses. If you use LR, it is easy to implement, and you can use IP spoofing. So for JMeter friends, can’t you enjoy this technology? The answer is no, JMeter can do the same. Let’s share the implementation and process of JMeter IP spoofing technology

Step 1: Bind the IP address on the load machine

Note: The load machine needs to be a fixed IP address

In the network connection of the load machine, find the connection you are using (wired or wireless), right-click, click Properties, and then configure the relevant information of the IP address. The specific process is as follows:

Note: The IP address of the load machine is filled here. The method of viewing the IP address of the load machine in the windows system:

(1) run cmd

(2) Input: ipconfig, you can see the IP address of the machine

 

Step 2: Click Advanced and add a fake IP address

The IP address added here needs to be verified whether it is occupied. If it is not occupied, it can be added here

Step 3: Copy the new IP address to the text

It is convenient to read the IP address of the text in subsequent requests, that is, to realize parameterization with a text file

Step 4: Create a new parameterized request

What is configured here is the text file path of our IP address.

Step 5: Create a new stress test script

 

  1. Reference the variables of our parameterized configuration to achieve parameterization

  1. Implementation selection: HttpClient3.1

Step 6: Configure the number of threads and other related configurations

 

Step Seven: Execute the Stress Script

Verification results, whether to meet our requirements for different IP address requests

 

From the above results, we can see that we have realized that requests come from different IP addresses, which means we realize our technical considerations for IP spoofing:

(1) The IP address we added must be unused, and this part needs manual verification, which is different from LR;

(2) The address we added needs to be copied to a text file and then parameterized;

(3) Parameterized variables need to be quoted in the stress test script, don't forget.

Finally, I would like to thank everyone who has read my article carefully. Reciprocity is always necessary. Although it is not a very valuable thing, you can take it away if you need it:

These materials should be the most comprehensive and complete preparation warehouse for [software testing] friends. This warehouse has also accompanied tens of thousands of test engineers through the most difficult journey, and I hope it can help you! Partners can click the small card below to receive  

 

Guess you like

Origin blog.csdn.net/hlsxjh/article/details/130308797