CN106326104B - Terminal control testing method and device - Google Patents

Terminal control testing method and device Download PDF

Info

Publication number
CN106326104B
CN106326104B CN201510397199.0A CN201510397199A CN106326104B CN 106326104 B CN106326104 B CN 106326104B CN 201510397199 A CN201510397199 A CN 201510397199A CN 106326104 B CN106326104 B CN 106326104B
Authority
CN
China
Prior art keywords
control
testing
test
tested
terminal
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
Application number
CN201510397199.0A
Other languages
Chinese (zh)
Other versions
CN106326104A (en
Inventor
姚远
郑凯泽
赵娜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201510397199.0A priority Critical patent/CN106326104B/en
Publication of CN106326104A publication Critical patent/CN106326104A/en
Application granted granted Critical
Publication of CN106326104B publication Critical patent/CN106326104B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a terminal control testing method, which comprises the following steps: traversing nodes and edges of a pre-established control interaction interface chart data model to obtain all clickable controls as to-be-tested controls; acquiring a current context state, and determining a return path of a test page based on the context state; and returning to a test page according to the return path, and testing the control to be tested on the test page. The invention also discloses a terminal control testing device. The method and the device realize full-automatic traversal to identify the control of the terminal and test the control, and improve the intelligent degree of terminal test.

Description

Terminal control testing method and device
Technical Field
The invention relates to the technical field of computers, in particular to a terminal control testing method and device.
Background
With the rapid development of the internet, the operating systems of the smart phones are mainly Android and iOS, and the terminals need to be tested in advance in order to ensure data issued by the terminals, however, cross-platform (Android system platform and iOS system platform) application tests face greater pressure on technology and manpower, and especially fragmentation of the Android system increases the difficulty of testing the terminals by testing teams of various companies. At present, a regression test which is manually realized can be adopted to realize the test process of the terminal, however, the existing terminal test mode cannot realize full-automatic traversal, so that the control of the terminal is identified to test the control, and the intelligent degree of the terminal test mode is low.
Disclosure of Invention
The embodiment of the invention provides a terminal control testing method and device, and aims to solve the problem that the existing terminal testing mode cannot realize full-automatic traversal to identify that the control of a terminal tests the control, so that the intelligent degree of the terminal testing mode is low.
In order to achieve the above object, an embodiment of the present invention provides a terminal control testing method, including:
traversing nodes and edges of a pre-established control interaction interface chart data model to obtain all clickable controls as to-be-tested controls;
acquiring a current context state, and determining a return path of a test page based on the context state;
and returning to a test page according to the return path, and testing the control to be tested on the test page.
In order to achieve the above object, an embodiment of the present invention further provides a terminal control testing apparatus, including:
the traversal module is used for traversing nodes and edges of a pre-established control interactive interface chart data model to obtain all clickable controls as to-be-tested controls;
an obtaining module, configured to obtain a current context state;
the determining module is used for determining a return path of the test page based on the context state;
the return module is used for returning the test page according to the return path;
and the testing module is used for testing the control to be tested on the testing page.
The method obtains the page to be tested based on the traversal of the nodes and edges of the chart data model established in advance, obtains the context state to determine the return path of the test page, completes the test operation of the terminal and realizes the automatic full-path traversal. The control is automatically traversed to identify the control of the terminal to test the control, and the intelligent degree of terminal testing is improved.
Drawings
Fig. 1 is a schematic diagram of a hardware architecture related to a terminal control testing apparatus according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a terminal control testing method according to a first embodiment of the present invention;
FIG. 3 is a schematic flow chart illustrating an embodiment of the present invention in which nodes and edges of a pre-established control interactive interface graph data model are traversed to obtain all clickable controls as controls to be tested;
FIG. 4 is a flowchart illustrating an embodiment of determining a return path for a test page based on the context state;
FIG. 5 is a flowchart illustrating an embodiment of returning to a test page according to the return path and testing the control to be tested on the test page according to the present invention;
fig. 6 is a flowchart illustrating a terminal control testing method according to a second embodiment of the present invention;
fig. 7 is a functional module diagram of a terminal control testing apparatus according to a first embodiment of the present invention;
FIG. 8 is a block diagram illustrating a refinement function of one embodiment of the traversal module of FIG. 7;
FIG. 9 is a block diagram illustrating a refinement function of one embodiment of the determination module of FIG. 7;
FIG. 10 is a schematic diagram of a detailed functional module of an embodiment of the determining unit in FIG. 9;
FIG. 11 is a functional block diagram illustrating an embodiment of the test module of FIG. 7;
fig. 12 is a functional module diagram of a terminal control testing apparatus according to a second embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows: traversing nodes and edges of a pre-established control interaction interface chart data model to obtain all clickable controls as to-be-tested controls; acquiring a current context state, and determining a return path of a test page based on the context state; and returning to a test page according to the return path, and testing the control to be tested on the test page. And traversing the nodes and edges of the chart data model established in advance to obtain a page to be tested, acquiring a context state to determine a return path of the test page, completing the test operation on the terminal and realizing automatic full-path traversal. The problem that the intelligent degree of the terminal testing mode is low due to the fact that the control of the terminal is identified to test the control by the existing terminal testing mode which cannot realize full-automatic traversal is effectively solved. The control is automatically traversed to identify the control of the terminal to test the control, and the intelligent degree of terminal testing is improved.
The existing terminal testing mode cannot realize full-automatic traversal, so that the problem of low intelligent degree of the terminal testing mode is caused by identifying that the control of the terminal tests the control.
The embodiment of the invention constructs a terminal control testing device, the terminal control testing device obtains a page to be tested based on the traversal of nodes and edges of a chart data model established in advance, obtains a context state to determine a return path of the test page, completes the test operation of the terminal and realizes the automatic full-path traversal. The problem that the intelligent degree of the terminal testing mode is low due to the fact that the control of the terminal is identified to test the control by the existing terminal testing mode which cannot realize full-automatic traversal is effectively solved. The control is automatically traversed to identify the control of the terminal to test the control, and the intelligent degree of terminal testing is improved.
The terminal control testing device of the embodiment can be borne on a PC end, and can also be borne on an electronic terminal such as a mobile phone and a tablet computer. The hardware architecture involved in the terminal control testing apparatus may be as shown in fig. 1.
Fig. 1 shows a hardware architecture related to a terminal control testing apparatus according to an embodiment of the present invention. As shown in fig. 1, the hardware related to the terminal control testing apparatus includes: a processor 301, e.g. a CPU, a network interface 304, a user interface 303, a memory 305, a communication bus 302. The communication bus 302 is used for implementing connection communication between the components in the information push platform. The user interface 303 may include a Display (Display), a Keyboard (Keyboard), a mouse, and the like, and is configured to receive information input by a user and send the received information to the processor 305 for processing. The display screen can be an LCD display screen, an LED display screen or a touch screen, and is used for displaying data to be displayed by the terminal control testing device, such as operation interfaces for displaying chart data models, terminal control tests and the like. The optional user interface 303 may also include a standard wired interface, a wireless interface. The network interface 304 may optionally include a standard wired interface, a wireless interface (e.g., a Wi-Fi interface). The memory 305 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as a disk memory. The memory 305 may alternatively be a storage device separate from the processor 301 described above. As shown in fig. 1, the memory 305, which is a type of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a terminal control test program.
In hardware related to the terminal control testing apparatus shown in fig. 1, the network interface 304 is mainly used for connecting an application platform and performing data communication with the application platform; the user interface 303 is mainly used for connecting a client, performing data communication with the client, and receiving information and instructions input by the client; and processor 301 may be configured to invoke the terminal control test program stored in memory 305 and perform the following operations:
traversing nodes and edges of a pre-established control interaction interface chart data model to obtain all clickable controls as to-be-tested controls;
acquiring a current context state, and determining a return path of a test page based on the context state;
and returning to a test page according to the return path, and testing the control to be tested on the test page.
Further, in one embodiment, the processor 301 invoking the terminal control test program stored in memory 305 may perform the following operations:
traversing nodes and edges of a pre-established control interaction interface chart data model to obtain all clickable controls;
and filtering all clickable controls, and filtering out controls with repeated positions and focus-adjustable attributes of yes to obtain the filtered controls as the controls to be tested.
Further, in one embodiment, the processor 301 invoking the terminal control test program stored in memory 305 may perform the following operations:
after receiving a control clicking operation, judging whether the clicking operation jumps to other applications or not through the context state;
if yes, judging whether to jump to other interactive interfaces;
if yes, judging whether to jump to other layouts of the same interactive interface or not through the page markup language and the page source code;
and determining a return path of the test page based on the jump processes.
Further, in one embodiment, the processor 301 invoking the terminal control test program stored in memory 305 may perform the following operations:
acquiring a packet name of a data packet corresponding to the context state, and comparing the packet name with a preset packet name through a self-packaged debugging interface;
if the application is different, the application is terminated through a process command;
and if the two are the same, judging to jump to other applications.
Further, in one embodiment, the processor 301 invoking the terminal control test program stored in memory 305 may perform the following operations:
returning to a test page according to the return path;
determining a control to be tested at present according to the data of the side of the control interaction interface chart data model in the reverse sequence;
and testing the control to be tested at present on the test page.
Further, in one embodiment, the processor 301 invoking the terminal control test program stored in memory 305 may perform the following operations:
after the test of the control to be tested is finished, obtaining a test result;
and generating a test report according to the test result.
According to the scheme, the page to be tested is obtained based on the traversal of the nodes and edges of the chart data model established in advance, the context state is obtained to determine the return path of the test page, the test operation on the terminal is completed, and the automatic full-path traversal is realized. The problem that the intelligent degree of the terminal testing mode is low due to the fact that the control of the terminal is identified to test the control by the existing terminal testing mode which cannot realize full-automatic traversal is effectively solved. The control is automatically traversed to identify the control of the terminal to test the control, and the intelligent degree of terminal testing is improved.
Based on the hardware architecture, the embodiment of the terminal control testing method is provided.
As shown in fig. 2, a first embodiment of a terminal control testing method according to the present invention is provided, where the terminal control testing method includes:
step S10, traversing nodes and edges of a pre-established control interactive interface chart data model to obtain all clickable controls as to-be-tested controls;
in this embodiment, graphs (Graph data models) are adopted in advance to simulate links between activities (interactive interfaces), the activities graphs (interactive interface Graph data models) are dynamically drawn, each Activity of an application is abstracted into a node (node) of the Graph, and jump association between each Activity is abstracted into edge (edge). And after the Activity Graph is successfully established, detecting whether the terminal control needs to be tested. The triggering mode of the terminal control for testing can be various, for example, 1) triggering through a physical key; 2) triggering when the test equipment is connected with a terminal to be tested; 3) the method is triggered by a virtual key on the test equipment or the equipment to be tested. The above listed triggering manners for testing the terminal control are only exemplary, and those skilled in the art use the technical idea of the present invention, and the triggering manners for testing other terminal controls proposed according to their specific requirements are all within the protection interval of the present invention, which is not exhaustive herein.
And after the terminal control is triggered to test, traversing nodes and edges of a pre-established control interaction interface Graph to obtain all clickable controls as to-be-tested controls. In this embodiment, in order to ensure full-automatic traversal of the terminal, an app (a cross-platform test open source framework) is provided to support the embodiment of the present invention, the iOS platform uses an UIAutomation engine, the Android platform uses a selendroid engine below 4.0, and the UIAutomation engine is used above 4.0.
The traversal logic of the embodiment of the invention is as follows: all user interfaces, and even all clickable controls, are traversed. The data structure of the framework is established on the Graph, each Activity of the application is abstracted into a node of the Graph, jump association between each Activity is abstracted into an edge, and the Graph is defined as a direction vector diagram, so that the method is mainly used for realizing navigation, traversal of the Activity is realized through traversal of the edge of the Graph, the Graph in a self-growth mode forms a corresponding node and edge when traversing each clickable (clickable area), and new nodes and edges can complete recursion and are uniformly managed by the Graph. Before a terminal test, activity in an application, layout (interactive interface layout) is defined in advance, clickbles is a terminal clickable control obtained through a standard W3C protocol, so that the standard W3C protocol is mainly used for acquiring all clickable controls of a current page by using webdriver (web driver) which supports xpath XML (path language).
Preferably, in order to improve the speed of the terminal test, the terminal test experience is improved. Referring to fig. 3, the process of traversing nodes and edges of a pre-established control interactive interface chart data model to obtain all clickable controls as to-be-tested controls may include:
step S11, traversing nodes and edges of a pre-established control interactive interface chart data model to obtain all clickable controls;
and step S12, filtering all clickable controls, filtering out controls with repeated positions and focus-adjustable attributes being yes, and taking the filtered controls as the controls to be tested.
In this embodiment, in order to improve performance, filtering is performed once for clickbles, and a control whose repetition position and focusable attribute value are tube is removed. The "engine" of the traversal implements a simulated user click through clickbles above to go to a different page (Activity and layout) or just change the current page-source (page source code).
In this embodiment, by means of Graph data modeling, a relationship Graph formed by a Graph data model can be compared with a resultant dom (standard object model), and full-path traversal can be realized on the basis of obtaining an Activity relationship Graph, so that not only a single path is used to navigate to a target Activity, but also full-path coverage is adopted in selecting a navigation path of the target Activity.
Step S20, obtaining the current context state, and determining the return path of the test page based on the context state;
after all class clicking controls are obtained in a traversing mode and used as controls to be tested, or after the clickable controls obtained in the traversing mode are filtered to obtain filtered clickable controls used as controls to be tested, context states are obtained, and a return path of a test page is determined based on the context states.
Specifically, referring to fig. 4, the process of determining a return path of a test page based on the context state may include:
step S21, after receiving the control clicking operation, judging whether the clicking operation jumps to other applications or not through the context state;
step S22, if yes, judging whether to jump to other interactive interfaces;
step S23, if yes, judging whether to jump to other layouts of the same interactive interface through the page markup language and the page source code;
in step S24, a return path of the test page is determined based on the above respective jumping processes.
In this embodiment, context management: context judgment conditions in the traversal algorithm are variable, the current context state is obtained by adopting reflection and introspection means, and the next operation is determined on the basis of the current context state, so that the layout of the layout to be tested can be finally returned.
Specifically, the step of judging whether the click operation jumps to other applications through the context state includes: acquiring a packet name of a data packet corresponding to the context state, and comparing the packet name with a preset packet name through a self-packaged debugging interface; if the application is different, the application is terminated through a process command; and if the two are the same, judging to jump to other applications.
Firstly, judging whether clicking jumps to other applications, comparing the packet names of the current packets through a self-packaged debugging interface (in an Android system, the debugging interface is an adb interface, and can also be an iOS debugging interface or a debugging interface of a Windows Phone 7 system, and the like), and if the packet names are different, terminating the applications through a process command; then judging whether to jump to other activities, and if a new activity is found, recording the activity in the Graph; and then judging whether to jump to other layout of the same activity or not through the layout of a page markup language (the page markup language can be xml, and the page xml is a page written by xml) and the page-source, and determining a return path of the test page based on each jumping process.
And step S30, returning to a test page according to the return path, and testing the control to be tested on the test page.
In this embodiment, the page navigation: and (4) an algorithm for navigating to the tested page is needed after the return path is obtained through the depth or breadth traversal of the Graph.
Specifically, referring to fig. 5, the process of returning to the test page according to the return path and testing the control to be tested on the test page includes:
step S31, returning a test page according to the return path;
step S32, determining the current control to be tested according to the data of the side of the control interactive interface chart data model in the reverse sequence;
and step S33, testing the control to be tested at present on the test page.
When the algorithm for navigating to the detected page is realized, the difficulty is how to navigate to a plurality of layout and a certain element of the page to be slid, the click control used for navigation is stored in the edge of Graph in sequence in advance, and when the object needs to be clicked, the data of the edge is deserialized to obtain the control.
In other embodiments of the present invention, in order to provide better and more intuitive test data, referring to fig. 6, after step S30, the method may further include:
step S40, after the test of the control to be tested is completed, a test result is obtained;
and step S50, generating a test report according to the test result.
After the testing of the to-be-tested control is completed, a testing result is obtained, after all the to-be-tested controls of the terminal are tested, the testing results of all the controls of the terminal are obtained, a testing report is generated according to all the testing results and is locally stored in the testing device or is sent to a third party terminal, and the third party terminal is a terminal in communication connection with the testing device, such as a mobile phone, a pad, a notebook computer and the like, or the testing report and the testing result are displayed on the testing device so that a user at the end of the testing device can visually know the testing result. The test results can be presented in the form of bar charts or graphs.
In the embodiment, the page to be tested is obtained based on the traversal of the nodes and edges of the chart data model established in advance, the context state is obtained to determine the return path of the test page, the test operation on the terminal is completed, and the automatic full-path traversal is realized. The control is automatically traversed to identify the control of the terminal to test the control, and the intelligent degree of terminal testing is improved.
Correspondingly, the invention provides a first embodiment of the terminal control testing device. Referring to fig. 7, the terminal control testing apparatus includes a traversing module 10, an obtaining module 20, a determining module 30, a returning module 40, and a testing module 50.
The traversal module 10 is configured to traverse nodes and edges of a pre-established control interaction interface chart data model to obtain all clickable controls serving as controls to be tested;
in this embodiment, graphs are adopted to simulate links among Activities in advance, Activities graphs are drawn dynamically, each applied Activity is abstracted to a node of the Graph, and jump association between each Activity is abstracted to edge. And after the Activity Graph is successfully established, detecting whether the terminal control needs to be tested. The triggering mode of the terminal control for testing can be various, for example, 1) triggering through a physical key; 2) triggering when the test equipment is connected with a terminal to be tested; 3) the method is triggered by a virtual key on the test equipment or the equipment to be tested. The above listed triggering manners for testing the terminal control are only exemplary, and those skilled in the art use the technical idea of the present invention, and the triggering manners for testing other terminal controls proposed according to their specific requirements are all within the protection interval of the present invention, which is not exhaustive herein.
And after the terminal control is triggered to test, traversing nodes and edges of a pre-established control interaction interface Graph to obtain all clickable controls as to-be-tested controls. In this embodiment, in order to ensure a fully-automatic traversal of a terminal, an app open source framework is provided to support the embodiment of the present invention, an UIAutomation engine is used for an iOS platform, a selendroid engine is used below 4.0 of an Android platform, and an UIAutomation engine is used above 4.0.
The traversal logic of the embodiment of the invention is as follows: all user interfaces, and even all clickable controls, are traversed. The data structure of the framework is established on the Graph, each Activity of the application is abstracted into a node of the Graph, jump association between each Activity is abstracted into an edge, and the Graph is defined as a direction vector diagram, so that the method is mainly used for realizing navigation, traversal of the Activity is realized through traversal of the edge of the Graph, the Graph in a self-growth mode forms a corresponding node and edge when traversing each clickable, and new nodes and edges can complete recursion and are uniformly managed by the Graph. Before a terminal test, activity in an application, namely, clickables is defined in advance, namely, a terminal clickable control is obtained through a standard W3C protocol, so that a webdriver webpage drive is used mainly through the standard W3C protocol, and the webdriver webpage drive supports an xpath XML path language and obtains all clickable controls of a current page.
Preferably, in order to improve the speed of the terminal test, the terminal test experience is improved. Referring to fig. 8, the traversal module 10 includes: a traversing unit 11 and a filtering unit 12,
the traversal unit 11 is configured to traverse nodes and edges of a pre-established control interaction interface chart data model to obtain all clickable controls;
the filtering unit 12 is configured to filter all clickable controls, filter out controls with a repetition position and a tunable property being yes, and obtain filtered controls as controls to be tested.
In this embodiment, to improve performance, the clickbles is filtered once, removing the duplicate location and focusable as the future control. The "engine" of the traversal implements a simulated user click through clickbles above to go to a different page (Activity and layout) or just change the current page-source.
In this embodiment, by Graph data modeling, a relationship Graph formed by a Graph data model can be used as a dom comparison of results, and full-path traversal can be realized on the basis of obtaining an Activity relationship Graph, so that not only a single path is used to navigate to a target Activity, but also full-path coverage is adopted in the navigation path selection of the target Activity.
The obtaining module 20 is configured to obtain a current context state;
the determining module 30 is configured to determine a return path of the test page based on the context state;
after all class clicking controls are obtained in a traversing mode and used as controls to be tested, or after the clickable controls obtained in the traversing mode are filtered to obtain filtered clickable controls used as controls to be tested, context states are obtained, and a return path of a test page is determined based on the context states.
Specifically, referring to fig. 9, the determining module 30 includes: a judging unit 31 and a determining unit 32,
the judging unit 31 is configured to, after receiving the control click operation, judge whether the click operation jumps to another application through the context state; the method is also used for judging whether to jump to other interactive interfaces if the user jumps to other applications; the method is also used for judging whether to jump to other layouts of the same interactive interface or not through the page markup language and the page source code if the same interactive interface is jumped to other interactive interfaces;
the determining unit 32 is configured to determine a return path of the test page based on the above-mentioned respective jump processes.
In this embodiment, context management: the context judgment condition in the traversal algorithm is variable, the current context state is obtained by adopting reflection and introspection means, and the next operation is determined on the basis of the current context state, so that the detected layout can be finally returned.
Specifically, referring to fig. 10, the judging unit 31 includes: the obtaining subunit 311 is configured to obtain a packet name of a data packet corresponding to the context state, and compare the packet name with a preset packet name through a self-encapsulated debug interface; a processing subunit 312, configured to terminate the application through a process command if the packet name is different from a preset packet name; and a judging subunit 313, configured to, if the packet name is the same as the preset packet name, judge to jump to another application.
Firstly, judging whether clicking jumps to other applications, comparing the names of the current package packages through a self-packaged debugging interface (in an Android system, the debugging interface is an adb interface, and can also be an iOS debugging interface or a debugging interface of a Windows Phone 7 system, and the like), and if the names are different, terminating the applications through a process command; then judging whether to jump to other activities, and if a new activity is found, recording the activity in the Graph; and then judging whether to jump to other layout of the same activity or not through the page markup language layout and the page-source, and determining a return path of the test page based on each jumping process.
The return module 40 is configured to return the test page according to the return path;
the testing module 50 is configured to test the control to be tested on the testing page.
In this embodiment, the page navigation: and (4) an algorithm for navigating to the tested page is needed after the return path is obtained through the depth or breadth traversal of the graph data model diagram.
Specifically, the test module 50 described with reference to fig. 11 includes: a return unit 51 and a test unit 52,
the return unit 51 is configured to return a test page according to the return path; the control interaction interface graph data model is used for generating a control interaction interface graph data model according to the test result;
the testing unit 52 is configured to test the control to be tested currently on the test page.
When the algorithm for navigating to the detected page is realized, the difficulty is how to navigate to a plurality of layout and a certain element of the page to be slid, the click control used for navigation is stored in the edge of Graph in sequence in advance, and when the object needs to be clicked, the data of the edge is deserialized to obtain the control.
In a second embodiment of the terminal control testing apparatus of the present invention, referring to fig. 12, the terminal control testing apparatus further includes a generating module 60,
the obtaining module 20 is further configured to obtain a test result after the test of the control to be tested is completed;
the generating module 60 is configured to generate a test report according to the test result.
After the testing of the to-be-tested control is completed, a testing result is obtained, after all the to-be-tested controls of the terminal are tested, the testing results of all the controls of the terminal are obtained, a testing report is generated according to all the testing results and is locally stored in the testing device or is sent to a third party terminal, and the third party terminal is a terminal in communication connection with the testing device, such as a mobile phone, a pad, a notebook computer and the like, or the testing report and the testing result are displayed on the testing device so that a user at the end of the testing device can visually know the testing result. The test results can be presented in the form of bar charts or graphs.
In the embodiment, the page to be tested is obtained based on the traversal of the nodes and edges of the chart data model established in advance, the context state is obtained to determine the return path of the test page, the test operation on the terminal is completed, and the automatic full-path traversal is realized. The control is automatically traversed to identify the control of the terminal to test the control, and the intelligent degree of terminal testing is improved.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.

Claims (14)

1. A terminal control testing method is characterized in that a terminal control testing device applied to the method is borne on an electronic terminal, and the method comprises the following steps:
traversing nodes and edges of a pre-established control interaction interface chart data model to obtain all clickable controls as to-be-tested controls; the nodes are interactive interfaces in application, and the edges are skip associations between the interactive interfaces; the construction process of the control interactive interface chart data model comprises the following steps: abstracting an interactive interface in the application into a node of the control interactive interface chart data model; abstracting skip association between the interactive interfaces into edges of the control interactive interface chart data model; defining the control interactive interface chart data model as a direction vector diagram for realizing navigation;
the control interactive interface chart data model is a self-growth model, and if a new node and a new edge are found during traversal, the new node and the new edge are unified to the control interactive interface chart data model;
acquiring a current context state, and determining a return path of a test page based on the context state; the context state is obtained by adopting reflection and introspection means, and is used as a basis to determine the next operation, so that the context of the tested layout can be returned;
and returning to a test page according to the return path, and testing the control to be tested on the test page.
2. The method for testing a terminal control as claimed in claim 1, wherein the step of traversing nodes and edges of a pre-established control interactive interface chart data model to obtain all clickable controls as the controls to be tested comprises:
traversing nodes and edges of a pre-established control interaction interface chart data model to obtain all clickable controls;
and filtering all clickable controls, and filtering out controls with repeated positions and focus-adjustable attributes of yes to obtain the filtered controls as the controls to be tested.
3. The terminal control testing method of claim 1, wherein the step of determining a return path for a test page based on the context state comprises:
after receiving a control clicking operation, judging whether the clicking operation jumps to other applications or not through the context state;
if yes, judging whether to jump to other interactive interfaces;
if yes, judging whether to jump to other layouts of the same interactive interface or not through the page markup language and the page source code;
a return path of the test page is determined based on the jump process.
4. The method for testing a terminal control according to claim 3, wherein the step of determining whether the click operation jumps to another application through the context state comprises:
acquiring a packet name of a data packet corresponding to the context state, and comparing the packet name with a preset packet name through a self-packaged debugging interface;
if the application is different, the application is terminated through a process command;
and if the two are the same, judging to jump to other applications.
5. The method for testing a terminal control according to any one of claims 1 to 4, wherein the step of returning to a test page according to the return path and testing the control to be tested on the test page comprises:
returning to a test page according to the return path;
returning the current control to be tested according to the data of the side of the control interactive interface chart data model in the reverse sequence;
and testing the control to be tested at present on the test page.
6. The method for testing a terminal control according to any one of claims 1 to 4, wherein the step of returning to the test page according to the return path and testing the control to be tested by the test page further comprises:
after the test of the control to be tested is finished, obtaining a test result;
and generating a test report according to the test result.
7. The utility model provides a terminal control testing arrangement which characterized in that, terminal control testing arrangement bears in electronic terminal, includes:
the traversal module is used for traversing nodes and edges of a pre-established control interactive interface chart data model to obtain all clickable controls as to-be-tested controls; the nodes are interactive interfaces in application, and the edges are skip associations between the interactive interfaces; the construction process of the control interactive interface chart data model comprises the following steps: abstracting an interactive interface in the application into a node of the control interactive interface chart data model; abstracting skip association between the interactive interfaces into edges of the control interactive interface chart data model; defining the control interactive interface chart data model as a direction vector diagram for realizing navigation;
the control interactive interface chart data model is a self-growth model, and if a new node and a new edge are found during traversal, the new node and the new edge are unified to the control interactive interface chart data model
An obtaining module, configured to obtain a current context state; the context state is obtained by adopting reflection and introspection means, and is used as a basis to determine the next operation, so that the context of the tested layout can be returned;
the determining module is used for determining a return path of the test page based on the context state;
the return module is used for returning the test page according to the return path;
and the testing module is used for testing the control to be tested on the testing page.
8. The terminal control testing apparatus of claim 7, wherein the traverse module comprises:
the traversal unit is used for traversing nodes and edges of a pre-established control interactive interface chart data model to obtain all clickable controls;
and the filtering unit is used for filtering all clickable controls, filtering out the controls with the repeated positions and the adjustable focus attribute being positive, and obtaining the filtered controls as the controls to be tested.
9. The terminal control testing apparatus of claim 7, wherein the determining module comprises:
the judging unit is used for judging whether the clicking operation jumps to other applications or not through the context state after the clicking operation of the control is received; the method is also used for judging whether to jump to other interactive interfaces if the user jumps to other applications; the method is also used for judging whether to jump to other layouts of the same interactive interface or not through the page markup language and the page source code if the same interactive interface is jumped to other interactive interfaces;
and the determining unit is used for determining a return path of the test page based on the jumping process.
10. The terminal control testing apparatus according to claim 9, wherein the judging unit includes:
the acquisition subunit is used for acquiring the packet name of the data packet corresponding to the context state and comparing the packet name with a preset packet name through a self-packaged debugging interface;
the processing subunit is used for terminating the application through a process command if the packet name is different from a preset packet name;
and the judging subunit is used for judging to jump to other applications if the packet name is the same as the preset packet name.
11. The terminal control testing apparatus of any one of claims 7 to 9, wherein the testing module comprises:
the return unit is used for returning the test page according to the return path; the control interaction interface graph data model is used for generating a control interaction interface graph data model according to the test result;
and the testing unit is used for testing the current control to be tested on the testing page.
12. The terminal control testing apparatus according to any one of claims 7 to 9, wherein the terminal control testing apparatus further comprises a generation module,
the acquisition module is also used for acquiring a test result after the test of the control to be tested is finished;
and the generating module is used for generating a test report according to the test result.
13. An electronic device, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, and the at least one instruction, the at least one program, and the at least one program are loaded and executed by the processor to implement the terminal control testing method according to any one of claims 1-6.
14. A computer-readable storage medium, wherein at least one instruction, at least one program, is stored in the storage medium, and the at least one instruction, the at least one program, and the at least one program are loaded and executed by a processor to implement the terminal control testing method according to any one of claims 1-6.
CN201510397199.0A 2015-07-08 2015-07-08 Terminal control testing method and device Active CN106326104B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510397199.0A CN106326104B (en) 2015-07-08 2015-07-08 Terminal control testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510397199.0A CN106326104B (en) 2015-07-08 2015-07-08 Terminal control testing method and device

Publications (2)

Publication Number Publication Date
CN106326104A CN106326104A (en) 2017-01-11
CN106326104B true CN106326104B (en) 2021-03-16

Family

ID=57725550

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510397199.0A Active CN106326104B (en) 2015-07-08 2015-07-08 Terminal control testing method and device

Country Status (1)

Country Link
CN (1) CN106326104B (en)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108664364B (en) * 2017-03-31 2023-05-09 腾讯科技(深圳)有限公司 Terminal testing method and device
CN107341107B (en) * 2017-07-04 2022-04-29 飞天诚信科技股份有限公司 Automatic testing method and testing host for embedded development
CN107562619B (en) * 2017-08-15 2020-03-31 福建天晴数码有限公司 Automatic control traversing method and terminal based on neuron model
CN109558307B (en) * 2017-09-26 2022-03-22 卓望数码技术(深圳)有限公司 Game program testing method and system
CN109634831A (en) * 2017-10-09 2019-04-16 飞狐信息技术(天津)有限公司 A kind of Android application program GUI traverses test method and system automatically
CN108829389A (en) * 2018-03-29 2018-11-16 中南大学 Android application automation triggering execution method based on Appium
CN108681508B (en) * 2018-05-15 2022-04-01 福建天泉教育科技有限公司 Testing method based on visual recognition and terminal
CN109344062A (en) * 2018-09-26 2019-02-15 深圳壹账通智能科技有限公司 The cross-domain method for jumping test of the page and terminal device
CN109739764A (en) * 2018-12-29 2019-05-10 中国联合网络通信集团有限公司 A kind of applied program testing method and device
CN109857668A (en) * 2019-02-03 2019-06-07 苏州市龙测智能科技有限公司 UI automated function test method, test device, test equipment and storage medium
CN110139302B (en) * 2019-05-17 2022-12-06 广州品唯软件有限公司 App business type positioning method and device
CN110888812B (en) * 2019-11-26 2023-11-07 国核自仪系统工程有限公司 Test system and test method for response time of terminal page
CN111240957B (en) * 2019-11-27 2023-09-15 广东电网有限责任公司信息中心 Activity relation graph generation method of Android application
CN111694754B (en) * 2020-07-30 2023-04-07 抖音视界有限公司 Application program testing method and device, electronic equipment and computer medium
CN112180189A (en) * 2020-09-09 2021-01-05 杭州涂鸦信息技术有限公司 Automatic detection method, device and system based on multi-class intelligent module
CN112148608B (en) * 2020-09-24 2021-11-05 上海交通大学 Mobile terminal automated software testing method based on control function labeling
CN114979366B (en) * 2021-02-24 2023-10-13 腾讯科技(深圳)有限公司 Control prompting method, device, terminal and storage medium
CN113986769A (en) * 2021-12-24 2022-01-28 深圳市明源云链互联网科技有限公司 Application testing method, system, device and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019942A (en) * 2012-12-31 2013-04-03 广东欧珀移动通信有限公司 Method and system for automatically testing applications to be tested based on android system
CN104461900A (en) * 2014-12-19 2015-03-25 北京奇虎科技有限公司 User interface testing method, center control server, test terminal and system
CN104598380A (en) * 2015-01-16 2015-05-06 广东欧珀移动通信有限公司 Method and system for automatic testing based on control

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6008202A (en) * 1995-01-23 1999-12-28 University Of Pittsburgh Stable lipid-comprising drug delivery complexes and methods for their production

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019942A (en) * 2012-12-31 2013-04-03 广东欧珀移动通信有限公司 Method and system for automatically testing applications to be tested based on android system
CN104461900A (en) * 2014-12-19 2015-03-25 北京奇虎科技有限公司 User interface testing method, center control server, test terminal and system
CN104598380A (en) * 2015-01-16 2015-05-06 广东欧珀移动通信有限公司 Method and system for automatic testing based on control

Also Published As

Publication number Publication date
CN106326104A (en) 2017-01-11

Similar Documents

Publication Publication Date Title
CN106326104B (en) Terminal control testing method and device
US9342237B2 (en) Automated testing of gesture-based applications
CN107291438B (en) Automatic script generation method and device and electronic equipment
US9720799B1 (en) Validating applications using object level hierarchy analysis
CN108345543B (en) Data processing method, device, equipment and storage medium
US9003235B2 (en) Indicating coverage of web application testing
CN106874174B (en) Method and device for realizing interface test and function test
CN107688529B (en) Component debugging method and device
CN107608901B (en) Jmeter-based testing method and device, storage medium and electronic equipment
CN111428166A (en) Page configuration method, page element replacement method, device, equipment and medium
CN106294372A (en) Application program page quick access method and apply its mobile terminal
CN111177617A (en) Web direct operation and maintenance method and device based on operation and maintenance management system and electronic equipment
CN109873735B (en) Performance test method and device for H5 page and computer equipment
US8918762B2 (en) Generating test plans and test cases from service-oriented architecture and process models
CN107368420A (en) API method of testings, device and electronic equipment
WO2017066125A1 (en) Test simulation for software defined networking environments
CN110147327B (en) Multi-granularity-based web automatic test management method
CN108197024B (en) Embedded browser debugging method, debugging terminal and computer readable storage medium
CN110659198A (en) Application program test case execution method and device and software test system
CN111367812A (en) Test method, electronic device and readable storage medium
CN111736951A (en) Simulation method for automatic driving, computer device, and storage medium
CN107102937B (en) User interface testing method and device
US9449527B2 (en) Break-fix simulator
CN104796929B (en) Network debugging method and device
CN112416734A (en) Test method, device and 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