CopyPastor

Detecting plagiarism made easy.

Score: 1; Reported for: Exact paragraph match Open both answers

Possible Plagiarism

Reposted on 2023-12-06
by Dmitri T

Original Post

Original - Posted on 2020-11-05
by Dmitri T



            
Present in both answers; Present only in the new answer; Present only in the old answer;

In order to be able to capture HTTPS traffic from Android device with JMeter's HTTP(S) Test Script Recorder you need to amend your application's [network security configuration][1]
1. Add the next line to the [application][2] section of your app's [manifest][3]
android:networkSecurityConfig="@xml/network_security_config"

2. Create `network_security_config.xml` file in your app s [resources][4] directory 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>

3. Build your application in [debug mode][5] 4. Replace the existing application with the debug one from step 3 5. You should be able to record now
See [Configure Android Devices for Proxy Recording][6] guide for more details
Another possible reasons for recording failures:
- Your application uses other protocol(s) than HTTP(S). In this case you need to use operating-system-wide sniffer tool to capture its traffic in "raw" mode. Then you need to analyze the traffic and choose appropriate [Samplers][7] or [Plugins][8] which can simulate the app's network footprint - You're behind a corporate proxy/firewall. In this case you will need to [make JMeter aware of this upstream proxy][9].

[1]: https://developer.android.com/training/articles/security-config [2]: https://developer.android.com/guide/topics/manifest/application-element [3]: https://developer.android.com/guide/topics/manifest/manifest-intro [4]: https://developer.android.com/guide/topics/resources/providing-resources [5]: https://developer.android.com/studio/build/building-cmdline#DebugMode [6]: https://guide.blazemeter.com/hc/en-us/articles/13354685999889-Configure-Android-Devices-for-Proxy-Recording [7]: https://jmeter.apache.org/usermanual/component_reference.html#samplers [8]: https://jmeter-plugins.org/ [9]: https://jmeter.apache.org/usermanual/get-started.html#proxy_server
The ports **must match**, given you `Setting port to 9090 in recorder` you need to use the port `9090` in your mobile device network proxy configuration.
Also if you're running Android 6.0 or higher you will need to take some extra steps in order to be able to intercept secure traffic like:
1. In [`application` element][1] of your app manifest add the next line:
android:networkSecurityConfig="@xml/network_security_config" 2. Create `network_security_config.xml` file under your [app resources folder][2] and put the following 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> 3. [Build your application in debug mode][3]
gradlew assembleDebug 4. Install the .apk onto your device 5. That's it, you should be able to record now
More information:
- [Android network security config][4] - [Recording Using Android Devices][5]

[1]: https://developer.android.com/guide/topics/manifest/application-element [2]: https://developer.android.com/guide/topics/resources/providing-resources [3]: https://developer.android.com/studio/build/building-cmdline#DebugMode [4]: https://developer.android.com/training/articles/security-config#network-security-config [5]: https://guide.blazemeter.com/hc/en-us/articles/360000285357-Recording-Using-Android-Devices-Recording-Using-Android-Devices

        
Present in both answers; Present only in the new answer; Present only in the old answer;