CN107967207B - Method and device for testing user interface interaction function - Google Patents

Method and device for testing user interface interaction function Download PDF

Info

Publication number
CN107967207B
CN107967207B CN201610914978.8A CN201610914978A CN107967207B CN 107967207 B CN107967207 B CN 107967207B CN 201610914978 A CN201610914978 A CN 201610914978A CN 107967207 B CN107967207 B CN 107967207B
Authority
CN
China
Prior art keywords
test case
test
case object
interaction component
interaction
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
CN201610914978.8A
Other languages
Chinese (zh)
Other versions
CN107967207A (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 Beijing Co Ltd
Original Assignee
Tencent Technology Beijing 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 Beijing Co Ltd filed Critical Tencent Technology Beijing Co Ltd
Priority to CN201610914978.8A priority Critical patent/CN107967207B/en
Publication of CN107967207A publication Critical patent/CN107967207A/en
Application granted granted Critical
Publication of CN107967207B publication Critical patent/CN107967207B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The application discloses a method and a device for testing a user interface UI interaction function. The method comprises the following steps: the method comprises the steps that a set of test case objects is built for an application program, wherein each test case object is transmitted into an application program programming interface to start a UI interaction component corresponding to the test case object in the application program, and the UI interaction component is used for displaying a corresponding UI; when the test is performed, the following processing is performed: selecting a test case object from the test case object set, and starting a UI interaction component corresponding to the selected test case object by transmitting the selected test case object into an application programming interface so as to display a UI corresponding to the UI interaction component; obtaining an execution result of an operation on at least one control in the UI; and determining a test result according to the execution result. By utilizing the technical scheme, the test coverage rate and efficiency can be improved.

Description

Method and device for testing user interface interaction function
Technical Field
The invention relates to the technical field of computer testing, in particular to a method and a device for testing a user interface interaction function.
Background
For an application under development, a stress test (also called a stability test) is usually performed to test the operation stability and robustness. In performing automated testing, a pseudorandom stream of user events (e.g., key inputs, touch inputs, gesture inputs, etc.) is typically sent to the system to implement stress testing of the application under development.
Disclosure of Invention
The embodiment of the invention provides a method for testing a user interface UI interactive function, which aims to improve the test coverage rate and efficiency. The method comprises the following steps:
the method comprises the steps that a set of test case objects is built for an application program, wherein each test case object is transmitted into an application program programming interface to start a UI interaction component corresponding to the test case object in the application program, and the UI interaction component is used for displaying a corresponding UI;
when the test is performed, the following processing is performed:
selecting a test case object from the test case object set, and starting a UI interaction component corresponding to the selected test case object by transmitting the selected test case object into an application programming interface so as to display a UI corresponding to the UI interaction component;
obtaining an execution result of an operation on at least one control in the UI;
and determining a test result according to the execution result.
The embodiment of the invention provides a device for testing a user interface UI interaction function, which aims to improve the test coverage rate. The method comprises the following steps:
the system comprises a construction module, a test case object acquisition module and a test case display module, wherein the construction module is used for constructing a set of test case objects aiming at an application program, each test case object is transmitted into an application program programming interface to start a UI interaction component corresponding to the test case object in the application program, and the UI interaction component is used for displaying a corresponding UI;
the test module is used for executing the following processing when testing is carried out: selecting a test case object from the test case object set, and starting a UI interaction component corresponding to the selected test case object by transmitting the selected test case object into an application programming interface so as to display a UI corresponding to the UI interaction component; obtaining an execution result of an operation on at least one control in the UI; and determining a test result according to the execution result.
By adopting the technical scheme, the test case object is selected from the test case object set to start the UI interaction component corresponding to the selected test case object so as to display the UI corresponding to the UI interaction component, so that the test coverage rate and the test efficiency are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a schematic diagram of an implementation environment in accordance with an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for testing UI interaction function according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for configuring a test of UI interaction function according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a test configuration user interface in an embodiment of the present invention;
FIG. 5 is a flowchart illustrating a method for constructing a set of test case objects according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating a method for constructing a set of test case objects according to an embodiment of the present invention;
FIG. 7 is a flowchart illustrating a method for testing UI interaction function according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a device for testing UI interaction functions according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a device for testing UI interaction functions according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The inventor of the present invention finds, in a research process, that, during a test, after a certain UI interaction component is randomly started to display a UI (for example, an activity in an Android operating system) corresponding to the UI interaction component, a control is randomly operated in the UI interface, the UI interaction component corresponding to the control is started to display a corresponding next-level UI, the control is randomly operated in the next-level UI, the UI interaction component corresponding to the control in the next-level UI is started to display a corresponding next-level UI, and the test is continued in the next-level UI. Thus, the stress test is "stuck" on the initially launched UI interaction component, and it is difficult to jump out of the UI interaction component and its associated subordinate UI interaction components and jump to UI interaction components on other branches.
In view of this, the embodiment of the present invention provides a method and an apparatus for testing a UI interaction function. Fig. 1 is a schematic diagram of an implementation environment according to an embodiment of the invention. Referring to fig. 1, the implementation environment includes a test server 110 and a terminal device 120.
The test server 110 may be a server, a server cluster composed of several servers, or a cloud computing service center.
The terminal device 120 may be a terminal device having a data calculation processing function, including but not limited to a Smart phone (with a communication module installed), a palm computer, a tablet computer, a Smart television (Smart TV), and the like. These communication terminals are all installed with an operating system, including but not limited to: the Android operating system, the Symbian operating system, the Windows mobile operating system, and the apple iPhone OS operating system, among others. In this embodiment, the terminal device 120 is installed with a test application 121 and an application program 122, where the test application 121 obtains a test instruction and test configuration information from the test server, performs test configuration on the application program 120 and tests the application program, and then reports a test result to the test server 110.
In one embodiment, the terminal device 120 has an Android operating system installed thereon. The Android operating system application 122 contains User Interface (UI) interaction components, for example, Activity is a component of the application responsible for interacting with a user, providing a visual user interface for the application. In the Android operating system, it is usually necessary to initiate the UI interaction component and transfer data by means of an Intent (Intent) object, which is the carrier of communication between different components within an application. For example, when an activity is initiated, the Intent object contains the information needed to initiate the activity, such as Action (Action) and component type (Category) attributes. In this way, the component that sends the Intent object jointly screens the determined one or more activities by the action attribute and the type attribute and initiates.
Fig. 2 is an exemplary flowchart of a method for testing UI interaction function according to an embodiment of the present invention. As shown in fig. 2, the method may include the steps of:
step 201: and constructing a set of test case objects aiming at the application program.
And each test case object is transmitted into an application programming interface to start a UI interaction component corresponding to the test case object in the application, wherein the UI interaction component is used for displaying a corresponding UI.
Step 202: when the test is performed, the following processing is performed: selecting a test case object from the test case object set, and starting a UI interaction component corresponding to the selected test case object by transmitting the selected test case object into an application programming interface so as to display a UI corresponding to the UI interaction component; obtaining an execution result of an operation on at least one control in the UI; and determining a test result according to the execution result.
In one embodiment, when performing testing, a test configuration instruction is received from a test server, the test configuration instruction instructing that a specified UI interaction component in the application program be tested. Selecting a test case object from the test case object set, including: and selecting the test case object corresponding to the specified UI interaction component from the test case object set according to the test configuration instruction.
In one embodiment, after a UI interaction component corresponding to a selected test case object is started, a timer is started according to a preset timer duration; and when the timer is overtime, judging whether the UI corresponding to the UI interaction component is displayed currently, if not, selecting the test case object corresponding to the UI interaction component from the test case object set, starting the UI interaction component corresponding to the test case object, obtaining an execution result of the operation of at least one control in the UI, and determining the test result according to the execution result.
In one embodiment, the selecting a test case object from the set of test case objects includes: and periodically selecting a test case object from the test case object set according to a preset test period.
In one embodiment, when testing, in response to a test operation for the application program, generating a test case object corresponding to the test operation; the generated test case object is transmitted into the application programming interface, and a second UI interaction component corresponding to the generated test case object is started to display a second UI corresponding to the second UI interaction component; obtaining a second execution result of the operation on the at least one control in the second UI; and determining a second test result according to the second execution result.
In one embodiment, the constructing the set of test case objects includes: and responding to UI interactive operation, generating a test case object corresponding to the UI interactive component which can be started by the UI interactive operation, and adding the generated test case object to the test case object set.
In one embodiment, the constructing the set of test case objects includes: responding to UI interactive operation, generating a test case object corresponding to a UI interactive component which can be started by the UI interactive operation, adding the generated test case object into the set of the test case objects, and inserting the test case object into a queue; judging whether the queue is empty or not, if not, taking out a test case object from the queue, and starting a UI interaction component corresponding to the taken out test case object to display a UI corresponding to the UI interaction component by transmitting the taken out test case object to the application programming interface; for each control contained in the displayed UI, responding to the UI operation of the control, generating a test case object of a sub-UI interaction component corresponding to the control, adding the generated test case object into the test case object set, and inserting the generated test case object into a queue; and returning to execute the processing of judging whether the queue is empty or not.
In one embodiment, after a set of test case objects is constructed, the test case objects in the set of test case objects are sent to a test server, so that the test server forwards the test case objects to another terminal device.
In one embodiment, the constructing the set of test case objects includes: and receiving the test case object from the test server and adding the test case object to the collection of the test case objects.
Fig. 3 is an exemplary flowchart of a method for configuring a test of UI interaction function according to an embodiment of the present invention. As shown in fig. 3, the method comprises the steps of:
step 301: in response to the test configuration operation, the test server generates a test configuration message and sends it to the specified terminal device.
As shown in fig. 4, in the test configuration user interface, a tester may select a test application, a tested application installation package, and a test device. By selecting "test application", the application to be tested can be determined, wherein the test application is the application to be tested, and may include Tencent sports (Android operating system), Tencent sports (IOS operating system), Tencent news (Android operating system), Tencent news (IOS operating system), and the like. The test application is a test tool, and the test application used in the test can be determined by selecting the test application, where the test application may include an application stability test application (e.g., Android Monkey (Monkey) tool, Google Monkey tool, Robotium Monkey tool). By selecting the installation package of the application program to be tested, the version installation package corresponding to the application program to be tested can be determined. For example, when the tested application is selected as Tencent sports (Android operating system), the installation package of Tencent sports version 4.2.1 may be determined. By selecting the test equipment, the terminal equipment participating in the test can be determined.
Further, as shown in FIG. 4, in the test configuration user interface, the tester may select a test UI interaction component from the UI interaction component list. By selecting a test UI interaction component, the UI interaction component of the test may be determined, for example, with respect to an activity (abuttactivity), an assistance activity (AssistActivity), a channel preview activity (ChannelPreViewActivity), a channel search activity (ChannelSearchActivity), and the like.
Aiming at each selected tested terminal device, the test configuration message carries a test application identifier; and if the terminal equipment is determined to be provided with the tested application program installation package, carrying the tested application program installation package identification in the test configuration message, otherwise, carrying the tested application program installation package in the test configuration message. Further, if the UI interaction component is also selected, the test configuration message also needs to carry a test UI interaction component identifier.
Step 302: and the terminal equipment receives the test configuration message and executes the test configuration.
And if the test configuration message carries the installation package of the application program to be tested, the terminal equipment installs the application program to be tested through the installation package. And starting the test application according to the test application identifier carried in the test configuration message. And if the configuration message carries the UI interactive component identifier to be tested, forwarding the UI interactive component identifier to the test application.
Step 303: and the terminal equipment starts the application program to be tested and tests the application program through the test application.
FIG. 5 is an exemplary flowchart of a method for building a set of test case objects according to an embodiment of the present invention. In this embodiment, the UI interaction component is, for example, an Activity (Activity) in the application under test, the test case object is, for example, an Intent object corresponding to the Activity, and the set of test case objects is an Intent object set. In this embodiment, the method may be triggered and executed by receiving a command for constructing a test case object set from a test server, or may be periodically executed to construct a test case object set, or triggered and executed in other manners, which is not limited in the present invention. As shown in fig. 5, the method includes the steps of:
step 501: and starting the application program, acquiring an Intent object corresponding to a main activity (MainActivity), adding the generated Intent object into the collection of the test case objects, and inserting the generated Intent object into the queue.
The master activity is a default master page when the Android project of the application is created, for example, a buddy list page in a WeChat application.
Step 502: it is determined whether the queue is empty.
If so, execution ends. If not, step 503 is performed.
Step 503: and taking out an Intent object from the queue, starting the corresponding activity of the Intent object by transferring the taken-out Intent object into the application programming interface, and displaying the UI corresponding to the activity.
Step 504: and executing click operation aiming at each control on the displayed UI, if the user jumps to another activity in response to the click operation, acquiring an Intent object corresponding to the jumped activity, adding the Intent object to an Intent object set, inserting the Intent object into a queue, and returning to the step 502.
The Intent objects stored in the Intent object set can be identified through information such as terminal equipment model and activity name. For example, an Intent object may be identified as Home _ Intent _ AssistActivity, Home _ Intent _ AdLandingPaginActivities, Home _ Intent _ Association matchActivities, Home _ Intent _ BbsCicleDetailActivities, and the like.
According to the construction method of the breadth traversal, the constructed Intent object set comprises Intent objects corresponding to all activities in the application program, so that the constructed Intent object set is comprehensive and complete.
FIG. 6 is an exemplary flowchart of a method for building a set of test case objects according to an embodiment of the present invention. As shown in fig. 6, the UI interaction component is, for example, an Activity (Activity) in the application under test, the test case object is, for example, an Intent object corresponding to the Activity, and the set of test case objects is an Intent object set, and the method includes the following steps:
step 601: the first terminal equipment sends at least one Intent object in the local Intent object set to the test server.
Step 602: the test server receives at least one Intent object from the first terminal device and stores it in a database.
Step 603: the test server obtains at least one Intent object applicable to the second terminal device from the database.
Step 604: and the test server sends at least one Intent object suitable for the second terminal equipment to the second terminal equipment.
Step 605: the second terminal device receives at least one Intent object from the test server and adds it to the local Intent object set.
In the above method, the steps 601-602 and the steps 603-604 may be performed sequentially or simultaneously, which is not limited in the present invention.
Fig. 7 is an exemplary flowchart of a method for testing UI interaction function according to an embodiment of the present invention. As shown in fig. 7, the UI interaction component is, for example, an Activity (Activity) in the application under test, the test case object is, for example, an Intent object corresponding to the Activity, and the set of test case objects is an Intent object set, and the method applied to the terminal device may include the following steps:
step 701: receiving a test configuration instruction from a test server, wherein the test instruction instructs to test specified tested activities in the application program;
step 702: and selecting an Intent object corresponding to the specified activity from the Intent object set.
Step 703: and starting the selected activity to display the UI corresponding to the activity by transmitting the selected Intent object into an application programming interface, and starting a timer according to the preset timer duration.
Step 704: and obtaining an execution result of the operation of at least one control in the UI, and determining a test result according to the execution result.
Step 705: and when the timer is overtime, judging whether the UI corresponding to the specified activity is displayed currently, if not, selecting the Intent object corresponding to the specified activity from the Intent object set, restarting the specified activity corresponding to the Intent object, obtaining an execution result of the operation of at least one control in the UI, and determining a test result according to the execution result.
In one embodiment, whether the identifier of the activity corresponding to the currently presented UI is the identifier of the specified activity may be determined, and if so, it may be determined that the UI corresponding to the specified activity is currently presented.
According to the method, when the test is carried out, whether the specified activity is currently tested or not is detected in each period, so that the test efficiency of the specific activity is improved. In one embodiment, the Tencent sports version 4.0 application is tested separately using the method described above. In the pressure test for the same long time, 3 leaks (bugs) are found in the test which does not adopt the method, and 7 leaks are found in the test which adopts the method; in the memory leakage test of the same long time, 1 bug is found in the test which does not adopt the method, and 3 bugs are found in the test which adopts the method. Therefore, the method can greatly improve the testing efficiency.
The following are embodiments of the apparatus of the present invention that may be used to perform corresponding method embodiments of the present invention. For details which are not disclosed in the embodiments of the apparatus of the present invention, reference is made to the description of the embodiments of the method of the present invention.
Fig. 8 is a schematic structural diagram of a device for testing UI interaction functions according to an embodiment of the present invention. As shown in fig. 8, the apparatus 800 includes: a building module 801 and a testing module 802. Wherein the content of the first and second substances,
the building module 801 is configured to build a set of test case objects for an application program, where each test case object is transferred into an application programming interface to start a UI interaction component corresponding to the test case object in the application program, where the UI interaction component is used to display a corresponding UI;
the test module 802 is configured to perform the following processes when performing a test: selecting a test case object from the test case object set, and starting a UI interaction component corresponding to the selected test case object by transmitting the selected test case object into an application programming interface so as to display a UI corresponding to the UI interaction component; obtaining an execution result of an operation on at least one control in the UI; and determining a test result according to the execution result.
In one embodiment, the testing module 802 is further configured to receive a test configuration instruction from a test server when performing a test, where the test configuration instruction instructs to test a specified UI interaction component in the application;
the test module 802 is configured to select a test case object corresponding to the specified UI interaction component from the test case object set according to the test configuration instruction.
In an embodiment, the test module 802 is further configured to start a timer according to a preset timer duration after starting the UI interaction component corresponding to the selected test case object; and when the timer is overtime, judging whether the UI corresponding to the UI interaction component is displayed currently, if not, selecting the test case object corresponding to the UI interaction component from the test case object set, starting the UI interaction component corresponding to the test case object, obtaining an execution result of the operation of at least one control in the UI, and determining the test result according to the execution result.
In an embodiment, the test module 802 is configured to periodically select a test case object from the test case object set according to a preset test period.
In one embodiment, the test module 802 is further configured to, when performing a test, generate a test case object corresponding to a test operation for the application program in response to the test operation; the generated test case object is transmitted into the application programming interface, and a second UI interaction component corresponding to the generated test case object is started to display a second UI corresponding to the second UI interaction component; obtaining a second execution result of the operation on the at least one control in the second UI; and determining a second test result according to the second execution result.
In an embodiment, the building module 801 is configured to generate a test case object corresponding to a UI interaction component that can be started by a UI interaction operation in response to the UI interaction operation, and add the generated test case object to the test case object set.
In one embodiment, the building module 801 is configured to generate, in response to a UI interaction operation, a test case object corresponding to a UI interaction component that can be started by the UI interaction operation, add the generated test case object to the set of test case objects, and insert the generated test case object into a queue; judging whether the queue is empty or not, if not, taking out a test case object from the queue, and starting a UI interaction component corresponding to the taken out test case object to display a UI corresponding to the UI interaction component by transmitting the taken out test case object to the application programming interface; for each control contained in the displayed UI, responding to the UI operation of the control, generating a test case object of a sub-UI interaction component corresponding to the control, adding the generated test case object into the test case object set, and inserting the generated test case object into a queue; and returning to execute the processing of judging whether the queue is empty or not.
In one embodiment, the apparatus 800 further comprises: the reporting module 803 is configured to, after constructing a set of test case objects, send the test case objects in the set of test case objects to a test server, so that the test server forwards the test case objects to another terminal device.
In one embodiment, the building module 801 is configured to receive a test case object from a test server and add it to the collection of test case objects.
Fig. 9 is a schematic structural diagram of a device for testing UI interaction functions according to an embodiment of the present invention. As shown in fig. 9, the apparatus includes: a processor 901, non-volatile computer-readable memory 902, a display unit 903, a network communication interface 904. These components communicate over a bus 905.
In this embodiment, a plurality of program modules are stored in the memory 902, including an operating system 906, a network communication module 907, and an application program 908.
The processor 901 can read various modules (not shown in the figure) included in the application program in the memory 902 to execute various functional applications of the apparatus and data processing. The processor 501 in this embodiment may be one or multiple processors, and may be a CPU, a processing unit/module, an ASIC, a logic module, a programmable gate array, or the like.
The application programs 908 may include: a test module 909 for UI interaction functions. The test module 909 of the UI interaction function may include a set of computer executable instructions 909-1 and corresponding metadata and heuristics 909-2 formed by the various functional modules in the device shown in fig. 8. These sets of computer-executable instructions may be executed by the processor 901 and perform the methods shown in fig. 2-7 or the functions of the apparatus shown in fig. 8.
In this embodiment, the network communication interface 904 cooperates with the network communication module 907 to complete the transceiving of various network signals of the information interaction device.
The display unit 903 has a display panel, such as a liquid crystal display, for inputting and displaying related information.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each module may exist alone physically, or two or more modules are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. The functional modules of the embodiments may be located in one terminal or network node, or may be distributed over a plurality of terminals or network nodes.
In addition, each of the embodiments of the present invention can be realized by a data processing program executed by a data processing apparatus such as a computer. It is clear that the data processing program constitutes the invention. Further, the data processing program, which is generally stored in one storage medium, is executed by directly reading the program out of the storage medium or by installing or copying the program into a storage device (such as a hard disk and/or a memory) of the data processing device. Such a storage medium therefore also constitutes the present invention. The storage medium may use any type of recording means, such as a paper storage medium (e.g., paper tape, etc.), a magnetic storage medium (e.g., a flexible disk, a hard disk, a flash memory, etc.), an optical storage medium (e.g., a CD-ROM, etc.), a magneto-optical storage medium (e.g., an MO, etc.), and the like.
The invention therefore also provides a storage medium in which a data processing program is stored which is designed to carry out any one of the embodiments of the method according to the invention described above.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (17)

1. A method for testing UI interaction functions of a user interface is characterized by comprising the following steps:
the method comprises the steps that a set of test case objects is built for an application program, wherein each test case object is transmitted into an application program programming interface to start a UI interaction component corresponding to the test case object in the application program, the UI interaction component is used for displaying a corresponding UI, the set of test case objects comprises an Intent object set, and the UI interaction component comprises activities corresponding to the transmitted test case objects in the application program;
when the test is performed, the following processing is performed:
selecting a test case object from the test case object set, starting a UI interaction component corresponding to the selected test case object by transmitting the selected test case object into an application programming interface to display a UI corresponding to the UI interaction component, wherein the selecting of a test case object from the test case object set comprises: according to a preset test period, periodically selecting a test case object from the test case object set;
obtaining an execution result of an operation on at least one control in the UI;
and determining a test result according to the execution result.
2. The method of claim 1, when performing the test, further comprising:
receiving a test configuration instruction from a test server, wherein the test configuration instruction indicates that a specified UI interaction component in the application program is tested;
selecting a test case object from the test case object set, including:
and selecting the test case object corresponding to the specified UI interaction component from the test case object set according to the test configuration instruction.
3. The method of claim 1 or 2, after launching the UI interaction component corresponding to the selected test case object, further comprising:
starting a timer according to the preset time length of the timer;
and when the timer is overtime, judging whether the UI corresponding to the UI interaction component is displayed currently, if not, selecting the test case object corresponding to the UI interaction component from the test case object set, starting the UI interaction component corresponding to the test case object, obtaining an execution result of the operation of at least one control in the UI, and determining the test result according to the execution result.
4. The method of claim 1, when performing the test, further comprising:
responding to the test operation aiming at the application program, and generating a test case object corresponding to the test operation;
the generated test case object is transmitted into the application programming interface, and a second UI interaction component corresponding to the generated test case object is started to display a second UI corresponding to the second UI interaction component;
obtaining a second execution result of the operation on the at least one control in the second UI; and determining a second test result according to the second execution result.
5. The method of claim 1, wherein constructing the set of test case objects comprises:
and responding to UI interactive operation, generating a test case object corresponding to the UI interactive component which can be started by the UI interactive operation, and adding the generated test case object to the test case object set.
6. The method of claim 1, wherein constructing the set of test case objects comprises:
responding to UI interactive operation, generating a test case object corresponding to a UI interactive component which can be started by the UI interactive operation, adding the generated test case object into the set of the test case objects, and inserting the test case object into a queue;
judging whether the queue is empty or not, if not, taking out a test case object from the queue, and starting a UI interaction component corresponding to the taken out test case object to display a UI corresponding to the UI interaction component by transmitting the taken out test case object to the application programming interface; for each control contained in the displayed UI, responding to the UI operation of the control, generating a test case object of a sub-UI interaction component corresponding to the control, adding the generated test case object into the test case object set, and inserting the generated test case object into a queue; and returning to execute the processing of judging whether the queue is empty or not.
7. The method of claim 5 or 6, after constructing the set of test case objects, further comprising:
and sending the test case object in the test case object set to a test server so that the test server forwards the test case object to another terminal device.
8. The method of claim 1, wherein constructing the set of test case objects comprises:
and receiving the test case object from the test server and adding the test case object to the collection of the test case objects.
9. An apparatus for testing User Interface (UI) interaction functions, the apparatus comprising:
the system comprises a construction module, a test case object acquisition module and a test case analysis module, wherein the construction module is used for constructing a set of test case objects aiming at an application program, each test case object is transmitted into an application program programming interface to start a UI interaction component corresponding to the test case object in the application program, the UI interaction component is used for displaying a corresponding UI, the set of test case objects comprises an Intent object set, and the UI interaction component comprises activities corresponding to the transmitted test case objects in the application program;
the test module is used for executing the following processing when testing is carried out: selecting a test case object from the test case object set, and starting a UI interaction component corresponding to the selected test case object by transmitting the selected test case object into an application programming interface so as to display a UI corresponding to the UI interaction component; the test module is used for periodically selecting a test case object from the test case object set according to a preset test period; obtaining an execution result of an operation on at least one control in the UI; and determining a test result according to the execution result.
10. The apparatus of claim 9, wherein the testing module is further configured to receive a test configuration instruction from a test server when performing the test, the test configuration instruction instructing to test a specified UI interaction component in the application;
the test module is used for selecting the test case object corresponding to the specified UI interaction component from the test case object set according to the test configuration instruction.
11. The apparatus according to claim 9 or 10, wherein the test module is further configured to start a timer according to a preset timer duration after starting the UI interaction component corresponding to the selected test case object; and when the timer is overtime, judging whether the UI corresponding to the UI interaction component is displayed currently, if not, selecting the test case object corresponding to the UI interaction component from the test case object set, starting the UI interaction component corresponding to the test case object, obtaining an execution result of the operation of at least one control in the UI, and determining the test result according to the execution result.
12. The apparatus of claim 9, wherein the testing module is further configured to generate a test case object corresponding to the test operation in response to the test operation for the application program when performing the test; the generated test case object is transmitted into the application programming interface, and a second UI interaction component corresponding to the generated test case object is started to display a second UI corresponding to the second UI interaction component; obtaining a second execution result of the operation on the at least one control in the second UI; and determining a second test result according to the second execution result.
13. The apparatus according to claim 9, wherein the building module is configured to generate, in response to a UI interaction operation, a test case object corresponding to a UI interaction component that can be started by the UI interaction operation, and add the generated test case object to the test case object set.
14. The apparatus according to claim 9, wherein the building module is configured to generate, in response to a UI interaction operation, a test case object corresponding to a UI interaction component that can be started by the UI interaction operation, add the generated test case object to the set of test case objects, and insert the generated test case object into a queue; judging whether the queue is empty or not, if not, taking out a test case object from the queue, and starting a UI interaction component corresponding to the taken out test case object to display a UI corresponding to the UI interaction component by transmitting the taken out test case object to the application programming interface; for each control contained in the displayed UI, responding to the UI operation of the control, generating a test case object of a sub-UI interaction component corresponding to the control, adding the generated test case object into the test case object set, and inserting the generated test case object into a queue; and returning to execute the processing of judging whether the queue is empty or not.
15. The apparatus of claim 13 or 14, further comprising:
and the reporting module is used for sending the test case objects in the test case object set to a test server after the set of the test case objects is established so that the test server can forward the test case objects to another terminal device.
16. The apparatus of claim 9, wherein the build module is configured to receive a test case object from a test server and add it to the collection of test case objects.
17. A storage medium, in which a computer program is stored, which is loaded and executed by a processor to implement a method of testing user interface, UI, interaction functionality according to any of claims 1 to 8.
CN201610914978.8A 2016-10-20 2016-10-20 Method and device for testing user interface interaction function Active CN107967207B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610914978.8A CN107967207B (en) 2016-10-20 2016-10-20 Method and device for testing user interface interaction function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610914978.8A CN107967207B (en) 2016-10-20 2016-10-20 Method and device for testing user interface interaction function

Publications (2)

Publication Number Publication Date
CN107967207A CN107967207A (en) 2018-04-27
CN107967207B true CN107967207B (en) 2020-08-18

Family

ID=61997263

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610914978.8A Active CN107967207B (en) 2016-10-20 2016-10-20 Method and device for testing user interface interaction function

Country Status (1)

Country Link
CN (1) CN107967207B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109240928A (en) * 2018-09-13 2019-01-18 广东小天才科技有限公司 A kind of test method, device, equipment and storage medium
CN109976988A (en) * 2019-03-15 2019-07-05 山东云缦智能科技有限公司 A kind of method and device of dynamic configuration graphical interface
CN110046101B (en) * 2019-04-15 2022-08-19 腾讯音乐娱乐科技(深圳)有限公司 Page automatic testing method and device and computer storage medium
CN112131136B (en) * 2020-11-24 2021-02-23 智道网联科技(北京)有限公司 Automatic interactive testing method and device
CN113933581B (en) * 2021-12-17 2022-05-13 荣耀终端有限公司 Power consumption testing method of mobile equipment and mobile equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7917895B2 (en) * 2001-07-27 2011-03-29 Smartesoft, Inc. Automated software testing and validation system
CN103309802A (en) * 2012-03-16 2013-09-18 百度在线网络技术(北京)有限公司 Method and device for testing system stability in mobile terminal
CN104216828A (en) * 2013-06-03 2014-12-17 刘伟 Testing method for performing function traversal on tested application program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7917895B2 (en) * 2001-07-27 2011-03-29 Smartesoft, Inc. Automated software testing and validation system
CN103309802A (en) * 2012-03-16 2013-09-18 百度在线网络技术(北京)有限公司 Method and device for testing system stability in mobile terminal
CN104216828A (en) * 2013-06-03 2014-12-17 刘伟 Testing method for performing function traversal on tested application program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
android Instrumentation;雪秀;《https://blog.csdn.net/crystal_ooo/article/details/17420167》;20131219;第1-4页 *

Also Published As

Publication number Publication date
CN107967207A (en) 2018-04-27

Similar Documents

Publication Publication Date Title
CN107967207B (en) Method and device for testing user interface interaction function
US20190227917A1 (en) Adaptive system for mobile device testing
CN108804302B (en) Remote testing method, system and related equipment
CN106598835B (en) Application testing method, device and system
WO2016095554A1 (en) Test method, device and system for application
US20130074051A1 (en) Tracking and analysis of usage of a software product
WO2015192608A1 (en) Method for updating app in android system, terminal and storage medium
CN104598380A (en) Method and system for automatic testing based on control
CN105335283A (en) Application testing method and device in terminal equipment
US10404568B2 (en) Agent manager for distributed transaction monitoring system
KR101748833B1 (en) Software failure locating method, apparatus and equipment
US9489190B1 (en) Message processing engine
CN110716853A (en) Test script recording method, application program testing method and related device
US20160216929A1 (en) Processing application interface
CN111767208A (en) Automatic test method and device
CN108132832B (en) Application program starting method and device
CN111666199B (en) Debugging method executed on intelligent terminal and software debugger
CN106549795B (en) System for monitoring a plurality of distributed devices
CN113709243A (en) Equipment remote control method and device, electronic equipment and storage medium
CN104182266A (en) Application installation method and device
CN106933449B (en) Icon processing method and device
CN111722850A (en) Method, device and system for processing application among multiple systems
CN111382038B (en) Method, device, electronic equipment and storage medium for reporting service data
RU2013146656A (en) METHOD AND SYSTEM OF SIMULTANEOUS INSTALLATION OF MULTIPLE APPLICATIONS USING THE RESTORATION OF A FALSE BACKUP ARCHIVE
CN111124627B (en) Method and device for determining call initiator of application program, terminal 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