'How to test android application in jmeter

How to test apk file application by using jmeter in mobile? I have already installed jmeter certificate and set the proxy, But when I open browser after starting recording then it works rather than I open any apk software then any record of http requests are not coming. Please help me to rectify this issue.



Solution 1:[1]

You need to take another step in order to make possible interception and decryption of the HTTPS traffic, see Network Security Configuration:

  • add the following line to the application section of your application manifest

    android:networkSecurityConfig="@xml/network_security_config"
    
  • create network_security_config.xml file under your application resources folder and put the below code there

      <?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>
    
  • build your app in debug mode

  • replace the app in the device with the debug .apk from the previous step

Check out Configure Android Devices for Proxy Recording guide for more details if needed

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dmitri T