We will save the test plan before running it. To add a listener, right click on the HTTP request sampler, hover over Add, then hover over Listener and finally select View Results Tree. In order to ensure the test plan is configured correctly it can be helpful to add a listener to make sure the HTTP request is succeeding. There are plenty of other options to accommodate more complicated requests that we won’t use, including port number and parameters. We will need to enter http in the protocol section, as the Server Name, resource as the path and GET as the method. Let’s say we are trying to access a resource at. Clicking on the HTTP request sampler on the left opens up the details of the sampler in the main pane of the UI. Now we have to fill in the details for the HTTP request we want to make from each thread in the load test. We will add an HTTP Request Sampler for our test case. Hovering over the samplers sub-item will open the list of available samplers which can be added to the thread group. A sampler is an instruction to send a request to a server, and different samplers correspond to different protocols used to send the request. In this post, all we need to add to the thread group is a sampler. Hovering over the add sub-item brings up a list of all the different items you can add to the thread group for different test cases. Right clicking on the thread group on the left will bring up an options menu. Loop count - this is the number of times the specified test will run on each thread before the test plan finishes.įor example to simulate 10 users simulataneously hitting the server’s endpoint 100 times each, set the number of threads and the ramp up period to 10, and the loop count to 100.It is recommended in the documentation that this is equal to the number of thread groups initially, and you can fine-tune from there. Ramp-up period - this is the number of seconds JMeter will take to spin up all the threads.Number of Threads - this is the number of threads, and will be the number of simulated users using the service concurrently.Selecting the created thread group in the side pane, I can see in the main pane several options to configure the thread group. A thread group allows you to simulate multiple users by instructing JMeter to spin up multiple threads to run a given test case concurrently. In this example we will add a thread group to the test plan from the submenu item “Threads (users)”. Right clicking on the Test Plan item in the pane on the left then hovering over the add sub-item opens up an options menu showing all the items you can add to the test plan. One of the advantages of the JMeter UI is great discoverability of all the different options for testing. This is the top level component of a JMeter test, and is largely a container for other components with some configuration options which we won’t touch for this simple load test. It will look something like this:Ĭreated for you and displaying in the pane on the left-hand side is a test plan. JMeter UIĪfter downloading JMeter (I’m using v5.4.1 for this post) and adding it your PATH environment variable, the JMeter UI can be opened from the command line by running the command jmeter. I recommend opening the images in a separate tab (right click and select “Open image in new tab”) in order to see the detail. These capture the whole screen, but therefore make the detail hard to see when embedded in the blog. I have provided images to alongside the instructions. In this article, I will demonstrate how to perform a simple load test hitting an HTTP endpoint with lots of requests concurrently to simulate a large user base all using the service at the same time. Load testing means putting an application under load by making it do lots of work, for example making lots of requests to it. It was originally designed for testing Web Applications but has since expanded to other test functions”. As described on their website “The Apache JMeter™ application is open source software, a 100% pure Java application designed to load test functional behavior and measure performance.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |