1. Introduction
Currently, there are two main approaches for performing weak network special testing on mobile devices:
1. Conduct weak network testing by connecting Android devices to a PC, such as using Fiddler, Charles, NET-Simulator, etc. The basic idea is to install a Fiddler network packet capture tool on the PC, then proxy the Android deviceâs network to the PC and set delay on Fiddler on the PC to simulate a weak network.
2. Build a weak network WiFi on a dedicated server, connected by mobile devices for weak network testing. Related technical solutions include Facebookâs ATC and Tencentâs WeTest-WiFi.
Approach to weak network testing:
1. Weak network functional testing: 2G/3G/4G/5G, high latency, high packet loss
2. No network state testing: disconnected network function test, local data storage
3. User experience focus: response time, page rendering, timeout copywriting, reconnection after timeout, security and high traffic risk
4. Network switching testing: Wifi-2G/3G/4G/5G-no network multi-state switching
User experience focus:
1. Whether the page response time is acceptable, focus includes hot start, cold start time, page switching, front-back switch, first byte time, first screen time, etc.
2. Whether the page rendering is completely consistent.
3. Whether the timeout copywriting conforms to the definition, and whether the abnormal information displays normally.
4. Whether there is a timeout reconnection.
5. From the security perspective: whether DNS hijacking occurs, login IP changes frequently, or single sign-on anomalies.
6. High traffic event risk: whether updating Apk packets or downloading files under weak network conditions.
2. Overview
The QNET network testing tool enables the establishment of a complete weak network environment for weak network simulation testing without the assistance of PC or server. Simply install the QNET network testing tool on any smartphone to complete the weak network environment setup, then select different scenarios for testing as needed. It also offers network packet capture for network data issue analysis.
Features:
1. Simple and quick weak network setup. No requirement to set up an extra weak network environment, no need to root/jailbreak the phone, no data cable needed, just install the QNET App to set up a weak network testing environment in one minute.
2. Automated weak network testing. QNET supports ADB command-driven testing automation, allowing users to write scripts and achieve automated weak network testing, reducing testing costs and improving efficiency.
3. Network protocol packet capture. No need to root/jailbreak the phone, no third-party tools required, supports TCP/UDP/ICMP protocol network packet capture, exports pcap file format, viewable with tools like Wireshark.
4. Realistic global network and weak network scenarios. Covers real-time network data from all provinces in China, as well as major countries and regions overseas, providing real weak network scenarios such as subways and elevators.
3. Installation
No need to root/jailbreak the phone, no need for a data cable, offers users quick, reliable, and fully functional weak network simulation services as an independent app.
Download and install the specified version according to the mobile operating system.
Official website: wetest.qq.com/product/qnet/
4. Testing Steps
1. Open the app and log in
>
2. Authorization login successful
>
4.1. Configure Weak Network Templates and Parameters
First, add and edit weak network templates, provide different network scenarios, and adjust network parameters according to testing requirements. Weak network templates support adding, deleting, modifying, and querying operations.
There are two ways to add new weak network templates:
1. The âAddâ button in the upper right corner of the page, for custom templates.
2. The âAddâ button for each template in the âNetwork Scenariosâ page, for setting templates for different scenarios.
![](https://www.ids-sax2.com/wp-content/uploads/picture/ask-qcloudimg-com-b06920ce63eb22da50b474d90d0d93f4.png)
Combine and fill in the corresponding parameters according to the testing needs, then save.
As shown in the figure: custom template
![](https://www.ids-sax2.com/wp-content/uploads/picture/ask-qcloudimg-com-6d21d870b7ad733b510cef68d574c836.png)
4.2. Select Testing Products for Testing
Add a specified weak network template on the workbench page, then select all applications or one application, and click the start button to initiate weak network testing.
If the network packet capture function is enabled, after the weak network testing concludes, import the automatically generated pcap format file on the phone to the PC and use the Wireshark tool for analysis.
Note: The iOS version only supports all applications
1. Android version
As shown in the figure: Android version starts weak network testing
![](https://www.ids-sax2.com/wp-content/uploads/picture/ask-qcloudimg-com-fb13b8a29c3046200fd29e3bcca6144b.png)
Settings page, enabled: network packet capture, control floating window, information floating window.
![](https://www.ids-sax2.com/wp-content/uploads/picture/ask-qcloudimg-com-4f681f57966d9b971dc12476baf403b8.png)
2. iOS version
As shown in the figure: iOS version starts weak network testing
![](https://www.ids-sax2.com/wp-content/uploads/picture/ask-qcloudimg-com-614e2c9c6da5072c7de6724a933159be.png)
Settings page, enabled: network packet capture
Note: The iOS version does not have control floating window, information floating window functionality.
![](https://www.ids-sax2.com/wp-content/uploads/picture/ask-qcloudimg-com-119f32ac24103ab4385e2dee9aa32862.png)
5. ADB Command Execution
The ADB command execution feature can automatically enable the weak network, helping users integrate into automated weak network testing.
Before using, connect the Android device to the PC with USB and ensure it is connected.
![](https://www.ids-sax2.com/wp-content/uploads/picture/ask-qcloudimg-com-653f30443ca511bc043df4689a01b50b.png)
1. Start
First execute the command to start the QNET process:
adb shell am start {--[type] [key] [value]} com.tencent.qnet/.Component.AdbStartActivity
Example: Capturing UDP upstream 20ms latency for WeChat
adb shell am start --ei "dump_pcap" 1 --es "package_name" "com.tencent.mm" --ei "out_delay" 20 --ei "protocol" 2 com.tencent.qnet/.Component.AdbStartActivity
2. Update
Update weak network parameters:
adb shell am broadcast -a "qnet.boradcast.drive" --include-stopped-packages {--[type] [key] [value]} com.tencent.qnet
Example: Update parameters for TCP/UDP 100% packet loss
adb shell am broadcast -a "qnet.boradcast.drive" --include-stopped-packages --es "command" "update" --ei "in_rate" 100 --ei "out_rate" 100 --ei "protocol" 3 com.tencent.qnet
3. End
Terminate weak network and exit process:
adb shell am broadcast -a "qnet.boradcast.drive" --include-stopped-packages {--[type] [key] [value]} com.tencent.qnet
Example: End weak network
adb shell am broadcast -a "qnet.boradcast.drive" --include-stopped-packages --es "command" "stop_service" com.tencent.qnet
4. Parameter Transmission Method
â[type] [key] [value]
âei: indicates parameter value as int
âes: indicates parameter value as string
5. Detailed Parameter List
![](https://www.ids-sax2.com/wp-content/uploads/picture/ask-qcloudimg-com-6d405b8727a53a8b07b152b50330d230.png)
![](https://www.ids-sax2.com/wp-content/uploads/picture/ask-qcloudimg-com-3d6697cae7fb5b707a5f00442bc4f648.png)