Skip to main content

JMeter Load Testing Tutorial

JMeter Load Testing Tutorial

For more in depth information on load testing written by the devs: Load Testing

Download JMeter

  • Go to https://jmeter.apache.org/download_jmeter.cgi 
  • Download the .zip file for the current version of JMeter under "Binaries"
  • Extract and move the resulting apache-jmeter-5.4.1 (or whatever is the current version) folder somewhere you can find it again easily, you will need to access it

Starting JMeter

  • Go to the JMeter folder > bin > jmeter.bat (make sure the file type is a Windows Batch File)
    • The JMeter batch file will start a script which will start the JMeter application

-- Note: You can start multiple instances of JMeter if desired

Download JMeter Plugin Manager

  • Go to https://jmeter-plugins.org/install/Install/ 
  • Download plugins-manager.jar and put it into lib/ext directory in the JMeter folder
  • In order to see the Plugin Manager, restart JMeter and go to Options > Plugins Manager

Open ThroughputStressTest

Before doing this step, you should have Utopia cloned to your machine.

  • In JMeter, click File > Open
  • Browse to the Utopia base folder > Utopia Testing > Tests > LoadTests > ThroughputStressTest.jmx
  • If you have the Plugin Manager installed correctly, it will ask if you want to install the plugins needed

Change Settings

  • Click on "User Defined Variables" in the left pane
    • Change BASE_URL_1 to whichever url you are testing against (i.e. - account-staging.efilecabinet.net )
    • Change SOURCE_RESOURCE_PATH to point to wherever Resources\Test Data\CSV is on your machine
      • For example: C:\Users\JoshReese\source\repos\Utopia\UtopiaTesting\Resources\Test Data\CSV
      • You can also create your own .csv file of users to use and point to that
    • Change USER_THREAD_COUNT to the number of concurrent users you want to test
      • 3 for a smaller test
      • No more than 500 for a larger test because there are only 500 test accounts in the .csv
  • Expand the "User Specific Setup" section
    • Click on "BrowserAuthentication_Authenticate_Execute-Setup"
      • Change the "0" after "authenticationRequestType" to "1"

Running the Test

Before you run the tests:

  • Check with James or one of the Devs to make sure the load on the servers will not mess anything up
  • Make sure only one instance of the test is running against a given endpoint at a time

TODO: Add Section about using the CLI
TODO: Add Section about getting a manual login to see how it responds under stress

  • In order to run the test, you simply press play
  • Clicking on "View Results Tree - Full" will show you all the results as they appear. Likewise "View Results Tree - Errors" will show all error results, and "View Results Tree - Successes" will show all success results
  • There will be a number of tests that fail because of outdated UI elements and other issues. This is expected, and as long as most tests are passing it will accomplish the intended purpose which is to simulate a large load on the servers
  • It may take up to 2 hours to complete, so running it at the end of the day may be a good option