Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Some things commonly used in app testing

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

I'm a little hungry today, so I'm a little lazy. Send out some of my notes.

1.ADB Android debug bridge tool connects pc devices and Android devices, which can realize the operation of pc to Android.

Common commands:

Adb install package name. Apk installation

Adb shell enters adb

Su

Authorization of root permissions in Blue finger

Adb kill-service ends adb service

Adb start-service enables adb service

Adb uninstall com.xs.cn uninstall

* * adb logcat grabs Android log

Filtering method: adb logcat *: e error level log

Logs with warning level above: adb logcat *: W (with both warnings and errors)

Adb logcat *: W > > c:\ log.txt redirect logs above the warning level to the log.txt document under disk c

2.monkey tool simulates random user event flow

* * monkey-p package name-v 1000 shows the log of the execution process (the monkey tool command can be added with three-v for your own use according to the level of detail)

Click on this bag 1000 times.

Monkey-p package name-v simulation times-s seed

Parameter-s seed example: monkey-p package name-v 1000-s 200The first 200 clicks are used as seeds, and the next execution can keep the same clicks as these 200 clicks

Supplement: 1. Adb shell | grep cn.xs

2. Adb shell dumpsys meminfo to check memory usage

3. Mobile phone ANR app is not responding

If the event exceeds 5 seconds, there will be no response. Anr event

/ adta/data

Key points for 4.app testing:

Install and uninstall: power off, restart and uninstall, and then install insufficient memory and power supply.

Compatibility and adaptation: antivirus software, cloud testing system version, mobile phone model, etc.

Network usage, environment, stability: operator network and wifi handoff

Upgrade test: power outage, restart and uninstall and then run out of memory and power

Cross interference: program operation after incoming call information, application, switch charging button, etc.

Transfer of program data

Stability.

Safety

Special: stability monkey tool (performance)

Safety

Security: the release version verifies that the installation package is signed

Command: jarsigner-verify-verbose-certs apk name

Account security: password must be ciphertext transmission ciphertext display ciphertext storage.

Does decompilation contain sensitive information?

Financial people use their own input method.

If the application supports multi-login, there should be a prompt.

5. Interface test

Http interface testing: verification of initiating requests

Jmeter: test plan add thread group add http request add view result tree (can add response assertion)

Use Jmeter to test the HTTP interface this blog post contains pictures (2016-03-18 20:51:51) reprint ▼

Tag: jmeter http Interface Test Category: performance Test

In the past few days, I have learned to use Jmeter for HTTP interface testing, which is also the basis for later performance testing.

Please search for installation and operation by yourself. Download address: http://jmeter.apache.org/download_jmeter.cgi

It's only about the process here.

Let's take the simplest music list request as an example.

Http://www.xxx.com/service/audio/recommend?sn=sssssssnnnnnnn&ts=1431485908047&sign=3cc9b856b1ba7edfd4f845e4&audio_type=6&size=5

You can run it directly in the browser and return a list of 5 songs

1. Open jmeter and right-click 'Test Plan'-Threads- thread group to create a thread group

Using Jmeter to test HTTP interface

two。 Right-click thread group-add-configure components-HTTP request default

Using Jmeter to test HTTP interface

The default value of the 3.HTTP request is to set a default value for each of the following HTTP requests, that is, you set it here once, and then each HTTP request can reuse some settings. I only fill in the domain name here, and everything else uses the default value.

Using Jmeter to test HTTP interface

4. Right-click the thread group-add-Sampler-HTTP request to add a specific HTTP request

Using Jmeter to test HTTP interface

5. Copy here except the primary domain name at the path in the HTTP request. Because this is just a simple query interface, the method selects GET

Using Jmeter to test HTTP interface

6. Right-click the HTTP request-add-assertion-response assertion to determine whether the return value is expected

Using Jmeter to test HTTP interface

7. In the response assertion, everything is done by default.

If the API runs successfully, the status code 2000 and Successful will be returned. You can enter either of them. Here, to ensure that there are as many errors as possible, copy the first half of the return value here.

If your return value is very simple, you can select "match" in the pattern matching rules, and then copy the return value word for word below, so that it is a perfect match. I chose the relationship contained in 'Substring',' here. If you select the following'No 'check box, it means yes or no.

Using Jmeter to test HTTP interface

8. Then right-click the thread group-add-listener-view the result tree, where all the execution results will be displayed.

Using Jmeter to test HTTP interface

9. Click the green triangle execution button on the toolbar, click 'View result Tree' after execution, click the corresponding HTTP request, and you can see the request sent by jmeter and the response result received.

Using Jmeter to test HTTP interface

Using Jmeter to test HTTP interface

For interfaces that need to attach JSON data when sending a request, you only need to add two more places in addition to the above steps

1. Right-click HTTP request-add-configure components-HTTP header Manager, click the add button below, and fill in: Content-Type and application/json, respectively

two。 In the HTTP request, in addition to filling in the path, paste the JSON to be sent in the 'Body Data' below, and select the method as' POST''.

6.fiddler grab bag mobile terminal

! Fiddler sets proxy-- > tools-- > option- > https Select all

-> connection Select all

! Restart Fiddler

! The mobile phone is connected to the same network and the Fiddler host is set as the proxy server

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report