5. Run Your Test with Low Number Of Threads
Before proceeding with performance testing, you should check the status of your load test scripts. To do that, you can make some debug runs with a low number of threads. After receiving approval from the system owners, you can run the test with thread numbers like 20, 50, 100 and so on. This way, you can make sure that you will keep receiving successful responses for multiple requests at the same time.
6. Redirections Should Be Automated
If you ever see response codes like 301 or 302 during load testing, you should know that they indicate some kind of redirection. Some requests cause us to be redirected to a different element, suggesting that the information we seek is accessible elsewhere. In JMeter, you don’t need to create a special HTTP Request for these requests. Because we can utilize the Follow Redirects option in the HTTP Request order (parent request) to execute this process for us.
7. Don’t Forget to Create Assertions For Your Requests
You should create assertions to ensure that the response you have is proper and correct. Assertions simply analyze the response code and response message, and check if it is fit to the assertion criterias you defined.
We should also highlight one important point about assertions. Sometimes we get “200” response code for a request and think that was successful. However, we can encounter requests that seem successful but actually failed, due to development deficiencies. To avoid this situation, you should add some logical actions that check the response message. For example, you can extract the “success” key of a JSON response by JSON Extractor and check if it was “true” or not.
8. Make Use of HTTP Request Defaults
Every HTTP Request sampler in JMeter contains fields like protocol, server name, port number, and (request) path.
Usually systems and applications have lots of different environments like debug, test, pre-production, production, etc. Sometimes you will need to run the same test in different environments.
To switch your environment, you should change the server name for all your requests. Because of that, It’s never a good idea to leave these values as hardcoded.
We can use the HTTP Request Defaults configuration parameter to avoid this issue. We can configure the server and port defaults to wherever we want the requests to go in this element.
9. Verify the Situation of the Requests That Are Sent to External Servers
There may be some actions that send requests to the servers which are not a part of your system under test. If the stakeholders are interested in analyzing the performance of the host, it’s always a good idea to reaffirm with them, because if they aren’t, the HTTP request can be omitted and no traffic to the server is generated.
If you include those external requests in your test script, you should also be careful. Because if you send too many requests to external servers, you can get blocked from sending requests, since your performance testing would be seen as a DDOS attack.
Happy Load Testing with Loadium!