问题
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:
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”/>
Add the following line to
<application>
section:android:networkSecurityConfig="@xml/network_security_config"
Create
network_security_config.xml
file underbase/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>
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