CN107402877B - Android-terminal-based APP test method and system - Google Patents
Android-terminal-based APP test method and system Download PDFInfo
- Publication number
- CN107402877B CN107402877B CN201610334848.7A CN201610334848A CN107402877B CN 107402877 B CN107402877 B CN 107402877B CN 201610334848 A CN201610334848 A CN 201610334848A CN 107402877 B CN107402877 B CN 107402877B
- Authority
- CN
- China
- Prior art keywords
- interface
- control
- module
- app
- entering
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention provides an APP testing method and system based on an Android terminal, wherein the method comprises the following steps: s1: entering a main interface of the APP to be tested; s2: acquiring a control contained in a current interface; s3: establishing a list comprising the layout grade and the weight of the control according to the attribute information of the control, and sequencing; s4: selecting the control with the lowest weight in the controls with the lowest layout level according to the list; s5: performing corresponding operation according to the type corresponding to the selected control; s6: entering a next interface, recording the operation result of the control, adding 1 to the weight of the selected control in the list, and marking the control as traversed; return to S2 until a preset test time is reached. The method and the device perform function detection on the controls orderly by sequencing the layout level and the weight of the controls contained in the interface and traversing the controls orderly according to the sequencing.
Description
Technical Field
The invention relates to the field of software testing, in particular to an APP testing method and system based on an Android terminal.
Background
With the development of the intelligent terminal, software installed in the intelligent terminal becomes a key point of research and development, and then corresponding software testing also becomes a technology of great concern. The existing software testing methods are various, such as Monkey testing, which is a quick and effective method for testing the stability and robustness of software; the method sends a pseudorandom user event stream (such as key input, touch screen input, gesture input and the like) to a system, and realizes stress test on the application program under development.
However, the Monkey test has the following drawbacks: 1. the application can not be logged in, only the event stream of the user is simulated, and the login interface of the application can not be identified and the corresponding account password can not be input; most applications are logged in by an account number, the stability of the applications cannot be tested deeply, and the applications only stay in front of a login interface. 2. The crash can not be positioned, the event stream is sent by adopting the pseudo-random, and when the crash occurs, a user can not accurately know which interface and which button generate the crash, so that the crash recurrence and the review of testers are not helped. 3. The current test is diversified, and Monkey is a command line tool in Android, cannot be expanded and cannot meet the requirements of diversified tests by combining other test types. 4. The method is not easy to use, Monkey is a command line tool in Android, the general calling mode is calling through a PC (personal computer) end, a mobile phone is required to be connected with the PC end, and the test cannot be carried out at any time and any place. 5. The testing range is not comprehensive enough, and Monkey is used for sending user event streams in a pseudo-random manner, so that important testing points are easy to miss.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the APP testing method and system based on the Android terminal can detect the control functions in the APP to be tested according to a certain sequence.
In order to solve the technical problems, the invention adopts the technical scheme that:
an APP testing method based on an Android terminal comprises the following steps:
s1: entering a main interface of the APP to be tested;
s2: acquiring a control contained in a current interface;
s3: establishing a list comprising the layout grade and the weight of the control according to the attribute information of the control, and sequencing;
s4: selecting the control with the lowest weight in the controls with the lowest layout level according to the list;
s5: performing corresponding operation according to the type corresponding to the selected control;
s6: entering a next interface, recording the operation result of the control, adding 1 to the weight of the selected control in the list, and marking the control as traversed; return to S2 until a preset test time is reached.
The invention provides another technical scheme as follows:
the first skip module is used for entering a main interface of the APP to be tested;
the acquisition module is used for acquiring the control contained in the current interface;
the list establishing module is used for establishing a list comprising the layout grade and the weight of the control according to the attribute information of the control and sequencing the list;
the selecting module is used for selecting the control with the lowest weight in the controls with the lowest layout level according to the list;
the control testing module is used for carrying out corresponding operation according to the type corresponding to the selected control;
the second skip module is used for entering a next interface; the recording module is used for recording the operation result of the control, adding 1 to the weight of the selected control in the list and marking the control as traversed; and the return module is used for returning to the acquisition module until the preset test time is reached.
The invention has the beneficial effects that: starting from a main interface of an APP to be tested, acquiring all controls in a new interface every time when entering the new interface, establishing a layout grade and weight list for all the controls according to the attributes of the controls in real time, and obtaining a control detection sequence relation based on the layout grade and the weights; if the layout levels are the same, the control with lower weight is preferentially detected, and the large-function control is ensured to be preferentially traversed; after the detection of one control is finished, the weight of the control in the list is added with 1 and the control is marked as traversed, so that the traversed control is avoided being traversed as much as possible in the following traversal process, the control with the lowest number of times of prior traversal operation is ensured, the testing speed is greatly accelerated, and the testing efficiency is improved.
Drawings
Fig. 1 is a flowchart of an APP testing method based on an Android terminal according to an embodiment of the present invention;
fig. 2 is a flowchart of an APP testing method based on an Android terminal according to a first embodiment of the present invention;
fig. 3 is a structural diagram of an APP test system based on an Android terminal according to an embodiment of the present invention;
fig. 4 is a structural diagram of an APP test system based on an Android terminal according to a third embodiment of the present invention;
fig. 5 is an interface tree schematic diagram of an APP test method based on an Android terminal according to a first embodiment of the present invention;
fig. 6 is a schematic diagram illustrating setting of an associated mailbox in an APP test method based on an Android terminal according to a first embodiment of the present invention;
fig. 7 is a schematic diagram illustrating screen shot setting and weak network testing of an APP testing method based on an Android terminal according to an embodiment of the present invention;
fig. 8 is a schematic diagram illustrating setting of test time in an APP test method based on an Android terminal according to a first embodiment of the present invention;
fig. 9 is a schematic diagram illustrating a mobile terminal viewing test result of an APP test method based on an Android terminal according to a first embodiment of the present invention;
fig. 10 is a schematic diagram of a PC-side view report of an APP testing method based on an Android side according to an embodiment of the present invention.
Description of reference numerals:
01. an identification module; 02. an automatic login module; 1. a first skip module; 11. an interface type judging module; 2. an acquisition module; 3. a list establishing module; 4. selecting a module; 5. a control testing module; 6. a second skip module; 7. and a report generation module.
Detailed Description
In order to explain technical contents, achieved objects, and effects of the present invention in detail, the following description is made with reference to the accompanying drawings in combination with the embodiments.
The most key concept of the invention is as follows: and sequencing the controls in the interface according to the layout level and the weight every time one interface is entered, and sequentially traversing the controls in the interface according to the sequencing to realize the function detection of each control.
Referring to FIG. 1, the present invention provides
An APP testing method based on an Android terminal comprises the following steps:
s1: entering a main interface of the APP to be tested;
s2: acquiring a control contained in a current interface;
s3: establishing a list comprising the layout grade and the weight of the control according to the attribute information of the control, and sequencing;
s4: selecting the control with the lowest weight in the controls with the lowest layout level according to the list;
s5: performing corresponding operation according to the type corresponding to the selected control;
s6: entering a next interface, recording the operation result of the control, adding 1 to the weight of the selected control in the list, and marking the control as traversed; return to S2 until a preset test time is reached.
Further, the step S1 is followed by:
s11: comparing the current interface with an interface tree established in real time according to interface skip information, and judging the current interface type, wherein the interface type comprises a new interface, a traversed interface, a crashed interface and a dead interface;
if the current interface is the new interface, adding the current interface into the interface tree, and performing the step S2;
if the current interface is the traversed interface, performing the step S4;
if the current interface is a crash interface, recording crash information, restarting the tested APP, and returning to the S1;
and if the current interface is the dead interface, returning to the previous interface, and performing the step S2.
From the above description, by judging the type of the current interface, a newly-appeared interface can be added to the interface tree in time, so that the integrity of the interface tree is ensured, the repetition caused by adding the traversed interface again can be effectively avoided, and abnormal conditions such as crash, crash and the like can be found in time.
Further, before S1, the method further includes:
s01: identifying a starting page component of the APP to be tested, performing corresponding operation according to the type of the starting page component, and entering a next interface;
s02: and automatically logging in according to a preset account password.
As can be seen from the above description, after the test is started, the startup page component is firstly identified, and corresponding operations such as sliding and clicking are performed after the identification, so that a login interface can be entered, automatic login is performed according to a preset account password, manual account password input is not required, and one-click test is implemented.
Further, the S02 specifically includes:
s021: judging whether the current interface is a login interface or not;
s022: if so, matching the pre-established account password with an account password input box of a login interface to perform automatic login;
and if not, entering the next interface and returning to the S021.
As can be seen from the above description, after the start page control is operated, the user does not have to immediately enter the login interface, for example, the user may be a main test interface, and therefore, the entered interface is firstly determined, for example, whether two input boxes exist or not is detected, and whether the characters such as "login", and the like exist or not is detected; and after the login interface is judged, the automatic login is completed by matching the preset account password with the corresponding input box.
Furthermore, screen capture is carried out every time an interface is entered.
From the above description, the interface jump situation can be recorded in real time through screen capture, and the reason of the interface jump abnormality can be analyzed according to the captured picture.
Furthermore, a dynamic log is generated in real time in the traversal process, and the dynamic log is analyzed in real time.
As can be seen from the above description, the dynamic log is generated in real time according to all operations of the traversal process, so that the real-time analysis of the dynamic log can obtain specific operations performed in the traversal process and corresponding results, such as the positions of bottom-layer codes and controls, and the reason when the test is abnormal can be known according to the analysis content of the dynamic log, for example, when the APP to be tested is crashed, the generated crash, anr and native crash are captured in time, and the number of specific code lines that are crashed are generated for development and location, where the crash is the crash caused by the development of Java through SDK; anr is Application Not Responding, i.e. the program does Not respond; native coast is a crash caused by Android NDK, development using C/C + +.
Further, the step S6 is followed by:
s7: and generating a report of a secondary directory structure according to the operation result of the control, the screen capture and the content of the dynamic log analysis, wherein the report also comprises a code-level crash log and a crash control position.
From the above description, after the traversal of the control is completed, the generated report includes the function detection result of the control, the screen capture picture in the abnormal state and the abnormal reason, so that the user can intuitively see the test condition of the tested APP and the abnormal reason, and accordingly take a corresponding solution.
Referring to fig. 3, another technical solution provided by the present invention is:
an APP test system based on an Android terminal comprises:
the first skip module 1 is used for entering a main interface of the APP to be tested;
the acquisition module 2 is used for acquiring the control contained in the current interface;
the list establishing module 3 is used for establishing a list comprising the layout grade and the weight of the control according to the attribute information of the control and sequencing the list;
a selecting module 4, configured to select, according to the list, a control with the lowest weight from the controls with the lowest layout level
The control testing module 5 is used for carrying out corresponding operation according to the type corresponding to the selected control;
the second skip module 6 is used for entering the next interface; the recording module is used for recording the operation result of the control, adding 1 to the weight of the selected control in the list and marking the control as traversed; and the return module is used for returning to the acquisition module until the preset test time is reached.
Further, the method also comprises the following steps:
the interface type judging module 11 is configured to compare a current interface with an interface tree established in real time according to interface skip information, and judge a current interface type, where the interface type includes a new interface, a traversed interface, a crashed interface, and a dead interface; if the current interface is a new interface, adding the current interface into an interface tree, and entering the acquisition module; if the current interface is a traversed interface, entering the selection module; if the current interface is a crash interface, recording crash information, restarting the tested APP, and returning to the S1; if the current interface is a dead interface, returning to the previous interface, and entering the acquisition module;
the identification module 01 is used for identifying a starting page component of the APP to be tested, performing corresponding operation according to the type of the starting page component, and entering a next interface;
the automatic login module 02 is used for automatically logging in according to a preset account password;
the screen capturing module is used for capturing screens when entering one interface;
the dynamic log generation module is used for generating a dynamic log in real time in the traversal process;
the dynamic log analysis module is used for analyzing the dynamic log in real time;
and the report generating module 7 is used for generating a report of a secondary directory structure according to the operation result of the control, the screen capture and the content of dynamic log analysis, wherein the report further comprises a code-level crash log and a crash control position.
From the above description, the interface type determination module is used for determining what type the newly entered interface belongs to, so that the newly appeared interface can be timely added into the interface tree, the integrity of the interface tree is ensured, the repetition caused by adding the traversed interface again can be effectively avoided, and abnormal conditions such as breakdown, crash and the like can be timely found; identifying a starting page component of the APP to be tested through an identification module, and performing operation such as sliding click according to the type corresponding to the starting page component so as to enter a login interface; the automatic login module automatically logs in according to a preset account password without manually inputting the account password, so that one-key test is realized; the screen capture module, the dynamic log generation module and the dynamic log analysis module can monitor the traversal process in real time, so that abnormity can be found in time, and the reason of the abnormity can be analyzed according to the screen capture picture and the dynamic log.
Example one
Referring to fig. 2 and fig. 5 to 10, an embodiment of the present invention provides an APP testing method based on an Android terminal, which can detect control functions in an APP to be tested according to a certain sequence. To better illustrate the solution of the present embodiment, the concept of interface tree, layout level, weight and several interface types is first explained:
the interface tree is recorded in a tree form, each interface has one or more controls, each control can jump to the corresponding interface, each control has its own attribute information, the attribute information of the control contains attributes required by setting the layout grade and the weight, and the control can be subjected to ordered traversal test according to the layout grade and the weight; in the invention, the controls with lower layout levels are traversed more preferentially, the controls with lower weights are traversed more preferentially if the layout levels are the same, and one of the controls is randomly selected for traversing if the weights and the layout levels are the same. When entering a first interface, directly establishing an interface tree, establishing a list containing the layout level and the weight of the control for the control in the first interface, and sequencing the list; and then, updating the interface tree and the list in real time according to the control of the interface when jumping to one interface.
The new interface is an interface which is not recorded in the interface tree before;
dividing the traversed interface into the same interface and a similar interface, wherein the same interface is the interface which is completely the same as a certain interface recorded in the interface tree before; the similar interface is an interface with a small amount of control difference with a certain interface recorded on the interface tree, specifically, an interface with the same Activity name and the same control number of more than 80% as the certain interface on the interface tree is defined as the similar interface, the Activity is one of four major components of the Android system, and an interface where a user interacts with an Android application program can be regarded as a control container;
collapse interface: if the control operated before the interface jumps has a crash, the interface is a crash interface;
a dead interface: and if the interface has no operable control or has traversed all the controls, no interface jump occurs in the process, and the interface still stays in the interface, so that the interface is a dead interface.
The following are the specific steps of this embodiment:
before testing:
setting an associated mailbox, selecting an APP to be tested, and setting test time, an account password, whether to open a screen shot and a weak network (for example, limiting the network speed to be below 20 kb/s), as shown in fig. 6 to 8, the embodiment is to open the screen shot and the weak network.
The test was started:
starting an APP to be tested, entering an interface, wherein the interface after entering is the current interface, scanning a control contained in the current interface, judging whether a starting page component (such as Android. support. v4.view. View. ViewPager, Android. widget. image switcher, Android. widget. ViewFlipper, Android. widget. HorizontalScrollView, which are all Android components and are used for realizing inter-picture switching or carousel functions) exists in the interface and whether the number of the controls is less than 6, and if so, judging that the interface is a starting page; (common startup page controls generally exist in other interfaces, so that the controls are easy to scan in non-startup pages, and the number of startup page controls is generally small; therefore, if the startup page components exist and the number of controls is small, the interface is a startup page); performing corresponding operation according to the type of the starting page component, for example, performing sliding operation if the starting page component is a sliding component, and performing clicking operation if the clicking component is a sliding component, and entering a next interface; sometimes, when the starting page has more than one page, returning to the step of scanning the control contained in the current interface and judging whether the starting page component exists in the interface or not until the starting page is processed, and entering a login interface;
s1: automatically logging in by using the account password set before the test, and entering a logged interface, namely a main interface of the APP to be tested;
s11: comparing the current interface with an interface tree established in real time, and judging the current interface type, wherein the interface type comprises a new interface, a traversed interface, a crashed interface and a dead interface; if the current interface is the new interface, adding the current interface into the interface tree, and performing the following S2; if the current interface is a traversed interface, proceeding to S4; if the current interface is a crash interface, recording crash information, restarting the tested APP, and returning to the S1; if the current interface is a dead interface, returning to the previous interface, and performing the following S2;
s2: acquiring a control contained in a current interface;
s3: establishing a list comprising the layout grade and the weight of the control according to the attribute information of the control, and sequencing; the controls which are ordered to be traversed with higher priority are arranged in front of each other;
s4: selecting the control with the lowest weight in the controls with the lowest layout level according to the list;
s5: performing corresponding operation according to the type corresponding to the selected control;
s6: entering a next interface, recording the operation result of the control, adding 1 to the weight of the selected control in the list, and marking the control as traversed; returning to S2 until a preset test time is reached;
in the process, screen capture is carried out every time an interface is entered, a dynamic log is generated in real time in the traversal process, and the dynamic log is analyzed in real time;
s7: generating a report of a secondary directory structure according to the operation results of all controls, screen capturing and the content of dynamic log analysis, wherein the report also comprises a code-level crash log and the position of a crash control; and pushing the link of the report to the mailbox associated before the test, so that the user can directly view the test result at the mobile terminal, as shown in fig. 9, or view the report by clicking the link at the PC terminal, as shown in fig. 10.
The following describes the traversal process after entering the main interface with a specific example:
as shown in fig. 5, assuming that the main interface is the first interface, it is obvious that the main interface belongs to the new interface, an interface tree is established, and the main interface is added to the interface tree; then, when the interface 1 is entered, the interface 1 is the current interface, and the interface type of the interface 1 is judged; if the interface 1 is a new interface, adding the interface 1 into the interface tree, if the interface 1 is the same as or similar to the main interface, namely the traversed interface, not adding the interface 1 into the interface tree, if the interface 1 is a collapsed interface, restarting the detected APP, recording collapse information, adding the control collapse number identifier to 1, adding the interface 1 collapse number identifier to 1, and if the interface 1 is a dead interface, returning to the main interface; assuming that the main interface comprises a control 1, a control 2 and a control 3, and acquiring the control 1, the control 2 and the control 3; establishing lists comprising layout levels and weights for the control 1, the control 2 and the control 3, and sequencing, wherein the control with the lowest weight in the controls with the lowest layout level is arranged at the front of a list interval corresponding to the current interface and represents the first traversal; assuming that control 1, control 2, and control 3 have the layout levels and weights shown in fig. 5, it is clear that control 1 is ranked at the top of the list; selecting the control 1; assuming that the control 1 is a scroll bar control, performing a scroll operation on the control 1, entering an interface 1, adding 1 to the weight of the control 1 in the list, and marking the control 1 as a traversed control; and by analogy, continuously performing steps of judging the interface type and the like on the interface 1 until the preset time is reached, and finishing traversal. It should be noted that, if the interface 1 is entered, assuming that the interface 1 includes a control 1.1, a control 1.2, and a control 1.3, as shown in fig. 5, a layout level and a weight are established for the control 1.1, the control 1.2, and the control 1.3 in the above list; associating each control with a parent control and recording the control in the list; for example, as can be seen from the figure, control 1 is a parent control of control 1.1, and therefore control 1.1 and control 1 are associated and recorded in the above list; and so on, associating the parent control of each control upwards until the position of each control is unique; in addition, each interface in an actual scene does not necessarily contain only 3 controls, and the controls are only exemplified here.
Example two
An embodiment of the present invention is an automatic login method based on a preset account password of the Android-terminal-based APP test method according to the first embodiment, and the method includes:
after entering an interface, judging whether the current interface is a login interface or not; specifically, whether the current interface contains more than two input boxes and a text or login control containing the characters of login and login is judged; the login control is a control with characters such as 'login', 'enter', 'login' and the like in a control text or a control with characters of 'login' in a resource label attribute;
if so, matching the pre-established account password with an account password input box of a login interface to perform automatic login; specifically, there are several cases as follows: (1) comparing a preset account with the text of the input box, judging whether the account is stored or not, and if so, directly matching the password input box; (2) only two input box controls are provided, which is the password box is judged through the ispasssword attribute of the input box, and the other is the account box; the specific input box contains characters such as an account, a mailbox, a mobile phone, a number, a QQ, an Email and the like, and ispassword is false, so that the input box is the account box; the input box attribute ispasssword ═ true is a password input box, or the text of the input box contains a password, and the password type is the password input box;
if not, entering the next interface, and continuously judging whether the interface is a login interface according to the method.
Example three:
as shown in fig. 4, this embodiment provides a system applied to the APP test method based on the Android terminal in the first embodiment, including:
the setting module is used for setting the associated mailbox, selecting the APP to be tested, and setting the test time, the account password, whether to open the screen shot and the weak network (for example, the network speed is limited to be below 20 kb/s);
the identification module 01 is used for identifying a starting page component of the APP to be tested, performing corresponding operation according to the type of the starting page component, and entering a next interface;
the automatic login module 02 is configured to perform automatic login by using the automatic login method in the second embodiment according to a preset account password;
the first skip module 1 is used for entering a main interface of the APP to be tested;
the interface type judging module 11 is configured to compare a current interface with an interface tree established in real time, and judge a current interface type, where the interface type includes a new interface, a traversed interface, a crashed interface, and a dead interface; if the current interface is a new interface, adding the current interface into an interface tree, and entering an acquisition module 2; if the current interface is a traversed interface, entering a selection module 4; if the current interface is a crash interface, recording crash information, restarting the tested APP, and returning to the first jump module; if the current interface is a dead interface, returning to the previous interface, and entering the following acquisition module 2;
the acquisition module 2 is used for acquiring the control contained in the current interface;
the list establishing module 3 is used for establishing a list comprising the layout grade and the weight of the control according to the attribute information of the control and sequencing the list;
the selecting module 4 is used for selecting the control with the lowest weight in the controls with the lowest layout level according to the list;
the control testing module 5 is used for carrying out corresponding operation according to the type corresponding to the selected control;
the second skip module 6 is used for entering the next interface; the recording module is used for recording the operation result of the control, adding 1 to the weight of the selected control in the list and marking the control as traversed; the return module is used for returning to the acquisition module until the preset test time is reached;
the screen capturing module is used for capturing screens when entering one interface;
the dynamic log generation module is used for generating a dynamic log in real time in the traversal process;
the dynamic log analysis module is used for analyzing the dynamic log in real time;
the report generating module 7 is used for generating a report of a secondary directory structure according to the operation results of all the controls, the screen capture and the content of dynamic log analysis, wherein the report further comprises a code-level crash log and a crash control position;
and the pushing module is used for pushing the report to the associated mailbox.
In summary, the Android-terminal-based APP test method and system provided by the invention can use the preset account password for automatic login during testing, enter the APP main interface, realize one-click testing, and have high automation degree; when an interface is entered, the layout level and the weight sequence of the controls in the interface are automatically established, and the controls are orderly traversed according to the sequence, so that the function detection of each control is realized, and the high-function controls are guaranteed to be traversed preferentially; after each control is traversed, the weight of the control is added with 1, the control which is not traversed is guaranteed to be preferentially traversed, and the traversing efficiency is improved; and when the interface jumps, screen capture is carried out, a dynamic log is generated in real time in the traversal process, and the dynamic log is analyzed in real time, so that a corresponding report is generated according to the function detection result of the control, the screen capture picture and the analysis content of the dynamic log, and the test result, the abnormal condition and the abnormal reason can be intuitively obtained from the report.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.
Claims (9)
1. An APP testing method based on an Android terminal is characterized by comprising the following steps:
s1: entering a main interface of the APP to be tested;
s2: acquiring a control contained in a current interface;
s3: establishing a list comprising the layout grade and the weight of the control according to the attribute information of the control, and sequencing;
s4: selecting the control with the lowest weight in the controls with the lowest layout level according to the list;
s5: performing corresponding operation according to the type corresponding to the selected control;
s6: entering a next interface, recording the operation result of the control, adding 1 to the weight of the selected control in the list, and marking the control as traversed; return to S2 until a preset test time is reached.
2. The Android-terminal-based APP testing method of claim 1, wherein the step S1 is followed by further comprising:
s11: comparing the current interface with an interface tree established in real time according to interface skip information, and judging the current interface type, wherein the interface type comprises a new interface, a traversed interface, a crashed interface and a dead interface;
if the current interface is the new interface, adding the current interface into the interface tree, and performing the step S2;
if the current interface is the traversed interface, performing the step S4;
if the current interface is a crash interface, recording crash information, restarting the tested APP, and returning to the S1;
and if the current interface is the dead interface, returning to the previous interface, and performing the step S2.
3. The Android-terminal-based APP testing method of claim 1, wherein before S1, the method further comprises:
s01: identifying a starting page component of the APP to be tested, performing corresponding operation according to the type of the starting page component, and entering a next interface;
s02: and automatically logging in according to a preset account password.
4. The Android-terminal-based APP testing method according to claim 3, wherein the S02 specifically comprises:
s021: judging whether the current interface is a login interface or not;
s022: if so, judging an input box corresponding to the account number password according to the text information in the input box and the attribute of the input box, and matching the pre-established account number password with the input box corresponding to the account number password of the login interface for automatic login;
and if not, entering the next interface and returning to the S021.
5. The Android-terminal-based APP testing method of claim 1, wherein screen capture is performed every time an interface is entered.
6. The Android-terminal-based APP testing method of claim 5, wherein a dynamic log is generated in real time in a traversal process, and the dynamic log is analyzed in real time.
7. The Android-terminal-based APP testing method of claim 6, wherein the step S6 is followed by further comprising:
s7: and generating a report of a secondary directory structure according to the operation result of the control, the screen capture and the content of the dynamic log analysis, wherein the report also comprises a code-level crash log and a crash control position.
8. The utility model provides an APP test system based on Android end which characterized in that includes:
the first skip module is used for entering a main interface of the APP to be tested;
the acquisition module is used for acquiring the control contained in the current interface;
the list establishing module is used for establishing a list comprising the layout grade and the weight of the control according to the attribute information of the control and sequencing the list;
the selecting module is used for selecting the control with the lowest weight in the controls with the lowest layout level according to the list;
the control testing module is used for carrying out corresponding operation according to the type corresponding to the selected control;
the second skip module is used for entering a next interface; the recording module is used for recording the operation result of the control, adding 1 to the weight of the selected control in the list and marking the control as traversed; and the return module is used for returning to the acquisition module until the preset test time is reached.
9. The Android-terminal-based APP testing system of claim 8, further comprising:
the interface type judging module is used for comparing the current interface with an interface tree established in real time according to interface skip information and judging the current interface type, wherein the interface type comprises a new interface, a traversed interface, a crashed interface and a dead interface; if the current interface is a new interface, adding the current interface into an interface tree, and entering the acquisition module; if the current interface is a traversed interface, entering the selection module; if the current interface is a crash interface, recording crash information, restarting the tested APP, and returning to the first jump module; if the current interface is a dead interface, returning to the previous interface, and entering the acquisition module;
the identification module is used for identifying a starting page component of the APP to be tested, carrying out corresponding operation according to the type of the starting page component and entering a next interface;
the automatic login module is used for automatically logging in according to a preset account password;
the screen capturing module is used for capturing screens when entering one interface;
the dynamic log generation module is used for generating a dynamic log in real time in the traversal process;
the dynamic log analysis module is used for analyzing the dynamic log in real time;
and the report generating module is used for generating a report of a secondary directory structure according to the operation result of the control, the screen capture and the content of the dynamic log analysis, and the report also comprises a code-level crash log and the position of the crash control.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610334848.7A CN107402877B (en) | 2016-05-19 | 2016-05-19 | Android-terminal-based APP test method and system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610334848.7A CN107402877B (en) | 2016-05-19 | 2016-05-19 | Android-terminal-based APP test method and system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN107402877A CN107402877A (en) | 2017-11-28 |
| CN107402877B true CN107402877B (en) | 2020-08-18 |
Family
ID=60394071
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610334848.7A Active CN107402877B (en) | 2016-05-19 | 2016-05-19 | Android-terminal-based APP test method and system |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN107402877B (en) |
Families Citing this family (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108038059A (en) * | 2017-12-22 | 2018-05-15 | 广州酷狗计算机科技有限公司 | Interface traversal method and device |
| CN108572913A (en) * | 2018-02-26 | 2018-09-25 | 挖财网络技术有限公司 | Method, apparatus and the application of App homepages are positioned in Android client UI automation processes |
| CN108595330A (en) * | 2018-04-23 | 2018-09-28 | 北京潘达互娱科技有限公司 | A kind of application testing method and device |
| CN108881585B (en) * | 2018-05-08 | 2020-11-10 | 北京五八信息技术有限公司 | Built-in application program test processing method and device, electronic equipment and storage medium |
| CN108763097A (en) * | 2018-06-06 | 2018-11-06 | 上海携程国际旅行社有限公司 | Automated testing method, device, electronic equipment, storage medium |
| CN109062807B (en) * | 2018-09-14 | 2021-01-12 | 口碑(上海)信息技术有限公司 | Method and device for testing application program, storage medium and electronic device |
| CN111045913B (en) * | 2018-10-11 | 2023-07-07 | 福建天泉教育科技有限公司 | Method and terminal for automatically logging in application to be tested |
| CN109857636A (en) * | 2018-12-25 | 2019-06-07 | 杭州茂财网络技术有限公司 | A kind of methods and applications positioning App homepage in Android client UI automation process |
| CN109669798B (en) * | 2018-12-25 | 2022-09-16 | 北京金山安全软件有限公司 | Crash analysis method, crash analysis device, electronic equipment and storage medium |
| CN112532966B (en) * | 2019-08-27 | 2025-02-18 | 中兴通讯股份有限公司 | Set-top box testing method, device, set-top box and computer-readable storage medium |
| CN111125654A (en) * | 2019-12-20 | 2020-05-08 | 珠海金山网络游戏科技有限公司 | Method and device for automatically logging in client based on log file and readable medium |
| CN113626301B (en) * | 2020-05-06 | 2024-09-20 | 北京字节跳动网络技术有限公司 | Method and device for generating test script |
| CN112612698A (en) * | 2020-12-17 | 2021-04-06 | 平安普惠企业管理有限公司 | Application program crash test method and related product |
| CN112559721B (en) * | 2020-12-25 | 2023-10-20 | 北京百度网讯科技有限公司 | Adjustment methods, devices, equipment, media and program products for human-computer dialogue systems |
| CN112988304B (en) * | 2021-03-25 | 2022-04-29 | 腾讯科技(深圳)有限公司 | Recording method and device of operation mode, electronic equipment and storage medium |
| CN114780376A (en) * | 2022-03-03 | 2022-07-22 | 浙江吉利控股集团有限公司 | Application function traversal test method and device and storage medium |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104035867A (en) * | 2014-06-04 | 2014-09-10 | 重庆泰凯科技有限公司 | Application function traversal testing method based on Android |
| CN104598380A (en) * | 2015-01-16 | 2015-05-06 | 广东欧珀移动通信有限公司 | Method and system for automatic testing based on control |
| CN104834600A (en) * | 2015-04-28 | 2015-08-12 | 南京邮电大学 | Method for testing Android application controls |
| CN105550101A (en) * | 2015-12-02 | 2016-05-04 | 北京奇虎科技有限公司 | Test method for application program, electronic device and system |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2008110198A1 (en) * | 2007-03-09 | 2008-09-18 | Mentor Graphics Corporation | Hardware interface board for connecting an emulator to a network |
-
2016
- 2016-05-19 CN CN201610334848.7A patent/CN107402877B/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104035867A (en) * | 2014-06-04 | 2014-09-10 | 重庆泰凯科技有限公司 | Application function traversal testing method based on Android |
| CN104598380A (en) * | 2015-01-16 | 2015-05-06 | 广东欧珀移动通信有限公司 | Method and system for automatic testing based on control |
| CN104834600A (en) * | 2015-04-28 | 2015-08-12 | 南京邮电大学 | Method for testing Android application controls |
| CN105550101A (en) * | 2015-12-02 | 2016-05-04 | 北京奇虎科技有限公司 | Test method for application program, electronic device and system |
Also Published As
| Publication number | Publication date |
|---|---|
| CN107402877A (en) | 2017-11-28 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107402877B (en) | Android-terminal-based APP test method and system | |
| CN105094783B (en) | method and device for testing stability of android application | |
| CN106991040B (en) | Data interface testing method and device | |
| CN104050076B (en) | Application software testing method, apparatus and system on mobile terminal | |
| CN105373478B (en) | Automated testing method and system | |
| CN111752843B (en) | Method, apparatus, electronic device and readable storage medium for determining influence surface | |
| CN105320591A (en) | Code detection method and device | |
| CN103823754A (en) | Method and device for realizing automatic testing | |
| CN111078567A (en) | Report generation method, terminal and storage medium of automatic test platform | |
| CN112231234B (en) | Cross-platform user interface automatic testing method, device, equipment and storage medium | |
| CN103838674A (en) | Intelligent testing robot based on digital image and use method thereof | |
| CN105898290A (en) | Method and device for controlling intelligent device to enter factory test mode | |
| CN110806965A (en) | Automatic test method, device, equipment and medium | |
| CN113836045A (en) | Logic generation method and device for interface automation assertion and storage medium | |
| CN114168461A (en) | Performance test method and test system applied to domestic operating system | |
| US20170161181A1 (en) | Testing support system, and testing support method | |
| CN110232013B (en) | Test method, test device, controller and medium | |
| CN111090665A (en) | Data task scheduling method and scheduling system | |
| CN112188192A (en) | Code stream adaptability test method, system, computer equipment and storage medium | |
| CN107908525A (en) | Alert processing method, equipment and readable storage medium storing program for executing | |
| CN114896148A (en) | Terminal application automatic testing device, system, method, equipment and storage medium based on image recognition capability | |
| CN105138458A (en) | Method and system for recording automatic testing scripts by combining intelligent terminal and computer terminal | |
| CN106484604B (en) | Application test control method and device | |
| CN111061630A (en) | Product debugging method, debugging device and readable storage medium | |
| CN118503114A (en) | Application program testing method and device, computer equipment and readable storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |