Back to Engineering Blog

Leverage JMeter in Automation Testing

  • - Release Quality Engineering Team
  • 4 min read

Co-Authors:  Jasmine Qian, Kevin Cheng and Vivian Gu

LiveRamp engineering has a world-class infrastructure organization that supports the company’s developers, who deal with big data on a daily basis. The Release Quality Engineering (RQE) team has standardized assurance via automation testing for production-monitoring dashboards to inspect, identify, and eliminate defects at the earliest time possible to reduce customer impact.

The Challenge:

Cloud products are becoming more important in many companies, even for some with mature products moving to the cloud. Microservice, message bus, and REST API are the hot words you can often overhear during lunchtime in the tech world. The software life-cycle is typically measured in a few sprints.

As quality engineers, we are always eager to measure quality time and automate the testing process in order to get more time for deep testing and apply new tech to improve quality. Automation is a double-edged sword; elegant implementation will help with regression, save maintenance time, and manual steps, while surface usage will dig a deep hole and swallow all your time and patience.

LiveRamp’s needs:

In LiveRamp engineering’s arsenal, there is no tool platform used by the internal team to support quality verification scenarios in the software life-cycle, such as REST API debugging, functional testing, tool development, and automation testing.

LiveRamp engineering’s approach: Apache JMeter

Why JMeter?

Although JMeter is a well-known performance tool widely used on server-side performance testing, functional testing elements can also integrate within the test plan, (designed initially to support performance testing). We use JMeter as the infrastructure for the tooling platform through its library, GUI plug-in, and test-plan development capabilities.

How can we save execution time in testing to improve productivity?

  1. Reuse the same test suites in different software life-cycle phases.
  2. Save time-consuming communication and optimize knowledge sharing by reusing the testing workout.
  3. Use a free, easy to integrate tool that easily connects with a continuous integrating system and that can be seen in a command line and GUI.  Example tools are SoapUI, Postman or Katalon.

Our QE team found that Apache JMeter is the tool that achieves all three, and the learning curve is moderate.

How to use JMeter in functional and automation testing

JMeter elements layout in functional/automation testing

You can find Apache JMeter component usage and documentation on their website.

  • Applying xUnit (thought to separate independent functions into fragments) makes it reusable in different JMeter test plans
  • Parametric programming can be achieved via user-defined variables and pre- and post-processors
  • External functionality is supported by a BeanShell processor with Java programming language
  • Fragments are reusable to share in debugging, functional testing, automation, and performance tests

LiveRamp instances

Develop a customized plug-in to generate test data

The most important part of testing the advanced audience builder (AAB) feature is to prepare the audience and transaction test data. It is a time-consuming task that can take as long as 30 minutes. 

We developed customized plug-ins using self-defined parameters to generate the test data. 

Let’s take a look at the screenshot. You can define the test data file label, name, size, delimiter, and whether the test file contains the header in config. Then, click the “run” button and generate the test data file:

LiveRamp AAB Sampler to Generate Audience and Transaction Data with Label, Audience Filename, Transaction Filename and size

LiveRamp’s unique example

Search for real-time data info from the database (DB)

We usually need results information during the evaluation phase, especially in performance testing. The amount of data we need is relatively large. Generally, the practice is to access DB instances via Jump Box, then write SQL to grab testing data. The whole process is a bit complicated, with many steps. LiveRamp engineering uses JDBC connection config element and JDBC Request Sampler in JMeter to get the expected data.

Fetch release branch report

As a RQE team (also known as risk, quantification and engineering), the first thing we do is start with the sanity test after deployment, but there should be a signal to tell us that the deployment is completed successfully and correctly before starting. Our team then fetches the package deployment list by OS process sampler with the command line in JMeter to ensure successful changes.

OS process sampler interface with command line sample

Gather sonar UT coverage

We need to gather UT coverage for all active services on a monthly basis. Instead of reading the numbers from the sonar web page manually (one by one), we can get them by the JMeter test plan, which is a significant efficiency improvement.

User defined variables interface screenshot

Load test file to BigQuery

Command parameters on OS process sampler interface screenshot

The RQE team knew there had to be an easy way to load data to BigQuery efficiently and accurately, and we found it!

We suggest you adopt JMeter to run the BQ command to auto-generate the data files and save yourself time and effort.

LiveRamp is a data enablement platform designed by engineers, powered by big data, centered on privacy innovation, and integrated everywhere.

We enable an open web for everyone.

LiveRamp is hiring! Subscribe to our blog to get the latest LiveRamp engineering news!