How to record traffic from a mobile app with JMeter?

Sai kumaresh🚀
BeyondX
Published in
4 min readDec 6, 2020

Recording mobile application traffic is not much different from recording scripts for web applications. All we need to do is put a proper proxy in place for a mobile device.

Step 1: Install the app on your android device

Install the app from the play store or install it using an apk.

Step 2: Install Java

JMeter is a pure Java desktop application, it requires a fully compliant JVM 8 or higher. You can download and install the latest version of the Java SE Development Kit.

Click on JDK Download to download and install Java in your system.

Step 3: Install Jmeter

The Apache JMeter application is open-source software, a 100% pure Java application designed to load test functional behaviour and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.

Apache JMeter may be used to test performance both on static and dynamic resources, Web dynamic applications.

It can be used to simulate a heavy load on a server, group of servers, network or object to test its strength or to analyze overall performance under different load types.

Download JMeter from their official website. Download any one of the 2 binaries.

Installation of JMeter is extremely easy and simple. Unzip the zip/tar file into the directory where you want JMeter to be installed. After extraction, the folder will look similar to this.

Step 4: Launch JMeter

If you are using Window, Go to the folder where you extracted the software Double click on the “jmeter.bat” file in the “bin” folder.

After opening the file the command prompt opens and starts JMeter in GUI mode.

Step 5: Setup Test plan

On the left side of the screen Right-click on Test plan, Add ->Non-test elements -> HTTP(S) Test Script Recorder.

Note down the Port number in the HTTPS Test Script Recorder Configuration pane.

Now, Right click on HTTPS Test Script Recorder, Add ->Listener -> View Results Tree.

Now Right-Click on the Test plan and Add->Thread (Users)-> Thread group.

Next Right-click on Thread Group, Add-> Logic Controller -> Recording controller.

Step 6: Setup Mobile Proxy

The mobile device and the Laptop must be connected to the same network.

To setup the proxy we need The IP address of the laptop and The port number from HTTP(S) Test Script Recorder configuration.

To get the IP address in windows, Right-click on the WiFi connection and open Network and Internet connection. Go to the wifi tab and click on the network your laptop is connected and note down the IPv4 address.

For my case, the IP address is 192.168.1.5 and the port number is 8888.

Now on your mobile, Select the wifi network and change the proxy to manual and fill in the Hostname as the IP Address and the Port number from the HTTP(S) Test Script Recorder configuration and save the changes.

Step 6: Start the recorder

Now go back to JMeter on your laptop and go to the HTTPS Test Script Recorder Configuration pane and start recording. Click on OK in the pop-up as we trust the source and now it starts recording the traffic. Now go back to your mobile device and open the app.

--

--

Sai kumaresh🚀
BeyondX
Editor for

Not everyone who works hard is rewarded. But! all those who succeed have worked hard.