0

I need to do load testing for Android app using JMeter

  • On Mobile Device, Configured Manual Proxy settings and Installed JMeter root certificate
  • System and Mobile on Same WiFi only
  • On JMeter, Started Recording Got Report for Mobile open, login and some pages
  • On Report, an SSL certificate error is displayed enter image description here

Please help to solve this issue

John Kugelman
  • 349,597
  • 67
  • 533
  • 578

1 Answers1

1

If you're trying to record your mobile device network traffic using Android >= 7.0 (Nougat) you need to perform some extra steps in order to configure your application to use JMeter's certificate:

  1. In your application manifest file add the following line to the <application> tag

    android:networkSecurityConfig="@xml/network_security_config"
    
  2. Under res folder of your application create file network_security_config.xml and put the following code:

    <?xml version="1.0" encoding="utf-8"?>
    <network-security-config>
        <debug-overrides>
            <trust-anchors>
                <!-- Trust user added CAs while debuggable only -->
                <certificates src="user"/>
            </trust-anchors>
        </debug-overrides>
    </network-security-config>
    
  3. Build your application in debug mode

    gradlew assembleDebug
    
  4. Replace the application on the device with the newly build debug version - this one you can record with JMeter.

If you don't have access to your application sources you will have to root your device, convert JMeter's certificate into PEM format using OpenSSL and copy it to Android OS trusted certificates area using ADB.

More information: Recording Using Android Devices

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Thanks for your response.. Can i proceed these steps for Ionic appication too..? – Girija BSEtec Nov 14 '19 at 05:49
  • The framework doesn't really matter, it's Android OS enhanced network security. If your application can be run on Android < = 6 you can use the appropriate device or emulator for recording without having to rebuild the application – Dmitri T Nov 14 '19 at 07:13