Jmeter is not able to record steps of https sites on a mobile app(hybrid)

你。 提交于 2021-01-29 09:43:37

问题


I am using Jmeter version 5.1.1 and done all the settings like install RootCA Certificate in my Samsung Galaxy TAB, setting proxy in TAB as well and have laptop and TAB on same WiFi network.

But unable to record steps while performing actions on https site for a particular Mobile App(Hybrid). While the same scenario has been done on http site then it successfully recorded the steps.

Application got stuck while we login into the application on https site using Jmeter.

I have followed the basic standards of Jmeter with Mobile App(Hybrid).

Expected Result - Recording should get stored in Jmeter as test steps while we done the same on https site for a Mobile App(Hybrid).

Actual Result - Recording is not getting stored in Jmeter while we done the same on https site for a Mobile App(Hybrid) and get stuck on login page.


回答1:


As per Recording Using Android Devices article:

  1. Make sure that there are following entries in your application manifest:

    <uses-permission android:name=“android.permission.INTERNET”/>
    <uses-permission android:name=“android.permission.ACCESS_NETWORK_STATE” />
    <uses-permission android:name=“android.permission.ACCESS_WIFI_STATE”/>
    
  2. Add the following line to <application> section:

    android:networkSecurityConfig="@xml/network_security_config"
    
  3. Create network_security_config.xml file under base/src/{packageMain}/res folder with the following content:

    <?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>
    
  4. Compile your application in Debug mode

More information: Network security configuration


If you don't have access to application source you will either have to root your device in order to be able to install system-level MITM certificate or use Android Emulator



来源:https://stackoverflow.com/questions/57143739/jmeter-is-not-able-to-record-steps-of-https-sites-on-a-mobile-apphybrid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!