This contains what you need to run sample JMeter scripts.
Several sample applications are used as the basis for learning and discussing best practices:
- In "The-Internal" folder are scripts to invoke "The Internet" sample app Dave Hoeffer wrote for Selenium functional testers use to validate their skill. This is similar to https://wilsonmar.github.io/flood-the-internet/#challenges-on-the-internet-app
Several people contributed to this project (and may be available for tutoring):
- Anil Mainali
- Wilson Mar
- How about you?
The components necessary for performance/capacity testing are:
A. The application under test. I've used "the-internet" because it is intended as a set of JavaScript challenges for scripting user emulation scripts. There are other sample apps.
B. JMeter to run scripts that emulate 1 or a lot of client instances. Blazemeter cloud provides that. A Docker image of the free/open-source Jenkins can be used locally or in a public cloud.
C. Environment to host the app. Dave Hoeffer has graciously created an instance on Heroku for single-user runs during scripting. But for load/capacity tests, we need to create a stand-alone app instance within a cloud.
D. CI/CD workflow engine (such as Jenkins, Harness.io, CircleCI, GitHub Actions, etc.) which builds the app under test and test for security, functionality, capacity capability, etc.
E. Monitoring (Metrics, Diagnostics, Logging) in the same environment running the app to identify trends, pin-point bottlenecks, and identify root causes.
Below are step-by-step instructions for assemblying all 5 components, in several scenarios:
-
The simplest is to run single transactions against the "the-internet" demo app in Blazemeter for free for (not performance/load tests) after getting JMeter scripts from GitHub to your local machine and creating a free account.
-
To run capacity tests, stand up an app instance in the cloud and run up to 20 users running a single script from Blazemeter.
-
To run off-grid/offline during script development (if you have the memory and hard drive space), set up the app under test, JMeter. and Jenkins on your laptop.
-
Use the CI/CD environment your devs use (such as at Harness.io, CircleCI, etc.) to run load/capacity tests.
Apache JMeter is a Git submodule to ensure that the scripts continue working even when JMeter is changed. Also, submodules provide a way to analyze what went wrong (for forensics). See https://devcenter.heroku.com/articles/git-submodules
-
Navigate to "https://github.com/wilsonmar/jmeter-scripts"
-
Click on Code and click on Download ZIP.
Zip file is downloaded.
-
Navigate to download folder and unzip the folder. You may save the unzipped folder to your desired location, or you can access from download folder.
jmeter-scripts-main folder is unzipped.
-
Navigate to https://www.blazemeter.com
-
Click on Start Testing Now Link.
-
Enter First name, Last name, Email and Click on REGISTER link.
-
Pop up screen appears. Click on Close.
Congratulations! You have now created a BlazeMeter Account.
https://www.blazemeter.com/blog/continuous-integration-101-how-run-jmeter-jenkins
-
Click on Projects and click on create new project.
-
Provide a name “the-internet” and click on Create project.
-
Click on Create New Test link.
-
Click on Performance Test link.
-
Navigate to your previous downloaded “jmeter-scripts-main” folder and upload the script which you want to run by clicking on the Plus Sign.
In my case:
C:\Users\anilm\Projects_wWilsonMar\jmeter-scripts\the-internet.
The script is uploaded onto BlazeMeter.
If you want to upload multiple files, select all the files you need to upload and upload the files at once.
-
Next, Complete the Load Configuration.Set up total users - 1 User, Duration - 5 Minutes and ramp up time - 1 Min
-
Next, set up the load distribution. Select the desired location for LG.
-
Click on Debug Test.
-
Click on Start Debug Run.
Warming Up message
Your test will begin shortly message. Wait for some time until the test starts.
The Load Test starts.
The test completes after 5 Min with 0 % Errors
-
Click "Executive Summary"
Congratulations! Now you have Downloaded jmeter-scripts Repo from GitHub to your local machine, then signed Up and run a test using BlazeMeter.
https://www.linkedin.com/pulse/running-jmeter-test-aws-ecs-anees-mohammed
Back in 2016, Amazon wrote https://aws.amazon.com/blogs/apn/performance-testing-in-continuous-delivery-using-aws-codepipeline-and-blazemeter/
https://www.jenkins.io/doc/book/using/using-jmeter-with-jenkins/
But if you're editing scripts, install JMeter on your laptop:
-
If you're running on your local laptop, to automatically configure your path if you do not use direnv:
source .envrc
-
Verify that jmeter is on your path by typing which jmeter
To run performance/load tests, we spin up instances of "The-internet" app in a cloud (AWS, Azure, GCP, etc.):
- TODO ...
NOTE: This is based on the structure of folders at
- https://github.com/jmeterbyexample/jmeter-test-scripts
- https://github.com/nighteblis/JmeterBook is a JMeter tutorial in Chinese and English at https://translate.google.com/translate?hl=&sl=auto&tl=en&u=https%3A%2F%2Fwww.hissummer.com%2F
- https://github.com/Sunbird-Ed/sunbird-perf-tests
- https://github.com/cf-identity/jmeter pulls in Apache JMeter so that new versions will not break runs by my scripts here. It also contains png files of metrics generated during the last run.
- https://github.com/ambertests/JMeterExamples has a PropExample.jmx - Script which takes properties from the command-line
Others: