[Tencent Optimal Testing Monthly] Detailed explanation and practice of Android mainstream automated testing framework

 
Introduction:

With the increasingly compact release cycle of mobile applications and the increasingly serious fragmentation of Android brand models/screens/system versions, the workload of mobile test engineers is increasing. Automated testing or manual testing? This controversial topic in the past few years seems to have an answer with the rise of cloud testing platforms in recent years. It is an inevitable trend for automated testing to replace some manual testing.


This is not to say that machines will replace humans, but that humans need to focus their resources on more "high-end" tasks, such as test method design, how to write/record scripts to improve the efficiency and accuracy of automated testing, etc.


For small and medium-sized R&D teams, when considering automated testing, ROI (input-output ratio) must be considered, and self-developed automated testing frameworks are not realistic. However, there are many types of Android automated testing frameworks on the market. How to choose and how to apply them?


course course


The application threshold of the app automation testing framework is not low, which also causes many people to be very interested in it but discouraged.
This video course will be used as an "experience post" to share with you the practice and experience summary of Tencent's self-developed automated testing framework.


Course outline: 1.  Overview of app automated testing 2.  Comparison and analysis of Android mainstream automated testing frameworks 3.  Practice sharing of Tencent Youqi self-developed automated testing framework



Instructors:

Leohu (Hu Bo), an expert in Tencent YouTest automated testing solutions. He joined Tencent in 2011 and has been engaged in the research work on the construction of automated testing platforms since 2012. He has rich practical experience and has made significant contributions to the core framework of optimized testing.

Click here to watch the Q&A part of [Tencent YouTest self-developed automated testing framework experience sharing]


 

:


Q: How should beginners get started with Android automated testing?
Answer: Understand what the basic principles of Android are, some basic adb commands, understand some mainstream Android testing frameworks, and see which ones are suitable for your current testing needs, but in fact, automated testing is only a means, and ultimately you have to combine it with yourself While very familiar with the business, analyze which ones can be automated, which ones can greatly save manpower investment, and which ones are not suitable for automation at present, and then carry out targeted tests, which need to be sorted out after the tests are completed. Compare the data to see what the real ROI looks like, gradually improve the plan, and quickly follow up to improve the effect.

Q: Faced with multiple automated testing frameworks, how to choose?
Answer: There are many automated testing frameworks for Android. It mainly depends on what your testing purpose is, and then choose the appropriate framework to carry out testing. Now the more popular in the industry is the Appium framework, which supports positioning controls, web applications, and cross-border The platform supports writing scripts in multiple languages, which can basically meet the general testing needs, but the recording efficiency is low, and the large-scale real machine testing is not very stable. XTest (a private automated testing tool launched by Tencent YouTest) supports fast recording. Playback, and ensure the accuracy of the script, and can perform tests on most real machines, you can try it.

Q: Is there any difference in the test of different manufacturers' models?
A: Each manufacturer mainly customizes their own ROMs, such as permission pop-up windows, floating window control, power management policies, notification bar message management, silent installation, etc...

Q: Does the Tencent YouTest self-developed automated test framework support Performance Testing?
A: It supports performance testing. Currently, you can get cpu, various memory, upstream and downstream traffic, installation time, startup time, battery temperature, fps, sm.

Q: Can the Tencent YouTest self-developed automated testing framework monitor native and h5 components? What if there is no sd card?
A: It supports the acquisition of controls for native, h5, and hybrid applications; an SD card needs to be configured, and today's mobile phones generally have a built-in storage area of ​​their own.

Q: Traditional game testing tools cannot capture controls due to engine rendering problems. How does Tencent YouTest self-developed automated testing framework solve it?
Answer: At present, the mainstream game testing engines are cocos2d-x and Unity3d. The strategy for this is to start with the game engine and obtain it from the engine by packaging it with the developed engine sdk or by repacking the game package into a special sdk. The display element information in the current scene is returned to the test framework to realize the capture of controls. Another way is to use graphics to process, first find a label, and then compare other devices with this graphics model to capture similar controls, but the device The speed and success rate after the rollout cannot be reliably guaranteed. The game has many peculiarities, such as rapid changes, random logic, etc., which makes it difficult to test after you get the controls, and the maintenance cost is high.

Q: Can the hardened package be automated test?
Answer: 4.x devices support any hardening package test, but the reinforcement of versions above 5.x will have some restrictions. At present, it is found that some hardening strategies will cause the test to fail. It is better to use a non-hardened package for testing. .

Q: What is the difference between rooted and non-rooted phones when executed?
Answer: At present, 4.x mobile phones use the root solution. The advantage of root is that we can obtain higher permissions, so that we can do more things. However, the root rate of mobile phones above 5.x is not very high. High and unstable, and the virtual machine mode is basically switched to ART, the hook support in ART mode is not very powerful, so we use the repackaging scheme for devices above 5.x, which can be understood as injection and Check in difference.

Q: General applications do not have permission to tap the screen. How to solve this problem?
Answer: When the script is played back, it is OK to use the Instrumentation of the tested application to send the corresponding event processing, and the pop-up windows such as system permissions can be identified and processed by UI Automator.

Tencent automated testing practice sharing

[video sharing] Tencent senior test engineer Huang Wenxin: The new Monkey test you never thought of]
The NewMonkey developed by the SNG R&D department can not only perform stability testing, but also trigger compilation, automatically install the latest version, and obtain the version number. After finding a problem, Crash will reissue the bill of lading, truly achieving a one-stop service.

The third-generation Android performance test system (Hook System API)
Tencent's Android QQ browser is known for its extreme speed. The Hook System API developed by it not only supports testing the loading speed of web pages, but also supports various user operation scenarios such as browser startup and menu opening, and provides response time performance data.

Application treasure is based on Robotium automated testing
Tencent application treasure project team adopts FT mode, the whole project group is divided into multiple FT, and many new features are integrated into the backbone almost every day, the project is fast-paced, changes frequently, and hopes to achieve fast and continuous delivery . How did the test team use Robotium to support this kind of high-intensity testing in R&D mode?

---------------
Open the original article of the monthly magazine to read more content. http://utest.qq.com/monthly/01.html
---------------
Tencent YouTest is a professional mobile cloud testing platform for applications, games, and H5 hybrid applications. The R&D team provides product quality inspection and problem solving services. Not only does the online platform provide automated compatibility testing, cloud mobile phone remote rental and debugging, vulnerability analysis, automated testing tools XTest and other quality testing tools, but also VIP customers are equipped with an expert team to provide customized comprehensive testing solutions.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326481368&siteId=291194637