AEM Performance Testing Using Jmeter

Learn how to write test scripts for Performance testing on AEMAsCloud using Jmeter. Performance testing is one of the pre-requisite from Adobe for any customer to go live on cloud. In this tutorial I will cover how to install Jmeter on your local mac , some frequently used test cases like uploading and downloading assets and best practices on how to make best use of jmeter.

After completing this tutorial you should be able to perform below tasks :-

  • How to Install Jmeter.
  • How to Install Jmeter Plugins
  • Write Jmeter Script for downloading assets from AEMAsCloud.

Installing Jmeter on Mac:-

Apache Jmeter is open source software, a 100% pure Java application designed to load test functional behavior and measure performance. There are two ways to install jmeter:-

  • Homebrew
  • Manually by downloading zip from Apache.

Installing Jmeter using Homebrew:-

In order to install Jmeter using homebrew, you can simply run below command in your terminal.

brew install jmeter

To check Jmeter version you can use below command

jmeter -v

To launch Jmeter, simply run below command in your teminal and it will open Jmeter GUI interface.

jmeter

If you have installed Jmeter using homebrew on Mac, then it will be installed under:-

/opt/homebrew/Cellar/bin/jmeter/<version number>/bin

For Example: – In my case it is installed under /opt/homebrew/Cellar/bin/jmeter/5.6.3/bin

Note:- There are some restrictions when using Jmeter using Homebrew, In my case i have to add a custom template for AEM Test Cases. But templates path is not accessible using homebrew. If it is fixed in later version then homebrew will be my first choice.

Because Custom templates can’t be added using homebrew installation, so i uninstalled it and went with manual installation using Zip file. in order to uninstall Jmeter using homebrew simply run below command

brew uninstall jmeter

Install Jmeter Manually:-

Navigate to Apache Jmeter website https://jmeter.apache.org/download_jmeter.cgi and download latest version of jmeter source zip file, In this tutorial i am going to using apache-jmeter-5.6.3_src.zip.

Put the zip file in appropriate folder where you want to keep Jmeter and unzip it.

Open the terminal on jmeter bin folder and run below command

sh jmeter.sh

Now Let’s install Jmeter Plugin, because we need them for our test scripts.

Install Jmeter Plugin:-

If we are using homebrew then it will install plugin with jmeter, but in case if plugins are not showing then you can run below command to install Jmeter Plugin using home brew.

brew install jmeter --with-plugins

In case of manual installation, plugins will not be installed along with Jmeter installation, so we have to install them separately. Follow below steps to install Jmeter Plugin.

  • Navigate to Plugin manager Wiki and download Plugin Manager jar file.
  • Put the file in the lib/ext directory of Jmeter.
  • Restart JMeter.
  • On Top Right Corner, click on “Plugins Manager”.

Write Jmeter Script for downloading assets from AEMAsCloud.

To fast track the process, i am attaching sample Download Cloud JMX Template that can be placed under /jmeter/apache-jmeter-5.6.3/bin/templates.

Sample JMX Download Asset Script for working in localhost. Unzip the below file and place under /jmeter/apache-jmeter-5.6.3/bin/templates to working in your local.

Current script works with default admin/admin credentials, if you want to change the credentials, simply enter base 64 encoded username:password. You can also use below script for generating the credentials.

Under user defined variables , I have created a global variable by name BASE_URL_1 whose value is localhost. For higher environments you can change the host name here.

Finally under our Thread Group , you can update below details:-

  • Protocol :- For localhost it should be http and for higher environment it is generally https.
  • Path :- Path of the asset that you want to download
  • PortNumber :- This is required only in case of localhost (default 4502), on higher environments it is generally blank.

Now you are all set to execute your first Jmeter Test. Click on the play icon and you can monitor Aggregate Report or Result Tree for detailed analysis for throughput and average time taken per download.

Currently i ran this test with Just one thread at a time, but this configuration can be easily updated under Thread Group. Where you can provide:-

  • How many Users/Threads should be present.
  • How the Ramp up Period should be (in seconds) defined.
  • Loop Count.
Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.