CN104965791A - Method for testing Android application - Google Patents
Method for testing Android application Download PDFInfo
- Publication number
- CN104965791A CN104965791A CN201510427089.4A CN201510427089A CN104965791A CN 104965791 A CN104965791 A CN 104965791A CN 201510427089 A CN201510427089 A CN 201510427089A CN 104965791 A CN104965791 A CN 104965791A
- Authority
- CN
- China
- Prior art keywords
- interface
- program
- apk
- test
- predefined
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Abstract
The present invention discloses a method for testing an Android application. The method comprises the following steps of: running a main test script program; opening a predefined Apk program; obtaining interface stack information of an Android system; recording a position number of an interface of the predefined Apk program in a stack; the stack using the number to position a current program interface, and calling and executing a test script program of a corresponding program interface; the stack using the number to determine whether the current interface changes; and if yes, repeating the step of the stack using the number to position a current program interface, and calling and executing a test script program of a corresponding program interface. According to the method of the present invention, the current program interface can be accurately positioned according to the position number of the predefined Apk program interface in the stack, and the corresponding test operation is executed according to the content of the current interface, so as to improve test accuracy and reliability, and solve the problem that the number of test scripts caused by interface combination is large, thereby greatly reducing testing workload, and lowering testing costs.
Description
Technical field
The present invention relates to technical field of mobile terminals, particularly relate to a kind of method that Android platform application program is tested.
Background technology
Whether along with the development of mobile terminal industry, the project of cell phone manufacturer also gets more and more, and the software test of mobile phone project mostly is functional test, and during test, normally tester performs certain operating process, normal with arbitration functions.
Wherein a kind of automated testing method is Monkey test, by operations such as Monkey process simulation user touch screen, slip Trackball and buttons, pressure test is carried out to the program on equipment, how long can there is exception in trace routine, namely by carrying out the quasi-stochastic clicking operation of mould to mobile phone, with the stability of test procedure and robustness, this kind of method, owing to being random click, there is no effective judgement to current Application Program Interface, cannot ensure the accuracy and comprehensive of testing.Another kind of method of testing records manual operation, and by resetting to recording script, to complete test, this process need records a large amount of scripts could cover more comprehensive testing process, and test job amount is large, and testing cost is high.
Summary of the invention
The object of the invention is cannot ensure, to the accuracy that positions of application program current operation interface of test and comprehensive, to cause test job amount large, the technical matters that testing cost is high for solving current mobile terminal test method.
In order to solve the problems of the technologies described above, the invention provides a kind of method that Android platform application program is tested, said method comprising the steps of:
(1) main test script program T1 is run;
(2) predefined Apk program is opened;
(3) the interface stack information of android system is obtained;
(4) the Position Number TN of interface in storehouse of described predefine Apk program is recorded;
(5) described storehouse utilizes code T N to locate present procedure interface S, calls and performs the test script program T2 of corresponding program interface S;
(6) described storehouse utilize described code T N to judge whether current interface S changes, if change, then return described step (5).
Further, in described step (2), open described predefined Apk program by performing am order.
Further, in described step (3), obtain the interface stack information of android system by performing dumpsys order.
Further, predefined Apk program described in step (2) is for judging the Position Number TN of the interface S of current display in described storehouse.
In order to solve the problems of the technologies described above, present invention also offers the another kind of method that Android platform application program is tested, said method comprising the steps of:
(10) main test script program T1 is run;
(20) predefined Apk program is opened;
(30) the interface stack information of android system is obtained;
(40) the Position Number TN of interface in storehouse of described predefine Apk program is recorded;
(50) described storehouse utilizes code T N to locate present procedure interface S;
(60) if described present procedure interface S is not the interface needing test, then close current interface and open acquiescence test interface and automatically test; If described present procedure interface S is the interface needing test, then calls and perform the test script program T2 of corresponding program interface S, and entering next step;
(70) described storehouse utilize described code T N to judge whether current interface S changes, if change, then call and perform the test script program T2 of corresponding program interface S.
Further, in described step (20), open described predefined Apk program by performing am order.
Further, in described step (30), obtain the interface stack information of android system by performing dumpsys order.
Further, predefined Apk program described in step (20) is for judging the Position Number TN of the interface S of current display in described storehouse.
Method of the present invention, the present procedure interface of application program to be measured accurately can be located by the Position Number of predefined Apk program interface in storehouse, and perform corresponding test operation according to current interface content, improve accuracy and the reliability of test, and the more problem of the test script that causes due to interface combinations can be reduced, significantly reduce test job amount, reduce testing cost.
Accompanying drawing explanation
Fig. 1 is method of testing operational flow diagram according to an embodiment of the invention;
Fig. 2 is method of testing operational flow diagram in accordance with another embodiment of the present invention.
Embodiment
The present invention is further detailed explanation in conjunction with the accompanying drawings and embodiments now.These accompanying drawings are the schematic diagram of simplification, only basic structure of the present invention are described in a schematic way, and therefore it only shows the formation relevant with the present invention, and it should not be construed as limitation of the present invention.
Embodiment 1
As shown in Figure 1, method of testing Android platform application program of the present invention, comprises the following steps:
S100. main test script program T11 is run;
S110. perform am order, open predefined Apk program, predefined Apk program is for judging the Position Number TN1 of the interface S1 of the current display of application program to be measured in storehouse;
S120. perform dumpsys order, obtain the interface stack information of android system;
S130. in storehouse, the interface of predefine Apk program is found, the Position Number TN1 of interface in storehouse of recording scheduled adopted Apk program;
S140. storehouse utilizes code T N1 to locate present procedure interface S1, calls and performs the test script program T21 of corresponding program interface S;
S150. storehouse utilize code T N1 to judge whether current interface S1 changes, if change, then return step S140.
Embodiment 2
As shown in Figure 2, method of testing Android platform application program of the present invention, comprises the following steps:
S200. main test script program T12 is run;
S210. perform am order, open predefined Apk program, predefined Apk program is for judging the Position Number TN2 of the interface S2 of current display in storehouse;
S220. perform dumpsys order, obtain the interface stack information of android system;
S230. in storehouse, the interface of predefine Apk program is found, the Position Number TN2 of interface in storehouse of recording scheduled adopted Apk program;
S240. storehouse utilizes code T N2 to locate present procedure interface S2;
S250. judge whether present procedure interface S2 is the interface that application program to be measured needs test;
If S260. present procedure interface S2 is the interface needing test, then calls and perform the test script program T22 of corresponding program interface S2, and entering step S280;
If S270. present procedure interface S2 is not the interface needing test, then closes current interface and open acquiescence test interface and automatically test;
S280. storehouse utilize code T N2 to judge whether current interface S2 changes, if change, then enter step S240.
Method of the present invention, the present procedure interface of application program to be measured accurately can be located by the Position Number of predefined Apk program interface in storehouse, and perform corresponding test operation according to current interface content, improve accuracy and the reliability of test, and the more problem of the test script that causes due to interface combinations can be reduced, significantly reduce test job amount, reduce testing cost.
With above-mentioned according to desirable embodiment of the present invention for enlightenment, by above-mentioned description, relevant staff in the scope not departing from this invention technological thought, can carry out various change and amendment completely.The technical scope of this invention is not limited to the content on instructions, must determine its technical scope according to right.
Claims (8)
1. pair method that Android platform application program is tested, is characterized in that, said method comprising the steps of:
(1) main test script program T1 is run;
(2) predefined Apk program is opened;
(3) the interface stack information of android system is obtained;
(4) the Position Number TN of interface in storehouse of described predefine Apk program is recorded;
(5) described storehouse utilizes code T N to locate the present procedure interface S of application program to be measured, calls and performs the test script program T2 of corresponding program interface S;
(6) described storehouse utilize described code T N to judge whether current interface S changes, if change, then return described step (5).
2. method of testing Android platform application program according to claim 1, is characterized in that, in described step (2), opens described predefined Apk program by performing am order.
3. method of testing Android platform application program according to claim 1, is characterized in that, in described step (3), obtains the interface stack information of android system by performing dumpsys order.
4. method of testing Android platform application program according to claim 1, is characterized in that, predefined Apk program described in step (2) is for judging the Position Number TN of the interface S of current display in described storehouse.
5. pair method that Android platform application program is tested, is characterized in that, said method comprising the steps of:
(10) main test script program T1 is run;
(20) predefined Apk program is opened;
(30) the interface stack information of android system is obtained;
(40) the Position Number TN of interface in storehouse of described predefine Apk program is recorded;
(50) described storehouse utilizes code T N to locate present procedure interface S;
(60) if the described present procedure interface S of application program to be measured is not the interface needing test, then close current interface and open acquiescence test interface and automatically test; If described present procedure interface S is the interface needing test, then calls and perform the test script program T2 of corresponding program interface S, and entering next step;
(70) described storehouse utilize described code T N to judge whether current interface S changes, if change, then call and perform the test script program T2 of corresponding program interface S.
6. method of testing Android platform application program according to claim 5, is characterized in that, in described step (20), opens described predefined Apk program by performing am order.
7. method of testing Android platform application program according to claim 5, is characterized in that, in described step (30), obtains the interface stack information of android system by performing dumpsys order.
8. method of testing Android platform application program according to claim 5, is characterized in that, predefined Apk program described in step (20) is for judging the Position Number TN of the interface S of current display in described storehouse.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510427089.4A CN104965791B (en) | 2015-07-20 | 2015-07-20 | A kind of method tested Android platform application program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510427089.4A CN104965791B (en) | 2015-07-20 | 2015-07-20 | A kind of method tested Android platform application program |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104965791A true CN104965791A (en) | 2015-10-07 |
CN104965791B CN104965791B (en) | 2017-09-29 |
Family
ID=54219826
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510427089.4A Active CN104965791B (en) | 2015-07-20 | 2015-07-20 | A kind of method tested Android platform application program |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104965791B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110597704A (en) * | 2018-06-13 | 2019-12-20 | 百度在线网络技术(北京)有限公司 | Application program pressure testing method, device, server and medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110314343A1 (en) * | 2010-06-21 | 2011-12-22 | Apple Inc. | Capturing and Displaying State of Automated User-Level Testing of a Graphical User Interface Application |
CN102419732A (en) * | 2011-12-27 | 2012-04-18 | Tcl集团股份有限公司 | Android-platform-based automated testing method and testing tool |
CN104050076A (en) * | 2013-03-12 | 2014-09-17 | 阿里巴巴集团控股有限公司 | Testing method, device and system of application software on mobile terminal |
JP2014232514A (en) * | 2013-05-30 | 2014-12-11 | 日本電信電話株式会社 | Method and device for automatically operating graphical user interface |
-
2015
- 2015-07-20 CN CN201510427089.4A patent/CN104965791B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110314343A1 (en) * | 2010-06-21 | 2011-12-22 | Apple Inc. | Capturing and Displaying State of Automated User-Level Testing of a Graphical User Interface Application |
CN102419732A (en) * | 2011-12-27 | 2012-04-18 | Tcl集团股份有限公司 | Android-platform-based automated testing method and testing tool |
CN104050076A (en) * | 2013-03-12 | 2014-09-17 | 阿里巴巴集团控股有限公司 | Testing method, device and system of application software on mobile terminal |
JP2014232514A (en) * | 2013-05-30 | 2014-12-11 | 日本電信電話株式会社 | Method and device for automatically operating graphical user interface |
Non-Patent Citations (1)
Title |
---|
郭晶晶: "基于调用堆栈的GUI测试研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110597704A (en) * | 2018-06-13 | 2019-12-20 | 百度在线网络技术(北京)有限公司 | Application program pressure testing method, device, server and medium |
CN110597704B (en) * | 2018-06-13 | 2023-09-26 | 百度在线网络技术(北京)有限公司 | Pressure test method, device, server and medium for application program |
Also Published As
Publication number | Publication date |
---|---|
CN104965791B (en) | 2017-09-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3923140A2 (en) | Fault prediction method, apparatus, electronic device and storage medium | |
US10853232B2 (en) | Adaptive system for mobile device testing | |
CN109885480B (en) | Automatic interface compatibility testing method and device based on debugging bridge | |
CN108388514B (en) | Interface automation test method, device, equipment and computer readable storage medium | |
TW201941058A (en) | Anomaly detection method and device | |
CN104881364A (en) | Automated testing method and system applied to Android system | |
CN105955884B (en) | App page white screen inspection method and device | |
CN105653438A (en) | Method and device for cross-process automated testing of Android device | |
CN112231206A (en) | Script editing method for application program test, computer readable storage medium and test platform | |
CN107704376B (en) | Game automation testing method and system | |
CN104965791A (en) | Method for testing Android application | |
CN105740111A (en) | Performance detection method and device | |
CN106028367B (en) | Automatic testing method and system based on CMWrun testing platform | |
CN113301202A (en) | Call detection method and device | |
CN105868100A (en) | Android system-based automatic test method and device | |
CN112559313A (en) | Test case setting method and device, storage medium and electronic equipment | |
CN101727393A (en) | Method for dynamically testing embedded system software | |
CN106445820A (en) | Method and system for optimizing application program operation and mobile terminal | |
CN107818051B (en) | Test case jump analysis method and device and server | |
CN112241362A (en) | Test method, test device, server and storage medium | |
CN110990221A (en) | Kernel LKM-based Android platform malicious software automatic detection method and system | |
CN103902445A (en) | Regression test object determination method and device | |
CN105786698A (en) | Script-based power consumption automatic test system for mobile terminal | |
CN102708046A (en) | Computer software debugging method | |
CN113392436A (en) | CAE analysis software and office software integrated control method and platform |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
PP01 | Preservation of patent right |
Effective date of registration: 20180313 Granted publication date: 20170929 |
|
PP01 | Preservation of patent right | ||
PD01 | Discharge of preservation of patent |
Date of cancellation: 20210313 Granted publication date: 20170929 |
|
PD01 | Discharge of preservation of patent | ||
PP01 | Preservation of patent right |
Effective date of registration: 20210313 Granted publication date: 20170929 |
|
PP01 | Preservation of patent right |