Test method and device, electronic equipment, readable storage medium and product

By obtaining and analyzing the interface layout and status parameters of the application, optimizing the test process, excluding triggered objects, and selecting untriggered objects for testing, the problem of low testing efficiency in the existing technology is solved, and more efficient automated testing is achieved.

CN118689754APending Publication Date: 2024-09-24GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310291280.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-22
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

In the existing technology, the testing efficiency of interactive objects in applications is low, especially in applications with rapid iteration and complex business characteristics. Testers need to manually write test cases and rely on external input of customized information, resulting in low testing efficiency.

Method used

Propose a testing method that obtains the first interface of the application, determines the target layout parameters and status parameters, excludes interactive objects that have been triggered, selects untriggered interactive objects for testing, and optimizes the test process by using historical layout tables and status parameters. Avoid repeated triggering.

Benefits of technology

It improves testing efficiency, avoids repeated triggering of already triggered interactive objects, enhances test automation and efficiency, and is suitable for complex and rapidly iterative applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118689754A
    Figure CN118689754A
Patent Text Reader

Abstract

The invention discloses a test method and device, electronic equipment, a readable storage medium and a product, the method is applied to the electronic equipment, and the method comprises the following steps: obtaining a first interface of a to-be-tested application program of a current round; determining a target layout parameter of the first interface; based on the target layout parameters and a historical layout table, state parameters of the target layout parameters are determined, the historical layout table comprises historical layout parameters before the current round and historical state parameters corresponding to the historical layout parameters, and the state parameters are used for representing triggered interaction objects which have been triggered; based on the state parameters, determining at least one interaction object except the triggered interaction object in the interaction objects of the first interface as a target interaction object; and triggering the target interaction object to complete the test of the current round of the electronic equipment. In the embodiment provided by the invention, when the target interaction object is determined, the triggering interaction object which has been triggered previously is considered, so that the test efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automation technology, and more specifically, to a testing method, device, electronic device, readable storage medium and product. Background Art

[0002] At present, with the development of electronic information technology, more and more applications can be run on electronic devices. Although each interactive object in the application can be tested, the existing test efficiency of the interactive objects in the application is low. Summary of the invention

[0003] The present application proposes a testing method, device, electronic device, readable storage medium and product.

[0004] In a first aspect, an embodiment of the present application provides a testing method, which is applied to an electronic device, and the method includes: obtaining a first interface of an application to be tested in a current round; determining target layout parameters of the first interface; determining state parameters of the target layout parameters based on the target layout parameters and a historical layout table, wherein the historical layout table includes historical layout parameters before the current round and historical state parameters corresponding to the historical layout parameters, and the state parameters include triggered interactive objects used to characterize those that have been triggered; based on the state parameters, determining at least one interactive object other than the triggered interactive object among the interactive objects of the first interface as a target interactive object; triggering the target interactive object to complete the current round of testing of the electronic device.

[0005] In the second aspect, the embodiment of the present application also provides a test device, which is applied to an electronic device, and the device includes: an acquisition unit, a first determination unit, a second determination unit, and a third determination unit. Among them, the acquisition unit is used to acquire the first interface of the application to be tested in the current round; the first determination unit is used to determine the target layout parameters of the first interface; the second determination unit is used to determine the state parameters of the target layout parameters based on the target layout parameters and the historical layout table, wherein the historical layout table includes the historical layout parameters before the current round and the historical state parameters corresponding to the historical layout parameters, and the state parameters include the triggered interactive objects used to characterize the triggered ones; the third determination unit is used to determine at least one interactive object other than the triggered interactive object in the interactive objects of the first interface based on the state parameters as the target interactive object; the test unit is used to trigger the target interactive object to complete the current round of testing of the electronic device.

[0006] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: one or more processors; a memory; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method described in the first aspect.

[0007] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which a program code is stored. The program code can be called by a processor to execute the method described in the first aspect above.

[0008] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program / instruction, which implements the method described in the first aspect when executed by a processor.

[0009] The test method, device, electronic device, readable storage medium and product provided by the present application, the method first obtains the first interface of the application to be tested in the current round; then determines the target layout parameters of the first interface; then determines the state parameters of the target layout parameters based on the target layout parameters and the historical layout table; based on the state parameters, determines at least one interactive object other than the triggered interactive object in the interactive objects of the first interface as the target interactive object; thereby triggering the target interactive object to complete the current round of testing of the electronic device. The implementation method provided by the present application can exclude the triggered interactive object when determining the target interactive object, thereby avoiding repeated triggering of the interactive object that has been triggered, which can improve the efficiency of the test.

[0010] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and partly become apparent from the description, or can be understood by practicing the embodiments of the present application. The purposes and other advantages of the embodiments of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0012] Figure 1 An application scenario diagram of the test method provided in an embodiment of the present application is shown;

[0013] Figure 2A method flow chart of the testing method provided in an embodiment of the present application is shown;

[0014] Figure 3 An application framework diagram of the test method provided in an embodiment of the present application is shown;

[0015] Figure 4 A schematic diagram of a first interface provided by an embodiment of the present application is shown;

[0016] Figure 5 A method flow chart of a testing method provided by another embodiment of the present application is shown;

[0017] Figure 6 A method flow chart of a testing method provided by another embodiment of the present application is shown;

[0018] Figure 7 A method flow chart of a testing method provided by yet another embodiment of the present application is shown;

[0019] Figure 8 A schematic diagram showing a first interface of a calendar application provided in an embodiment of the present application is shown;

[0020] Fig. 9 A schematic diagram of an update history layout table provided in an embodiment of the present application is shown;

[0021] Fig.10 A schematic diagram showing a first interface of a calendar application provided by another embodiment of the present application is shown;

[0022] Fig.11 A schematic diagram showing an update history layout table provided by another embodiment of the present application is shown;

[0023] Fig.12 A structural block diagram of a tree state parameter provided in an embodiment of the present application is shown;

[0024] Fig.13 A schematic diagram showing a first interface of a calendar application provided by another embodiment of the present application is shown;

[0025] Fig.14 A schematic diagram of an update history layout table provided by another embodiment of the present application is shown;

[0026] Fig.15 A schematic diagram of updating tree state parameters provided in an embodiment of the present application is shown;

[0027] Fig.16 A schematic diagram showing a first interface of a calendar application provided in yet another embodiment of the present application is shown;

[0028] Fig.17 A schematic diagram of an update history layout table provided in yet another embodiment of the present application is shown;

[0029] Fig.18 A schematic diagram of updating tree state parameters provided by another embodiment of the present application is shown;

[0030] Fig.19 A schematic diagram showing a first interface of a calendar application provided in another embodiment of the present application is shown;

[0031] Fig. 20 A schematic diagram showing an update history layout table provided by another embodiment of the present application is shown;

[0032] Fig.21 A schematic diagram of updating tree state parameters provided by another embodiment of the present application is shown;

[0033] Fig. 22 The structure diagram of the test device provided by the embodiment of the present application is shown;

[0034] Fig.23 A structural block diagram of an electronic device provided in an embodiment of the present application is shown;

[0035] Fig.24 A structural block diagram of a computer-readable storage medium provided in an embodiment of the present application is shown;

[0036] Fig.25 A structural block diagram of a computer program product provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0037] In order to make those skilled in the art better understand the present application scheme, the technical scheme in the present application embodiment will be clearly and completely described below in conjunction with the drawings in the present application embodiment. Obviously, the described embodiment is only a part of the present application embodiment, rather than all the embodiments. The components of the present application embodiment usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application for protection, but merely represents the selected embodiment of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0038] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0039] At present, with the development of electronic information technology, more and more applications can be run on electronic devices. Although each interactive object in the application can be tested, the existing test efficiency of the interactive objects in the application is low. How to improve the efficiency of the test is a problem to be solved urgently.

[0040] At present, various types of applications are becoming increasingly complex. The differentiation of application versions caused by differences in different models, systems, and business regions requires developers and testers to test applications running on electronic devices. Among them, testers can manually write test cases based on the test requirements provided by business personnel, interact with the application manually, and make judgments based on application feedback. For fast-iteration applications, testers can customize automated testing solutions based on specific business characteristics, or directly test manually.

[0041] However, the inventors found in their research that the testers can customize the configuration for different businesses and rely on customized information input from the outside to generate test logic or trigger operations. In actual application scenarios, the interfaces and interactive objects of each business application are different, and testers need to customize the configuration according to the characteristics of each application, which is inefficient. Furthermore, the existing combined algorithm performs traversal testing on the application, and the interactive objects of the application may be repeatedly tested multiple times during the traversal process, resulting in low test efficiency.

[0042] Therefore, in order to overcome the above-mentioned defects, the present application provides a testing method, device, electronic device, readable storage medium and product.

[0043] See also Figure 1 , Figure 1 An application scenario diagram of a testing method is shown, namely, a testing scenario 100 , wherein the testing scenario 100 includes an electronic device 110 and a server 120 , wherein the electronic device 110 is connected to the server 120 .

[0044] The electronic device 110 can access the Internet and thereby establish a connection with the server 120 which is also connected to the Internet. The electronic device 110 can access the Internet wirelessly, such as through wireless communication technologies such as Wi-Fi and Bluetooth, etc.; the electronic device 110 can also access the Internet in a wired manner, such as through an Rj45 network cable or optical fiber.

[0045] The user can control the electronic device 110 so that the electronic device executes the test method. For details, please refer to the subsequent embodiments. For example, the user can directly operate the electronic device 110 to control the electronic device to execute the test method; the user can also operate the server 120 that has established a communication connection with the electronic device 110, so as to control the electronic device to execute the test method through the server 120. The server 120 can be a cloud server or a local server.

[0046] See also Figure 2 , Figure 2 A method flow chart of a test method provided in an embodiment of the present application is shown. The test method can be applied to Figure 1 In the electronic device 110 shown in FIG. 1 , the processor in the electronic device 110 can be used as the execution subject. The test method specifically includes steps S110 to S150.

[0047] Step S110: Acquire the first interface of the application to be tested in the current round.

[0048] Electronic devices can run applications to meet different needs of users. For example, electronic devices can run audio playback applications to meet the needs of users to listen to music; electronic devices can run calendar applications to meet the needs of users to view calendars, etc. Different applications may cause errors when running on different types of electronic devices, so the applications can be tested. It is easy to understand that testing the application running on the electronic device is actually to complete the detection by triggering the interactive object included in the application running in the electronic device.

[0049] In some implementations, since the application may include at least one interactive object, multiple rounds of testing may be performed to complete the testing of each interactive object included in the application. Therefore, one round of testing may trigger one interactive object, or one round of testing may trigger multiple interactive objects.

[0050] The first interface of the application to be tested in the current round can be obtained, wherein the application to be tested can be a pre-set application to be tested. For example, the user can pre-set a calendar application as the application to be tested; for another example, the user can pre-set an audio playback application as the application to be tested.

[0051] Specifically, an application may correspond to activity information (Activity), which may include package name and component name, etc. Therefore, by setting the package name and component name, etc., the pre-set application to be tested can be realized. Thus, the package name and component name can be obtained through the application GUI layer of the electronic device. When the package name and component name meet the pre-set package name and component name of the application to be tested, the application obtained at this time can be considered as the application to be tested. Please refer to Figure 3 , Figure 3 An application framework diagram 300 of the testing method provided in an embodiment of the present application is shown. Figure 3 The application GUI layer 310 is included, the application 301 is connected to the GUI layer 310, and the GUI layer 310 includes a package name and a component name.

[0052] When an electronic device runs an application, it may have multiple interfaces. For example, if the application to be tested is a calendar application, the calendar application may include an interface corresponding to the year, an interface corresponding to the month, an interface corresponding to the schedule group, etc. Therefore, in the current round of detection, the first interface of the application to be tested may be obtained. The first interface may be the interface displayed by the current application.

[0053] Step S120: determining target layout parameters of the first interface.

[0054] It is easy to understand that even for the same application, different interfaces can have different layout parameters. In an exemplary manner, the layout parameters may include type parameters, boundary parameters, and sub-interface parameters. Among them, the type parameters may include, for example, RelativeLayout or LinearLayout, etc.; the boundary parameters may be used to characterize the specific position of the interface in the display screen of the electronic device, and the boundary parameters may also be used to characterize the specific position of some objects in the interface in the screen, and the objects may be interactive objects. Among them, the sub-interface parameters include the layout parameters of the sub-interface belonging to the first interface.

[0055] For example, see Figure 4 , Figure 4 A schematic diagram of a first interface 400 provided in an embodiment of the present application is shown. Figure 4The first interface 400 of the calendar application is shown in the figure. The layout parameters of the first interface 400 can be obtained. For example, the layout parameters can include type parameters or boundary parameters. Specifically, the layout parameters of the first interface can be represented by layoutNode, so that the type parameters can be represented by the nodeClass attribute value of layoutNode; the boundary parameters can be represented by the bounds attribute value of layoutNode. Further, childNodes can be created for the layout parameters to represent the child interface parameters. In an exemplary way, the boundary parameters can be specifically represented by [0, 0][1080, 2173], where the first coordinate [0, 0] indicates that the starting point of the boundary is at the upper left corner coordinate of the display screen of the electronic device, and [1080, 2173] indicates the length and width of the boundary, and the unit can be pixels. Therefore, based on the obtained first interface, the layout parameters of the first interface can be determined as the target layout parameters.

[0056] Step S130: Based on the target layout parameters and the historical layout table, determine the state parameters of the target layout parameters, wherein the historical layout table includes the historical layout parameters before the current round and the historical state parameters corresponding to the historical layout parameters, and the state parameters include the triggered interactive objects used to characterize the triggered objects.

[0057] It is easy to understand that if the interactive objects in the first interface are obtained directly based on the layout parameters, and then the interactive objects are triggered to realize the detection of the application, it is easy to trigger certain interactive objects repeatedly, thereby reducing the detection efficiency. Therefore, after obtaining the target layout parameters, the state parameters can be determined first. Among them, the state parameters can include a triggered interactive object for characterizing that it has been triggered. Therefore, when determining the interactive object that needs to be triggered later, the triggered interactive object that has been triggered can be excluded, and the triggered interactive object that has been triggered will not be repeatedly triggered, which can improve the efficiency of detection.

[0058] Therefore, the state parameters of the target layout parameters can be determined based on the target layout parameters and the historical layout table. The historical layout table includes the historical layout parameters before the current round and the historical state parameters corresponding to the historical layout parameters. In an exemplary manner, the layout parameters obtained in the round before the current round can be used as historical layout parameters, and the historical layout parameters are stored in the historical layout table. Furthermore, each historical layout parameter can also correspond to a historical state parameter, and the historical state parameter includes a triggered interactive object that has been triggered in the round before the current round. In other words, the historical layout parameters and the historical state parameters have a corresponding mapping relationship.

[0059] Specifically, it is possible to search in the historical layout table whether there are historical layout parameters that are the same as the target layout parameters. If so, it can be characterized that at least some interactive objects in the first interface corresponding to the target layout parameters have been detected before the current round, so that the state parameters of the target layout parameters can be determined based on the historical state parameters mapped to the historical layout parameters that are the same as the target layout parameters.

[0060] Optionally, if there is no historical layout parameter identical to the target layout parameter in the historical layout table, it can indicate that the first interface corresponding to the target layout parameter has not been detected in the round before the current round, so the interactive object in the first interface has not been triggered. Therefore, the state parameter of the target layout parameter can be configured as a null value (NULL). For a specific introduction, please refer to the subsequent embodiments.

[0061] Step S140: Based on the state parameter, at least one interactive object other than the triggered interactive object among the interactive objects of the first interface is determined as a target interactive object.

[0062] Furthermore, a target interaction object may be determined, and thus the target interaction object may be triggered to implement a current round of testing of the electronic device.

[0063] It is easy to understand that the first interface may include one interactive object or multiple interactive objects. Therefore, in some embodiments, the interactive objects in the first interface may be determined by traversal. In an exemplary embodiment, the interactive objects that can be used for interaction in the first interface may be obtained by a depth first search algorithm (DFS), for example, they may be represented by triggerNodes.

[0064] Please continue reading Figure 4 , an exemplary, Figure 4 The first interface 400 shown in FIG. 4 may include an interactive object 401 , an interactive object 402 , an interactive object 403 , and the like.

[0065] In an exemplary embodiment, the state parameter of the target layout parameter may include finishedChildNodes, that is, the triggered interactive objects determined by the historical layout table may be stored in finishedChildNodes. Thus, after obtaining the interactive objects of the first interface, they may be compared with the finishedChildNodes of the state parameter. If there is at least one interactive object that is different from the triggered interactive object stored in finishedChildNodes, the different interactive object may be used as the target interactive object, thereby subsequently triggering the target interactive object to implement the current round of testing of the electronic device.

[0066] Optionally, if there is no interactive object different from the triggered interactive object stored in finishedChildNodes, it can be represented that each interactive object in the first interface has been traversed before the current round. In this case, the subsequent triggering of the interactive object may not be executed, and the next round of detection may be directly returned.

[0067] Among them, the target interaction object may include one interaction object or multiple interaction objects, which is not limited in the embodiments of the present application.

[0068] Please continue reading Figure 3 , Figure 3 The application framework diagram 300 of the test method shown in FIG. 1 also includes an algorithm layer 320, which is connected to the application GUI layer 310. The algorithm layer 320 may include a comparison module for comparing interactive objects and triggered interactive objects, and also includes a historical layout table and digital state parameters.

[0069] Step S150: triggering the target interactive object to complete the current round of testing of the electronic device.

[0070] After the target interaction object is determined, the target interaction object can be triggered. It is easy to understand that different interaction objects can have different interaction types, such as input interaction, sliding interaction or click interaction. In an exemplary way, click interaction can be represented by clickable, sliding interaction can be represented by scrollable, and input interaction can be represented by editable.

[0071] Therefore, in some embodiments, the type of the target interactive object to be triggered can be determined based on the specific parameters of clickable, scrollable, and editable. For example, if the parameter of clickable is true, the parameter of scrollable is false, and the parameter of editable is false, the interaction type of the target interactive object can be characterized as click interaction. Further, the target interactive object can be triggered by click interaction, thereby completing the test of the current round of the electronic device.

[0072] In an exemplary manner, an auxiliary service may be called to trigger the target interaction object, wherein the auxiliary service may be an accessibility service function provided by an electronic device, and generally may be used to implement automated assistance. Specifically, performAction(AccessibilityNodeInfo.ACTION_CLICK) may be called to trigger a click interaction; performAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD) and performAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD) may be called to trigger a slide interaction; and performAction(AccessibilityNodeInfo.ACTION_SET_TEXT, bundle) may be called to trigger an input interaction.

[0073] Similarly, for input interaction or sliding interaction, the target interaction object can also be triggered by calling auxiliary services, which will not be described here.

[0074] After the target interactive object is triggered, the reaction time of the target interactive object and whether an abnormality occurs can be recorded. If an abnormality occurs, it can be recorded in the system log. In an exemplary manner, the occurrence of an abnormality may mean that after the target interactive object is triggered, the result corresponding to the trigger is not generated, or the reaction time of the target interactive object is too long, etc., which is not specifically limited in the embodiments of the present application.

[0075] Please continue reading Figure 3 , Figure 3 The application framework diagram 300 of the test method shown in FIG. 3 also includes a test layer 330, which is connected to the algorithm layer 320. The test layer 330 includes a recording module for recording the reaction time and a log module for recording the abnormal log.

[0076] The test method provided by the present application first obtains the first interface of the application to be tested in the current round; then determines the target layout parameters of the first interface; then determines the state parameters of the target layout parameters based on the target layout parameters and the historical layout table; based on the state parameters, determines at least one interactive object other than the triggered interactive object in the interactive objects of the first interface as the target interactive object; thereby triggering the target interactive object to complete the current round of testing of the electronic device. The implementation method provided by the present application can exclude the triggered interactive object when determining the target interactive object, thereby avoiding repeated triggering of the interactive object that has been triggered, and can improve the efficiency of the test.

[0077] See also Figure 5 , Figure 5 A method flow chart of a test method provided in an embodiment of the present application is shown. The test method can be applied to Figure 1 In the electronic device 110 shown in FIG. 1 , the processor in the electronic device 110 can be used as the execution subject. The test method specifically includes steps S210 to S280.

[0078] Step S210: Acquire the first interface of the application to be tested in the current round.

[0079] Step S220: determining target layout parameters of the first interface.

[0080] Among them, step S210 and step S220 have been introduced in detail in the above embodiments and will not be repeated here.

[0081] Step S230: searching the historical layout table for historical layout parameters corresponding to the target layout parameters as designated layout parameters.

[0082] As can be seen from the above introduction, the historical layout parameters corresponding to the target layout parameters can be searched in the historical layout table, and then the state parameters of the target layout parameters can be determined through the historical state parameters in the historical layout table that have a mapping relationship with the historical layout parameters corresponding to the target layout parameters. Therefore, it is necessary to first determine the corresponding historical layout parameters based on the historical layout table.

[0083] In some embodiments, the layout parameters may correspond to hash values, that is, the hash values ​​corresponding to the layout parameters may be determined based on the layout parameters. It is easy to understand that for the same layout parameters, the corresponding hash values ​​should also be the same. Thus, the historical layout parameters stored in the historical layout table, and the historical state parameters corresponding to each historical layout parameter, can be regarded as the historical hash values ​​corresponding to the stored historical layout parameters, and the historical state parameters corresponding to the historical hash values. In an exemplary manner, the layout parameters may include historical hash values, historical layout parameters, and historical state parameters, as well as the mapping relationship between historical hash values, historical layout parameters, and historical state parameters, so that the historical layout parameters corresponding to each historical hash value, and the corresponding historical state parameters can be determined.

[0084] Furthermore, the target hash value corresponding to the target layout parameter can be obtained, so that the historical layout table can be further searched based on the target hash value. Specifically, when executing step S230, steps S231 to S233 can also be included.

[0085] Step S231: Obtain a target hash value corresponding to the target layout parameter.

[0086] In order to find out whether there is a historical layout parameter corresponding to the target layout parameter in the historical layout table, the target hash value corresponding to the target layout parameter can be first obtained. Specifically, the target hash value corresponding to the target layout parameter can be calculated. In an exemplary embodiment, when executing step S231, steps S2311 to S2314 can also be included.

[0087] Step S2311: Based on the type parameter of the target layout parameter, obtain a first intermediate hash value.

[0088] Step S2312: Based on the boundary parameter of the target layout parameter, obtain a second intermediate hash value.

[0089] Step S2313: obtaining a third intermediate hash value based on the sub-interface parameters of the target layout parameters.

[0090] Step S2314: based on the first intermediate hash value, the second intermediate hash value, and the third intermediate hash value, obtain a target hash value corresponding to the target layout parameter.

[0091] The target layout parameters may include type parameters, boundary parameters, and sub-interface parameters. For example, the layout parameters of the first interface may be represented by layoutNode, and the type parameters may be represented by the nodeClass attribute value of layoutNode; the boundary parameters may be represented by the bounds attribute value of layoutNode. Furthermore, childNodes may be created for the layout parameters to represent the sub-interface parameters.

[0092] Further, the first intermediate hash value can be obtained based on the type parameter of the target layout parameter. For example, the first intermediate hash value can be represented by Hash(layoutNode.nodeClass). The second intermediate hash value can also be obtained based on the boundary parameter of the target layout parameter, for example, the second intermediate hash value can be represented by Hash(layoutNode.bounds). The third intermediate hash value can also be obtained based on the child interface parameter of the target layout parameter, for example, the third intermediate hash value can be represented by Hash(childNodes).

[0093] Thus, the target hash value corresponding to the target layout parameter can be obtained based on the first intermediate hash value, the second intermediate hash value, and the third intermediate hash value. For example, the target hash value can be represented by Hash(Hash(layoutNode.nodeClass), Hash(layoutNode.bounds), Hash(childNodes)). The first intermediate hash value, the second intermediate hash value, and the third intermediate hash value are respectively used as variable parameters for obtaining the target hash value.

[0094] Step S232: If there is a historical hash value identical to the target hash value in the historical layout table, it is determined that the designated layout parameter exists, and the designated layout parameter is a historical layout parameter corresponding to the historical hash value identical to the target hash value.

[0095] Step S233: If the historical hash value identical to the target hash value does not exist in the historical layout table, it is determined that the specified layout parameter does not exist.

[0096] Since the hash value corresponding to the same layout parameter is unique, after obtaining the target hash value, it is possible to search whether there is a historical hash value identical to the target hash value in the historical layout table. If a historical hash value identical to the target hash value is found in the historical layout table, it can be determined that the specified layout parameter exists at this time. The specified layout parameter can be a historical layout parameter corresponding to the historical hash value identical to the target hash value.

[0097] In an exemplary manner, the historical layout table can be represented by stateCacheTable. If the historical layout table includes historical hash values ​​H1 and H2, where the historical hash value H1 corresponds to the historical layout parameter C1, and the historical hash value H2 corresponds to the historical layout parameter C2, then if the target hash value MH is found to be the same as the historical hash value H1, it can be determined that the specified layout parameter exists, and the specified layout parameter can be the historical layout parameter C1 corresponding to the historical hash value H1.

[0098] If the historical hash value identical to the target hash value is not found in the historical layout table, that is, the historical hash value identical to the target hash value does not exist in the historical layout table, then it can be determined that the specified layout parameter does not exist.

[0099] Step S240: whether the specified layout parameters exist.

[0100] Further, the state parameters of the target layout parameters can be determined based on the historical state parameters corresponding to the specified layout parameters, or the state parameters of the target layout parameters can be configured. Specifically, if there are specified layout parameters, the process can jump to step S250; if there are no specified layout parameters, the process can jump to step S260.

[0101] Step S250: If the designated layout parameter exists, determining the state parameter of the target layout parameter based on the historical state parameter corresponding to the designated layout parameter.

[0102] If there are designated layout parameters, the state parameters of the target layout parameters can be determined based on the historical state parameters corresponding to the designated layout parameters. In an exemplary embodiment, the state parameters of the target layout parameters can be configured based on the historical state parameters corresponding to the designated layout parameters. Specifically, when executing step S250, steps S251 to S254 can also be included.

[0103] Step S251: If the specified layout parameter exists, first identification information of the state parameter is configured based on the historical first identification information in the historical state parameter, wherein the first identification information is used to represent information of the current round.

[0104] Step S252: configuring the second identification information of the state parameter based on the historical second identification information in the historical state parameter, wherein the second identification information is used to represent information of a round before the current round.

[0105] Step S253: configuring the triggered interaction objects of the state parameters based on the historical triggered interaction objects in the historical state parameters.

[0106] Step S254: adding the designated triggered interaction object corresponding to the designated round into the triggered interaction object to update the triggered interaction object, wherein the designated round includes the rounds adjacent to the current round.

[0107] In an exemplary embodiment, the state parameter can be represented by newSateNode, and the historical state parameter can be represented by SateNode. Thus, the first identification information of the state parameter can be configured based on the historical first identification information in the historical state parameter, wherein the first identification information is used to represent the information of the current round. For example, the historical first identification information can be represented by SateNode.ID, and the first identification information of the state parameter can be represented by newSateNode.ID, so that newSateNode.ID can be configured by SateNode.ID, for example, newSateNode.ID can be initialized by SateNode.ID.

[0108] Further, the second identification information of the state parameter can be configured based on the historical second identification information in the historical state parameter, wherein the second identification information is used to represent the information of the round before the current round. For example, the historical second identification information can be represented by SateNode.parentId, and the second identification information of the state parameter can be represented by newSateNode.parentId, so that newSateNode.parentId can be configured by SateNode.parentId, for example, newSateNode.parentId can be initialized by SateNode.parentId.

[0109] Furthermore, the triggered interaction objects of the state parameters can also be configured based on the historical triggered interaction objects in the historical state parameters. For example, the historical triggered interaction objects can be represented by SateNode.finishedChildNodes, and the triggered interaction objects of the state parameters can be represented by newSateNode.finishedChildNodes, so that newSateNode.finishedChildNodes can be configured by SateNode.finishedChildNodes, for example, newSateNode.finishedChildNodes can be initialized by SateNode.finishedChildNodes.

[0110] The specified triggered interaction object corresponding to the specified round may also be added to the triggered interaction object to update the triggered interaction object, wherein the specified round includes the adjacent round before the current round, for example, the specified round may be the previous round of the current round.

[0111] Optionally, the triggered interaction object corresponding to the current round may be added to the triggered interaction object corresponding to the previous round of the current round, thereby avoiding falling into an endless loop.

[0112] Step S260: If the designated layout parameter does not exist, a null value is configured for the state parameter of the target layout parameter as the state parameter.

[0113] In some implementations, if the specified layout parameter does not exist, a null value may be configured for the state parameter of the target layout parameter as the state parameter. Specifically, a null value may be configured for the triggered interactive object of the state parameter. For example, newSateNode.finishedChildNodes may be initialized with NULL.

[0114] Optionally, a new value may be configured for the first identification information of the state parameter, for example, by initializing newSateNode.ID through ID1. The second identification information of the state parameter may also be configured through the second identification information of the previous round of the current round, for example, by using prevStateNode.parentId to represent the second identification information of the previous round of the current round, so that newSateNode.parentId may be initialized through prevStateNode.parentId. If there is no previous round before the current round, newSateNode.parentId may also be configured through the null value NULL.

[0115] Step S270: Based on the state parameter, determine at least one interactive object among the interactive objects of the first interface except the triggered interactive object as a target interactive object.

[0116] Step S280: triggering the target interactive object to complete the current round of testing of the electronic device.

[0117] Among them, step S270 and step S280 have been introduced in detail in the above embodiments and will not be repeated here.

[0118] Step S290: Add the target layout parameters and corresponding state parameters to the historical layout table to update the historical layout table.

[0119] In some embodiments, in the absence of specified layout parameters, it is characterized that there are no historical layout parameters identical to the target layout parameters in the historical layout table. Thus, at this time, the target layout parameters and the corresponding state parameters can be added to the historical layout table to update the historical layout table. In an exemplary manner, at this time, the target hash value corresponding to the target layout parameter can also be added to the historical layout table. Among them, the corresponding mapping relationship between the target hash value, the target layout parameter and the state parameter also needs to be added to the historical layout table. Thus, in the round test after the current round, the target layout parameters, target hash value and state parameters of the current round can be obtained through the updated historical layout table, which can avoid repeated testing of the interactive objects that have been triggered, thereby improving the test efficiency.

[0120] The test method provided by the present application first obtains the first interface of the application to be tested in the current round; then determines the target layout parameters of the first interface; then searches the historical layout parameters corresponding to the target layout parameters in the historical layout table as the designated layout parameters; if the designated layout parameters exist, the state parameters of the target layout parameters are determined based on the historical state parameters corresponding to the designated layout parameters; if the designated layout parameters do not exist, a null value is configured for the state parameters of the target layout parameters as the state parameters; based on the state parameters, at least one interactive object other than the triggered interactive object in the interactive objects of the first interface is determined as the target interactive object; thereby triggering the target interactive object to complete the current round of testing of the electronic device. When determining the target interactive object, the implementation method provided by the present application can add the triggered interactive object corresponding to the current round to the triggered interactive object used in the previous round of the current round, thereby avoiding falling into an infinite loop. It is also possible to avoid repeated testing of some interactive objects that have been triggered by updating the historical layout table, thereby improving the test efficiency.

[0121] See also Figure 6 , Figure 6 A method flow chart of a test method provided in an embodiment of the present application is shown. The test method can be applied to Figure 1 In the electronic device 110 shown in FIG. 1 , the processor in the electronic device 110 can be used as the execution subject. The test method specifically includes steps S310 to S390.

[0122] Step S310: Acquire the first interface of the application to be tested in the current round.

[0123] Step S320: determining target layout parameters of the first interface.

[0124] Step S330: Based on the target layout parameters and the historical layout table, determine the state parameters of the target layout parameters, wherein the historical layout table includes the historical layout parameters before the current round and the historical state parameters corresponding to the historical layout parameters, and the state parameters include the triggered interactive objects used to characterize the triggered objects.

[0125] Among them, step S310 to step S330 have been introduced in detail in the above-mentioned embodiment and will not be repeated here.

[0126] Step S340: Based on the state parameters, the tree state parameters are updated, wherein the tree state parameters include parameters of a tree structure composed of historical state parameters of rounds before the current round.

[0127] In some embodiments, after the state parameters are obtained, the tree state parameters can be updated based on the state parameters, wherein the tree state parameters include parameters of a tree structure composed of historical state parameters of rounds before the current round. It is not difficult to understand that different interfaces in an application program running on an electronic device have different hierarchical relationships. For example, interface A1 can be the top-level interface, and interface A1 can include interface A2 and interface A3, and interface A3 can include interface A4 and interface A5. Therefore, the levels of state parameters corresponding to different interfaces are not necessarily the same, so that the tree state parameters can also be used to characterize the hierarchical relationship between historical state parameters.

[0128] Step S350: Determine the interactive object of the first interface based on the updated tree state parameters.

[0129] Furthermore, the interactive objects of the first interface can be determined based on the updated tree state parameters. Specifically, the updated tree state parameters can be traversed by a depth-first search algorithm DFS to determine the interactive objects of the first interface, for example, the interactive objects can be represented by triggerNodes.

[0130] Optionally, when traversing the updated tree state parameters by the depth-first search algorithm DFS, only the state parameters of the target layout parameters in the current round may be traversed to obtain the interactive objects of the first interface. By traversing the updated tree state parameters, the problem of excessive granularity caused by the algorithm can be avoided.

[0131] Optionally, when determining the interactive object, it can also be based on whether there is a historical layout parameter corresponding to the target layout parameter in the historical layout table. If so, the historical interactive object in the historical state parameter corresponding to the historical layout parameter corresponding to the target layout parameter can be directly obtained as the interactive object of the first interface. Specifically, when executing step S350, step S351 and step S352 can also be included.

[0132] Step S351: if there is no historical layout parameter corresponding to the target layout parameter in the historical layout table, traverse the updated tree state parameters to determine the interactive object of the first interface.

[0133] Step S352: If there are historical layout parameters corresponding to the target layout parameters in the historical layout table, obtain historical interaction objects in historical state parameters corresponding to the historical layout parameters corresponding to the target layout parameters as interaction objects of the first interface.

[0134] For some implementation methods, in addition to storing historical layout parameters, historical status parameters, and the mapping relationship between historical layout parameters and historical status parameters, the historical layout table may also store interactive nodes included in the interface corresponding to each historical layout parameter.

[0135] Since if the historical layout parameters are the same as the target layout parameters, the interactive objects included in the interface corresponding to the historical layout parameters can be represented to be the same as the interactive objects included in the first interface corresponding to the target layout parameters, so the interactive objects stored in the historical layout table can be directly used as the interactive objects of the first interface in the current round, thereby avoiding repeated traversal of the numerical state parameters through the depth-first search algorithm DFS, saving computing power resources, and avoiding the problem of state explosion caused by repeated traversal of the same numerical state parameters.

[0136] If there are historical layout parameters corresponding to the target layout parameters in the historical layout table, then historical interaction objects in historical state parameters corresponding to the historical layout parameters corresponding to the target layout parameters are obtained as interaction objects of the first interface.

[0137] If there is no historical layout parameter corresponding to the target layout parameter in the historical layout table, the updated tree state parameters can be traversed by a depth-first search algorithm DFS to determine the interactive object of the first interface. For details, please refer to the above introduction, which will not be repeated here.

[0138] Step S360: Whether there is at least one interactive object that is different from the triggered interactive object.

[0139] After the interactive object is obtained, it can be compared with the triggered interactive object. If at least one interactive object is different from the triggered interactive object, the process can jump to step S370; if no interactive object is different from the triggered object, the process can jump to step S380.

[0140] Step S370: If there is at least one interactive object that is different from the triggered interactive object, at least one interactive object other than the triggered interactive object among the interactive objects of the first interface is determined as a target interactive object.

[0141] When there is at least one interactive object different from the triggered interactive object, it indicates that the different interactive object has not been triggered. At this time, at least one interactive object in the interactive objects of the first interface except the triggered interactive object can be used as the target interactive object.

[0142] It should be noted that the target interaction object may be one interaction object, which may be an interaction object different from the triggered interaction object. The target interaction object may also be multiple interaction objects, which may be interaction objects different from the triggered interaction object, and the embodiments of the present application do not limit this.

[0143] Step S380: If there is no interactive object that is different from the triggered object, the next round of the current round is used as the new current round, and the process returns to the first interface of the application to be tested of the current round and subsequent steps.

[0144] When there is no interactive object that is different from the triggered object, it indicates that each interactive object in the first layout has been triggered. At this time, the completion flag in the state parameter of the target layout parameter of the current round can be set to completed, and the next round of the current round is used as the new current round, and the process returns to execute the first interface of the application to be tested of the current round and subsequent steps, that is, the process returns to execute step S310 and subsequent steps.

[0145] As an exemplary example, the completion flag of the state parameter may be represented by newStateNod.finished. In this case, newStateNod.finished may be configured as True to represent completion.

[0146] Step S390: triggering the target interactive object to complete the current round of testing of the electronic device.

[0147] Among them, step S390 has been described in detail in the above embodiment and will not be repeated here.

[0148] The test method provided by the present application first obtains the first interface of the application to be tested in the current round; then determines the target layout parameters of the first interface; then determines the state parameters of the target layout parameters based on the target layout parameters and the historical layout table; based on the state parameters, updates the tree state parameters, wherein the tree state parameters include the parameters of the tree structure composed of the historical state parameters of the rounds before the current round; determines the interactive objects of the first interface based on the updated tree state parameters; if at least one of the interactive objects is different from the triggered interactive object, then determines at least one interactive object other than the triggered interactive object in the interactive objects of the first interface as the target interactive object; thereby triggering the target interactive object to complete the test of the current round of the electronic device. The embodiment provided by the present application can avoid repeatedly traversing the number state parameters through the depth-first search algorithm DFS algorithm, saving computing resources, and avoiding the problem of state explosion caused by repeatedly traversing the same number state parameters. In addition, by traversing the updated tree state parameters, the problem of excessive granularity caused by the algorithm can be avoided.

[0149] See also Figure 7 , Figure 7 A method flow chart of a test method provided in an embodiment of the present application is shown. The test method can be applied to Figure 1 In the electronic device 110 shown in FIG. 1 , the processor in the electronic device 110 can be used as the execution subject. The test method specifically includes steps S410 to S480.

[0150] Step S410: configuring a target application as an application to be tested, wherein the target application is an application to be tested.

[0151] Step S420: If a system event is detected, the first interface of the application to be tested in the current round is obtained, wherein the system event is triggered when a window change event of the electronic device is detected, and the window change event includes at least one of text change, image loading, notification pop-up window and page switching.

[0152] In some embodiments, the auxiliary service module can be configured to configure the target application as the application to be tested, wherein the target application is the application to be tested. For example, if a calendar application needs to be tested, the calendar application is the target application, which can be configured through the auxiliary service model. In an exemplary manner, the event type to be monitored, the time interval for the application to be tested or the auxiliary service to process the event, etc. can be configured through the auxiliary service model. For example, setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo) can be called to configure the auxiliary service module. Specifically, the package name of the application to be tested in the auxiliary service can be specified, defined as packageName. The event type to be monitored for the auxiliary service can also be specified as a window change event (TYPE_WINDOW_CONTENT_CHANGED). The time interval for the auxiliary service to process the event can also be specified as 200ms. Among them, the auxiliary service is the service running in the auxiliary service module.

[0153] Furthermore, system events can be detected, wherein the system event is triggered when a window change event of an electronic device is detected, and the window change event includes at least one of text change, image loading, notification pop-up window and page switching. For example, if the text in the interface of an application running on an electronic device changes, it can be regarded as a window change event, and a system event can be detected; for another example, if an application switches from one interface to another different interface, it can also be regarded as a window change event, and a system event can be detected. When a system event is detected, the first interface of the application to be tested in the current round can be obtained. Among them, the auxiliary service can return the system event by calling back the onAccessibilityEvent(android.view.accessibility.AccessibilityEvent) method, which is defined as event.

[0154] In an exemplary embodiment, the application log can be monitored by a logcat tool to detect system events. The logcat tool can be started with a null value based on the auxiliary service module.

[0155] It is not difficult to understand that when an electronic device is running an application, when the application is loading a new interface to switch interfaces, some interfaces may be repeatedly loaded. At this time, these repeatedly loaded interfaces can be considered as invalid interfaces. Therefore, when executing step S420, step S421 and step S422 may also be included.

[0156] Step S421: If a system event is detected, continue to obtain new system events until no new system events are received.

[0157] Step S422: Acquire the interface corresponding to the new system event as the first interface of the application to be tested in the current round.

[0158] Since system events can be detected by detecting window change events, after detecting system events, the application may generate some invalid window changes when performing window switching, and thus may receive system events later. Therefore, new system events can be continuously obtained until no new system events are received.

[0159] Optionally, in some implementations, the response event of each system event may also be recorded, so that when the system event is acquired, the response event may also be acquired. Specifically, when executing step S421, steps S4211 to S4213 may also be included.

[0160] Step S4211: If a system event is detected, obtain the response time of the system event.

[0161] Step S4212: If the response time is greater than a specified threshold, it is determined that the interface of the application to be tested is stuck and the information is recorded in the system log.

[0162] Step S4213: Continue to obtain new system events until no new system events are received.

[0163] When a system event is detected, the response time of the system event can be obtained. In an exemplary manner, the response time can be characterized by responseTime. If the response time is greater than a specified threshold, it indicates that the interface of the application to be tested has been stuck, which can be recorded in the system log. For example, the specified threshold can be 1000ms. If the responseTime is detected to be greater than 1000ms, it means that the application has been stuck and is recorded in the log.

[0164] Furthermore, after determining that a freeze has occurred, it is necessary to continue to obtain new system time until no new system events are received.

[0165] After no new system events are received, it can be indicated that the application running on the electronic device has completed the interface switching and no invalid interface will be generated. At this time, the interface corresponding to the new system event can be obtained as the first interface of the application to be tested in the current round, thereby avoiding interference caused by invalid interfaces.

[0166] In some implementations, the getRootInActiveWindow() method may be called to obtain an interface corresponding to a new system event as the first interface of the application to be tested in the current round.

[0167] Optionally, since the electronic device can run multiple applications, the application currently running on the electronic device may not be the application to be tested. Therefore, for some implementations, root.getPackageName() can also be called to obtain the package name of the interface corresponding to the current system event. If the package name is different from the pre-configured package name packageName of the application to be tested, it indicates that the application running at this time is not the application to be tested, so it can return to execute if a system event is detected and subsequent steps.

[0168] Optionally, instead of actively detecting system events through the auxiliary service module, a timer may be used to set a specified time interval, and the interface of the current application is obtained once every specified time interval as the first interface of the application to be tested.

[0169] Step S430: determining target layout parameters of the first interface.

[0170] Step S440: Based on the target layout parameters and the historical layout table, determine the state parameters of the target layout parameters, wherein the historical layout table includes the historical layout parameters before the current round and the historical state parameters corresponding to the historical layout parameters, and the state parameters include the triggered interactive objects used to characterize the triggered objects.

[0171] Step S450: Based on the state parameter, determine at least one interactive object among the interactive objects of the first interface except the triggered interactive object as a target interactive object.

[0172] Among them, step S430 to step S450 have been introduced in detail in the above embodiments and will not be repeated here.

[0173] Step S460: Acquire the interaction type of the target interaction object.

[0174] Step S470: Based on the interaction type, trigger the target interaction object to complete the current round of testing of the electronic device.

[0175] After the target interactive object is determined, the target interactive object can be triggered. As can be seen from the above introduction, different interactive objects can have different interaction types, such as input interaction, sliding interaction, or click interaction. Therefore, when triggering the target interactive object, the interaction type of the target interactive object can be first obtained, and then the target interactive object can be triggered based on the interaction type.

[0176] In an exemplary embodiment, the target interactive object can be represented by unfinishedUINode, so the isEditable() method can be called to obtain the editable parameter of unfinishedUINode. If editable is true, the performAction(AccessibilityNodeInfo.ACTION_SET_TEXT, bundle) method is called to trigger input interaction.

[0177] You can get the scrollable property of unfinishedUINode by calling the isScrollable() method. If scrollable is true, you can call the performAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD) method and the performAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD) method to trigger the sliding interaction.

[0178] You can also get the clickable property of unfinishedUINode by calling the isClickable() method. If clickable is true, call the performAction(AccessibilityNodeInfo.ACTION_CLICK) method to trigger the click interaction.

[0179] Optionally, after the target interactive object is triggered, the triggered interactive object may be updated based on the target interactive object, so that in the next round of testing after the current round, the target interactive object in the current round may no longer be triggered, thereby improving test efficiency.

[0180] Step S480: taking the next round of the current round as the new current round, and returning to execute the first interface of obtaining the application to be tested in the current round and subsequent steps.

[0181] After the test of the target interactive object of the current round is completed, the next round of the current round can be used as a new current round, and the first interface of the application to be tested of the current round and subsequent steps are returned to be executed.

[0182] The inventors sorted out the data by comparing the test method provided in the embodiment of the present application with the existing Monkey test method to obtain the following Table 1, which is a comparison table of the test method provided in the embodiment of the present application and the Monkey test method.

[0183] Table 1 Comparison table of the test method provided in the embodiment of the present application and the Monkey test method

[0184]

[0185] It can be seen from the comparison table of the test method provided in the embodiment of the present application and the Monkey test method in Table 1 that compared with the existing automated test framework Monkey, the present solution has a higher automation coverage rate in the same time and achieves a higher coverage rate for each test scenario. In other words, in the embodiment provided by the present application, the test efficiency is higher.

[0186] The test method provided by the present application first configures the target application as the application to be tested, wherein the target application is the application to be tested; if a system event is detected, the first interface of the application to be tested in the current round is obtained; then based on the target layout parameters and the historical layout table, the state parameters of the target layout parameters are determined; based on the state parameters, at least one interactive object other than the triggered interactive object in the interactive objects of the first interface is determined as the target interactive object; the interaction type of the target interactive object is obtained; based on the interaction type, the target interactive object is triggered to complete the current round of testing of the electronic device. In the implementation manner provided by the present application, interference caused by invalid interfaces can be avoided. The triggered interactive object can also be updated based on the target interactive object, so that in the next round of testing after the current round, the target interactive object in the current round can no longer be triggered, thereby improving the test efficiency.

[0187] The implementation method provided in this application is further illustrated below by taking a calendar application as an application to be tested.

[0188] See also Figure 8 , Figure 8 A schematic diagram of a first interface 800 of a calendar application provided in an embodiment of the present application is shown. Figure 8The first interface shown may be the interface of the calendar application during the first round of detection, that is, the current round at this time is the first round, and the first interface 800 may be the interface of the "main interface" of the calendar application. It can be represented by root1 Figure 8 The first interface 800 of the first round in the diagram can be used to obtain target layout parameters based on the first interface 800, and the target layout parameters can be represented by layoutNode1.

[0189] Furthermore, due to Figure 8 The current round corresponding to the first interface 800 shown is the first round, so no detection has been performed before the current round, that is, there are no historical layout parameters in the historical layout table, and thus there are no historical layout parameters corresponding to the target layout parameters in the historical layout table.

[0190] The target hash value corresponding to the target layout parameter can be further calculated, and Hash1 can be used to represent the target hash value of the first round. Optionally, the target hash value Hash1 and the target layout parameter of the first round can also be stored in the historical layout table to update the historical layout table. Fig. 9 , Fig. 9 A schematic diagram of an update history layout table provided in an embodiment of the present application is shown. Fig. 9 The historical layout table 900 includes a target hash value Hash1 of the first round, target layout parameters, and a mapping relationship between the target hash value Hash1 of the first round and the target layout parameters.

[0191] At this time, the state parameters of the target layout parameters can be configured. Specifically, the state parameters of the first round can be represented by newStateNode, the first identification information of the first round can be represented by newStateNode.Id1, and the first identification information of the first round can be configured as Id1; the second identification information of the first round can be represented by newStateNode.parentId1, and the second identification information of the first round can be configured as a null value NULL.

[0192] Since the current round is the first round, no interactive object has been triggered before the current round, so the triggered interactive object is NULL. The triggered interactive object of the first round can be represented by finishedChildNodes1 and configured as NULL. The first interface of the first round is represented by root1. Fig. 9 The target hash value, state parameter, first identification information, second identification information, triggered interaction object and first interface shown are all from the first round.

[0193] Furthermore, the interactive objects of the first interface can be obtained, for example, by traversing through the depth-first search algorithm DFS, so as to obtain the interactive objects. The interactive objects can be represented by triggerNodes1. Further, the target interactive object is determined based on the interactive objects and the triggered objects. At this time, at least one interactive object other than the triggered interactive object in the interactive objects of the first interface can be determined as the target interactive object. Please continue to refer to Figure 8 , Figure 8 The first interface 800 shown includes an interactive object 801, an interactive object 802, and an interactive object 803. At this time, the interactive object 801 can be selected as the target interactive object, and the target interactive object can be represented by unfinishedUINode1.

[0194] At this time, the target interactive object can be triggered according to the interaction type of the target interactive object. The clickable property of unfinishedUINode1 is true, which means the target interactive object can be clicked. Then performAction(AccessibilityNodeInfo.ACTION_CLICK) is called to trigger the click interaction. Click the interactive object 801 to enter the "Schedule Grouping" interface. Finally, prevStateNode is defined as the state node newStateNode, which is used to initialize the state parameters of the next round, and the current round of testing is completed.

[0195] For further information, see Fig.10 , Fig.10 A schematic diagram of a first interface 1000 of a calendar application provided in an embodiment of the present application is shown. Fig.10 The first interface shown may be the interface of the calendar application during the second round of detection, that is, the current round at this time is the second round, and the first interface 1000 may be the interface of "schedule grouping" in the calendar application. It can be represented by root2 Fig.10 The first interface 1000 of the second round in the diagram can be used to obtain the target layout parameters based on the first interface 1000, and the target layout parameters can be represented by layoutNode2.

[0196] Furthermore, due to Fig.10 The current round corresponding to the first interface 1000 shown is the second round, so the historical layout table includes the historical hash value Hash1 of the first round and the corresponding historical layout parameters.

[0197] The target hash value corresponding to the target layout parameter can be further calculated, and the target hash value of the second round can be represented by Hash2. It is easy to know that the first interface corresponding to the historical hash value Hash1 is the "main interface" in the calendar application, so there is no historical hash value identical to the target hash value Hash2 in the historical layout table. Therefore, there is no historical layout parameter corresponding to the target layout parameter in the historical layout table.

[0198] At this time, the state parameters of the target layout parameters can be configured. Specifically, the state parameters of the second round can be represented by newStateNode, the first identification information of the second round can be represented by newStateNode.Id2, and the first identification information of the second round can be configured as Id2; the second identification information of the second round can be represented by newStateNode.parentId1, and the second identification information of the second round can be configured as prevStateNode, and the Id of the prevStateNode can be Id1.

[0199] Optionally, the target hash value Hash2 and the target layout parameters of the second round may be stored in the history layout table to update the history layout table. Fig.11 , Fig.11 A schematic diagram of an update history layout table provided in an embodiment of the present application is shown. Fig.11 The historical layout table 1100 includes the historical hash value Hash1 of the first round and the mapping relationship between the historical hash value Hash1 of the first round and the historical layout parameters. Fig.11 The target hash value, state parameter, first identification information, second identification information, triggered interaction object and first interface shown are all from the second round.

[0200] Optionally, the numeric state parameters can also be updated to obtain updated tree state parameters. Fig.12 , Fig.12 The structure block diagram of a tree state parameter 1200 provided by an embodiment of the present application is shown. The tree state parameter 1200 includes a first round of historical state parameters StateNode1 corresponding to the first round of historical layout parameters and a state parameter StateNode2 corresponding to the second round of target layout parameters.

[0201] Since there is no historical layout parameter corresponding to the target layout parameter in the historical layout table, the triggered interaction object is a null value NULL. The triggered interaction object of the second round can be represented by finishedChildNodes2 and configured as a null value NULL.

[0202] Furthermore, the interactive object of the first interface can be obtained, for example, by traversing the updated tree state parameters through the depth-first search algorithm DFS, so as to obtain the interactive object. The interactive object can be represented by triggerNodes2. Further, the target interactive object is determined based on the interactive object and the triggered object. At this time, at least one interactive object other than the triggered interactive object in the interactive objects of the first interface can be determined as the target interactive object. Please continue to refer to Fig.10 , Fig.10 The first interface 1000 shown includes interactive objects 1001, 1002, 1003, 1004 and 1005. At this time, the interactive object 1001 can be selected as the target interactive object, and the target interactive object can be represented by unfinishedUINode2.

[0203] At this time, the target interactive object can be triggered according to the interaction type of the target interactive object. The clickable property of unfinishedUINode2 is true, which means that the target interactive object can be clicked. Then performAction(AccessibilityNodeInfo.ACTION_CLICK) is called to trigger the click interaction. Click the interactive object 1001 and check the "My Schedule" option. Finally, prevStateNode is defined as the state node newStateNode, which is used to initialize the state parameters of the next round, and the current round of testing is completed.

[0204] For further information, see Fig.13 , Fig.13 A schematic diagram of a first interface 1300 of a calendar application provided in an embodiment of the present application is shown. Fig.13 The first interface shown may be the interface of the calendar application during the third round of detection, that is, the current round at this time is the third round, and the first interface 1300 may be the interface of "schedule grouping" in the calendar application. It can be represented by root3 Fig.13 The first interface 1300 of the third round in the diagram can be used to obtain target layout parameters based on the first interface 1300, and the target layout parameters can be represented by layoutNode3.

[0205] Furthermore, due to Fig.13 The current round corresponding to the first interface 1300 shown is the third round, so the historical layout table includes the historical hash value Hash1 of the first round, the historical hash value Hash2 of the second round, and the corresponding historical layout parameters.

[0206] The target hash value corresponding to the target layout parameter of the third round can be further calculated, and the target hash value of the third round can be represented by Hash3. It is easy to know that the first interface corresponding to the historical hash value Hash2 of the second round is the "schedule grouping" interface in the calendar application, so the historical hash value Hash2 of the second round in the historical layout table and the target hash value Hash3 of the third round are the same hash values.

[0207] At this time, the state parameters of the target layout parameters can be configured. Specifically, StateNode2 can be used to represent the historical state parameters of the second round corresponding to the historical hash value Hash2 of the second round, and StateNode3 can be used to represent the state parameters corresponding to the target layout parameters of the third round. StateNode3.Id can be used to represent the first identification information of the third round, and the first identification information of the third round can be configured as StateNode2.Id; StateNode3.parentId can be used to represent the second identification information of the third round, and the second identification information of the third round can be configured as StateNode2.parentId; StateNode3.finishedChildNodes can be used to represent the triggered state parameters of the third round, and the triggered state parameters of the third round can be configured as StateNode2.finishedChildNodes. Optionally, StateNode3 can also be added to the prevStateNode of the round before the current round, so that in the rounds after the current round, since StateNode3 has been added to the triggered interaction object finishedChildNodes2 of the previous round before the current round, the target interaction object corresponding to StateNode3 will no longer be used as the target interaction object in the rounds after the current round.

[0208] Optionally, the target hash value Hash3 and the target layout parameters of the third round may be stored in the history layout table to update the history layout table. Fig.14 , Fig.14 A schematic diagram of an update history layout table provided in an embodiment of the present application is shown. Fig.14 The historical layout table 1401 includes the historical hash value Hash1 of the first round, the historical hash value Hash2 of the second round, and the mapping relationship between the historical hash value and the historical state parameter. The historical layout table 1401 is updated by the target hash value Hash3 of the third round and the state parameter of the third round corresponding to the target hash value Hash3 of the third round to obtain the updated historical layout table 1402. Among them, Fig.14The target hash value and the first interface shown are both from the third round.

[0209] Optionally, the numeric state parameters can also be updated to obtain updated tree state parameters. Fig.15 , Fig.15 A schematic diagram of updating a tree state parameter provided by an embodiment of the present application is shown. The tree state parameter 1501 includes the historical state parameter StateNode1 of the first round and the historical state parameter StateNode2 of the second round corresponding to the historical layout parameter. The tree state parameter is updated by the state parameter StateNode3 of the current round (third round) to obtain the updated tree state parameter 1502.

[0210] Furthermore, the interactive object of the first interface can be obtained, for example, by traversing the updated tree state parameters through the depth-first search algorithm DFS, so as to obtain the interactive object, and the StateNode3 in the updated tree state parameters can be traversed. The interactive object can be represented by triggerNodes3. Furthermore, the target interactive object is determined based on the interactive object and the triggered object. At this time, at least one interactive object in the interactive objects of the first interface other than the triggered interactive object can be determined as the target interactive object. Please continue to refer to Fig.13 , Fig.13 The first interface 1300 shown includes interactive objects 1001, 1002, 1003, 1004 and 1005. Since the interactive object 1001 has been triggered in the second round, the interactive object 1005 can be used as the target interactive object at this time. The target interactive object can be represented by unfinishedUINode3.

[0211] At this time, the target interactive object can be triggered according to the interaction type of the target interactive object. The clickable property of unfinishedUINode3 is true, which means the target interactive object can be clicked. Then performAction(AccessibilityNodeInfo.ACTION_CLICK) is called to trigger the click interaction, and the interactive object 1005 is clicked to exit the "Schedule Grouping" interface. Finally, prevStateNode is defined as the state node StateNode3, which is used to initialize the state parameters of the next round, and the current round of testing is completed.

[0212] For further information, see Fig.16 , Fig.16 A schematic diagram of a first interface 1600 of a calendar application provided in an embodiment of the present application is shown. Fig.16The first interface shown may be the interface of the calendar application during the fourth round of detection, that is, the current round is the fourth round, and the first interface 1600 may be the interface of the "main interface" in the calendar application. Fig.16 The first interface 1600 of the fourth round in the flowchart can be used to obtain the target layout parameters based on the first interface 1600, and the target layout parameters can be represented by layoutNode4.

[0213] Furthermore, due to Fig.16 The current round corresponding to the first interface 1600 shown is the fourth round, so the historical layout table includes the historical hash value Hash1 of the first round, the historical hash value Hash2 of the second round (wherein the historical hash value Hash3 of the third round is the same as the historical hash value Hash2 of the second round) and the corresponding historical layout parameters.

[0214] The target hash value corresponding to the target layout parameter can be further calculated, and the target hash value of the fourth round can be represented by Hash4. It is easy to know that the first interface corresponding to the historical hash value Hash1 of the first round is the "main interface" interface in the calendar application, so the historical hash value Hash1 of the first round in the historical layout table and the target hash value Hash4 of the fourth round are the same historical hash values.

[0215] At this time, the state parameters of the target layout parameters can be configured. Specifically, StateNode1 can be used to represent the historical state parameters of the first round corresponding to the historical hash value Hash1 of the first round, StateNode4 can be used to represent the state parameters of the fourth round corresponding to the target layout parameters of the fourth round, StateNode4.Id can be used to represent the first identification information of the fourth round, and the first identification information of the fourth round can be configured as StateNode1.Id; StateNode4.parentId can be used to represent the second identification information of the fourth round, and the second identification information of the fourth round can be configured as StateNode1.parentId; StateNode4.finishedChildNodes can be used to represent the triggered state parameters of the fourth round, and the triggered state parameters of the fourth round can be configured as StateNode1.finishedChildNodes. Optionally, StateNode4 can also be added to the prevStateNode of the round before the current round, so that in the rounds after the current round, since StateNode4 has been added to the triggered interaction object finishedChildNodes3 of the previous round before the current round, the target interaction object corresponding to StateNode4 will no longer be used as the target interaction object in the rounds after the current round.

[0216] Optionally, the fourth round target hash value Hash4 and the target layout parameters may be stored in the history layout table to update the history layout table. Fig.17 , Fig.17 A schematic diagram of an update history layout table provided in an embodiment of the present application is shown. Fig.17 The historical layout table 1701 includes the historical hash value Hash1 of the first round, the historical hash value Hash3 of the third round, and the mapping relationship between the historical hash value and the historical state parameter. The historical layout table 1701 is updated by the target hash value Hash4 of the fourth round and the state parameter corresponding to the target hash value Hash4 of the fourth round to obtain the updated historical layout table 1702. Among them, Fig.17 The target hash value and the first interface shown in are both from the fourth round.

[0217] Optionally, the numeric state parameters can also be updated to obtain updated tree state parameters. Fig.18 , Fig.18A schematic diagram of updating a tree state parameter provided by an embodiment of the present application is shown. The tree state parameter 1801 includes the historical state parameter StateNode1 of the first round and the historical state parameter StateNode3 of the third round corresponding to the historical layout parameter. The tree state parameter is updated by the state parameter StateNode4 of the current round (the fourth round) to obtain the updated tree state parameter 1802.

[0218] Furthermore, the interactive object of the first interface can be obtained, for example, by traversing the updated tree state parameters through the depth-first search algorithm DFS, so as to obtain the interactive object, and the StateNode4 in the updated tree state parameters can be traversed. The interactive object can be characterized by triggerNodes4. Furthermore, the target interactive object is determined based on the interactive object and the triggered object. At this time, at least one interactive object in the interactive objects of the first interface other than the triggered interactive object can be determined as the target interactive object. Please continue to refer to Fig.16 , Fig.16 The first interface 1600 shown includes interactive object 801, interactive object 802 and interactive object 803. Since finishedChildNodes4 and finishedChildNodes1 are both NULL at this time, interactive object 801 can continue to be used as the target interactive object. The target interactive object can be represented by unfinishedUINode4.

[0219] At this time, the target interactive object can be triggered according to the interaction type of the target interactive object. The clickable property of unfinishedUINode4 is true, which means that the target interactive object can be clicked. Then performAction(AccessibilityNodeInfo.ACTION_CLICK) is called to trigger the click interaction. Click the interactive object 801 to re-enter the "Schedule Grouping" interface. Finally, prevStateNode is defined as the state node StateNode4, which is used to initialize the state parameters of the next round, and the current round of testing is completed.

[0220] For further information, see Fig.19 , Fig.19 A schematic diagram of a first interface 1900 of a calendar application provided in an embodiment of the present application is shown. Fig.19 The first interface shown may be the interface of the calendar application during the fifth round of detection, that is, the current round is the fifth round, and the first interface 1900 may be the interface of "schedule grouping" in the calendar application. Fig.19The first interface 1900 of the fifth round in the diagram can be used to obtain target layout parameters based on the first interface 1900, and the target layout parameters can be represented by layoutNode5.

[0221] Furthermore, due to Fig.19 The current round corresponding to the first interface 1900 shown is the fifth round, so the historical layout table includes the historical hash value Hash3 of the third round, the historical hash value Hash4 of the fourth round (wherein the historical hash value Hash2 of the second round is the same as the historical hash value Hash3 of the third round, and the historical hash value Hash1 of the first round is the same as the historical hash value Hash4 of the fourth round) and the corresponding historical layout parameters.

[0222] The target hash value corresponding to the target layout parameter can be further calculated, and the target hash value of the fifth round can be represented by Hash5. It is easy to know that the first interface corresponding to the historical hash value Hash3 of the third round is the "schedule grouping" interface in the calendar application, so the historical hash value Hash3 of the historical layout table and the target hash value Hash5 of the fifth round are the same hash value.

[0223] At this time, the state parameters of the target layout parameters can be configured. Specifically, StateNode3 can be used to represent the historical state parameters of the third round corresponding to the historical hash value Hash3 of the third round, StateNode5 can be used to represent the state parameters of the fifth round corresponding to the target layout parameters of the fifth round, StateNode5.Id can be used to represent the first identification information of the fifth round, and the first identification information of the fifth round can be configured as StateNode3.Id; StateNode5.parentId can be used to represent the second identification information of the fifth round, and the second identification information of the fifth round can be configured as StateNode3.parentId; StateNode5.finishedChildNodes can be used to represent the triggered state parameters of the fifth round, and the triggered state parameters of the fifth round can be configured as StateNode3.finishedChildNodes.

[0224] Optionally, the fifth round target hash value Hash5 and the target layout parameters may be stored in the history layout table to update the history layout table. Fig. 20 , Fig. 20 A schematic diagram of an update history layout table provided in an embodiment of the present application is shown. Fig. 20The historical layout table 2001 includes the historical hash value Hash4 of the fourth round, the historical hash value Hash3 of the third round, and the mapping relationship between the historical hash value and the historical state parameter. The historical layout table 2001 is updated by the target hash value Hash5 of the fifth round and the state parameter of the fifth round corresponding to the target hash value Hash5 of the fifth round to obtain the updated historical layout table 2002. Fig. 20 The target hash value and the first interface shown in are both from the fifth round.

[0225] Optionally, the numeric state parameters can also be updated to obtain updated tree state parameters. Fig.21 , Fig.21 A schematic diagram of updating a tree state parameter provided by an embodiment of the present application is shown. The tree state parameter 2101 includes the historical state parameter StateNode3 of the third round corresponding to the historical layout parameter of the third round and the historical state parameter StateNode4 of the fourth round. The tree state parameter is updated by the state parameter StateNode5 of the current round (fifth round) to obtain the updated tree state parameter 2102.

[0226] Furthermore, the interactive object of the first interface can be obtained, for example, by traversing the updated tree state parameters through the depth-first search algorithm DFS, so as to obtain the interactive object, and the StateNode5 in the updated tree state parameters can be traversed. The interactive object can be represented by triggerNodes5. Furthermore, the target interactive object is determined based on the interactive object and the triggered object. At this time, at least one interactive object in the interactive objects of the first interface other than the triggered interactive object can be determined as the target interactive object. Please continue to refer to Fig.19 , Fig.19 The first interface 1900 shown includes interactive objects 1001, 1002, 1003, 1004, and 1005. Since the interactive object 1001 has been triggered in the second round and the interactive object 1005 has been triggered in the third round, the interactive object 1002 can be used as the target interactive object at this time. The target interactive object can be represented by unfinishedUINode5.

[0227] At this time, the target interactive object can be triggered according to the interaction type of the target interactive object. The clickable property of unfinishedUINode3 is true, which means the target interactive object can be clicked. Then performAction(AccessibilityNodeInfo.ACTION_CLICK) is called to trigger the click interaction, and the interactive object 1002, that is, the "Birthday" option, is clicked. Finally, prevStateNode is defined as the state node StateNode5, which is used to initialize the state parameters of the next round, and the current round of testing ends.

[0228] See also Fig. 22 , Fig. 22 A structural block diagram of a test device 2200 provided in an embodiment of the present application is shown. The test device 2200 includes: an acquisition unit 2210, a first determination unit 2220, a second determination unit 2230, a third determination unit 2240 and a test unit 2250.

[0229] The acquisition unit 2210 is used to acquire the first interface of the application to be tested in the current round.

[0230] Furthermore, the acquisition unit 2210 can also be used to configure the target application as an application to be tested, wherein the target application is an application that needs to be tested; if a system event is detected, the first interface of the application to be tested in the current round is obtained, wherein the system event is triggered when a window change event of the electronic device is detected, and the window change event includes at least one of text change, image loading, notification pop-up window and page switching.

[0231] Furthermore, the acquisition unit 2210 can also be used to continuously acquire new system events until no new system events are received if a system event is detected; and acquire the interface corresponding to the new system event as the first interface of the application to be tested in the current round.

[0232] Furthermore, the acquisition unit 2210 can also be used to obtain the response time of the system event if a system event is detected; if the response time is greater than a specified threshold, it is determined that the interface of the application to be tested is stuck and recorded in the system log; and new system events are continuously obtained until no new system events are received.

[0233] The first determining unit 2220 is configured to determine target layout parameters of the first interface.

[0234] The second determination unit 2230 is used to determine the state parameters of the target layout parameters based on the target layout parameters and the historical layout table, wherein the historical layout table includes the historical layout parameters before the current round and the historical state parameters corresponding to the historical layout parameters, and the state parameters include parameters for characterizing a triggered interactive object that has been triggered.

[0235] Furthermore, the second determination unit 2230 can also be used to search the historical layout parameters corresponding to the target layout parameters in the historical layout table as designated layout parameters; if the designated layout parameters exist, the state parameters of the target layout parameters are determined based on the historical state parameters corresponding to the designated layout parameters; if the designated layout parameters do not exist, a null value is configured for the state parameters of the target layout parameters as the state parameters.

[0236] Furthermore, the second determination unit 2230 can also be used to obtain a target hash value corresponding to the target layout parameter; if there is a historical hash value identical to the target hash value in the historical layout table, it is determined that the specified layout parameter exists, and the specified layout parameter is a historical layout parameter corresponding to the historical hash value identical to the target hash value; if there is no historical hash value identical to the target hash value in the historical layout table, it is determined that the specified layout parameter does not exist.

[0237] Further, the second determination unit 2230 can also be used to obtain a first intermediate hash value based on the type parameter of the target layout parameter; obtain a second intermediate hash value based on the boundary parameter of the target layout parameter; obtain a third intermediate hash value based on the sub-interface parameter of the target layout parameter; and obtain a target hash value corresponding to the target layout parameter based on the first intermediate hash value, the second intermediate hash value, and the third intermediate hash value.

[0238] Furthermore, the second determination unit 2230 can also be used to configure the first identification information of the state parameter based on the historical first identification information in the historical state parameter if the specified layout parameter exists, wherein the first identification information is used to represent the information of the current round; configure the second identification information of the state parameter based on the historical second identification information in the historical state parameter, wherein the second identification information is used to represent the information of the round before the current round; configure the triggered interaction object of the state parameter based on the historical triggered interaction object in the historical state parameter; add the specified triggered interaction object corresponding to the specified round into the triggered interaction object to update the triggered interaction object, wherein the specified round includes the adjacent round before the current round.

[0239] Furthermore, the second determining unit 2230 may also be configured to add the target layout parameters and corresponding state parameters to the historical layout table to update the historical layout table.

[0240] The third determining unit 2240 is used to determine, based on the state parameter, at least one interactive object among the interactive objects of the first interface except the triggered interactive object as a target interactive object.

[0241] Furthermore, the third determination unit 2240 can also be used to update the tree state parameters based on the state parameters, wherein the tree state parameters include parameters of a tree structure composed of historical state parameters of rounds before the current round; determine the interactive objects of the first interface based on the updated tree state parameters; if there is at least one interactive object that is different from the triggered interactive object, determine at least one interactive object among the interactive objects of the first interface except the triggered interactive object as the target interactive object.

[0242] Furthermore, the third determination unit 2240 can also be used to traverse the updated tree state parameters to determine the interactive objects of the first interface if there are no historical layout parameters corresponding to the target layout parameters in the historical layout table; if there are historical layout parameters corresponding to the target layout parameters in the historical layout table, obtain the historical interactive objects in the historical state parameters corresponding to the historical layout parameters corresponding to the target layout parameters as the interactive objects of the first interface.

[0243] The testing unit 2250 is used to trigger the target interactive object to complete the current round of testing of the electronic device.

[0244] Furthermore, the test unit 2250 can also be used to obtain the interaction type of the target interaction object, and based on the interaction type, trigger the target interaction object to complete the current round of testing of the electronic device. The interaction type includes input interaction, sliding interaction or click interaction.

[0245] Furthermore, the testing unit 2250 may also be configured to use the next round of the current round as a new current round, and return to execute the first interface of obtaining the application to be tested of the current round and subsequent steps.

[0246] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0247] In several embodiments provided in the present application, the coupling between the units may be electrical, mechanical or other forms of coupling. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0248] See also Fig.23 , Fig.23 The structural block diagram of an electronic device 110 provided in an embodiment of the present application is shown. The electronic device 110 may be a smart phone, a laptop computer, a desktop computer, a tablet computer, a wireless headset, etc. The electronic device 110 in the present application may include one or more of the following components: a processor 111, a memory 112, and one or more application programs, wherein the processor 111 is electrically connected to the memory 112, and the one or more program configurations are used to execute the methods described in the various embodiments of the aforementioned test method.

[0249] The processor 111 may include one or more processing cores. The processor 111 uses various interfaces and lines to connect various parts of the entire electronic device 110, and executes various functions and processes data of the electronic device 110 by running or executing instructions, programs, code sets or instruction sets stored in the memory 112, and calling data stored in the memory 112. Optionally, the processor 111 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 111 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and computer programs; the GPU is responsible for rendering and drawing display content; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 111, and it can be implemented separately through a communication chip. Specifically, the method described in the above embodiment can be executed by one or more processors 111.

[0250] For some embodiments, the memory 112 may include a random access memory (RAM) or a read-only memory (ROM). The memory 112 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 112 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the following various method embodiments, etc. The data storage area may also store data created by the electronic device 110 during use, etc.

[0251] See also Fig.24 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 2400 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0252] The computer readable storage medium 2400 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 2400 includes a non-transitory computer-readable storage medium. The computer readable storage medium 2400 has storage space for program code 2410 that performs any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 2410 can be compressed, for example, in an appropriate form.

[0253] Please refer to Fig.25 , which shows a structural block diagram 2500 of a computer program product provided by an embodiment of the present application. The computer program product 2500 includes a computer program / instruction 2510, and when the computer program / instruction 2510 is executed by a processor, the steps of the above method are implemented.

[0254] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A testing method, characterized in that: Applied to electronic equipment, the method comprises: Get the first interface of the application to be tested in the current round; Determining target layout parameters of the first interface; Based on the target layout parameters and the historical layout table, determining the state parameters of the target layout parameters, wherein the historical layout table includes the historical layout parameters before the current round and the historical state parameters corresponding to the historical layout parameters, and the state parameters include the triggered interactive objects used to characterize the triggered objects; Based on the state parameter, determining at least one interactive object other than the triggered interactive object among the interactive objects of the first interface as a target interactive object; The target interactive object is triggered to complete the current round of testing of the electronic device.

2. The method according to claim 1, characterized in that The step of determining the state parameters of the target layout parameters based on the target layout parameters and the historical layout table includes: Searching the historical layout parameters in the historical layout table corresponding to the target layout parameters as designated layout parameters; If the specified layout parameter exists, determining the state parameter of the target layout parameter based on the historical state parameter corresponding to the specified layout parameter; If the designated layout parameter does not exist, a null value is configured for the state parameter of the target layout parameter as the state parameter.

3. The method according to claim 2, characterized in that The layout parameters correspond to hash values, and searching the historical layout parameters corresponding to the target layout parameters in the historical layout table as the designated layout parameters includes: Obtaining a target hash value corresponding to the target layout parameter; If there is a historical hash value identical to the target hash value in the historical layout table, it is determined that the specified layout parameter exists, and the specified layout parameter is a historical layout parameter corresponding to the historical hash value identical to the target hash value; If the historical hash value identical to the target hash value does not exist in the historical layout table, it is determined that the specified layout parameter does not exist.

4. The method according to claim 3, characterized in that The target layout parameters include type parameters, boundary parameters, and sub-interface parameters, the sub-interface parameters include layout parameters of a sub-interface belonging to the first interface, and obtaining a target hash value corresponding to the target layout parameters includes: Based on the type parameter of the target layout parameter, obtaining a first intermediate hash value; Based on the boundary parameter of the target layout parameter, obtaining a second intermediate hash value; Based on the sub-interface parameters of the target layout parameters, obtaining a third intermediate hash value; A target hash value corresponding to the target layout parameter is obtained based on the first intermediate hash value, the second intermediate hash value, and the third intermediate hash value.

5. The method according to claim 2, characterized in that: If the specified layout parameter exists, determining the state parameter of the target layout parameter based on the historical state parameter corresponding to the specified layout parameter includes: If the specified layout parameter exists, configuring the first identification information of the state parameter based on the historical first identification information in the historical state parameter, wherein the first identification information is used to represent information of the current round; configuring the second identification information of the state parameter based on the historical second identification information in the historical state parameter, wherein the second identification information is used to represent information of a round before the current round; Configure the triggered interaction object of the state parameter based on the historical triggered interaction object in the historical state parameter; Adding a designated triggered interaction object corresponding to a designated round into the triggered interaction object to update the triggered interaction object, wherein the designated round includes a round adjacent to the current round.

6. The method according to claim 2, characterized in that If the specified layout parameter does not exist, a null value is configured for the state parameter of the target layout parameter as the state parameter, and further includes: The target layout parameters and corresponding state parameters are added to the historical layout table to update the historical layout table.

7. The method according to claim 1, characterized in that The determining, based on the state parameter, at least one interactive object other than the triggered interactive object among the interactive objects of the first interface as a target interactive object includes: Based on the state parameters, updating the tree state parameters, wherein the tree state parameters include parameters of a tree structure composed of historical state parameters of rounds before the current round; Determine the interactive object of the first interface based on the updated tree state parameters; If there is at least one interactive object that is different from the triggered interactive object, at least one interactive object other than the triggered interactive object among the interactive objects of the first interface is determined as a target interactive object.

8. The method according to claim 7, characterized in that The determining the interactive object of the first interface based on the updated tree state parameter includes: If there is no historical layout parameter corresponding to the target layout parameter in the historical layout table, traversing the updated tree state parameters to determine the interactive object of the first interface; If there are historical layout parameters corresponding to the target layout parameters in the historical layout table, then historical interaction objects in historical state parameters corresponding to the historical layout parameters corresponding to the target layout parameters are obtained as interaction objects of the first interface.

9. The method according to claim 1, characterized in that: The triggering of the target interactive object to complete the current round of testing of the electronic device includes: Obtaining the interaction type of the target interaction object; Based on the interaction type, the target interaction object is triggered to complete the current round of testing of the electronic device.

10. The method according to claim 9, characterized in that The interaction type includes input interaction, sliding interaction or clicking interaction.

11. The method according to claim 1, characterized in that: The step of obtaining the first interface of the application to be tested in the current round includes: configuring a target application as an application to be tested, wherein the target application is an application to be tested; If a system event is detected, the first interface of the application to be tested in the current round is obtained, wherein the system event is triggered when a window change event of the electronic device is detected, and the window change event includes at least one of text change, image loading, notification pop-up window and page switching.

12. The method according to claim 11, characterized in that If a system event is detected, obtaining the first interface of the application to be tested in the current round includes: If a system event is detected, continue to obtain new system events until no new system events are received; The interface corresponding to the new system event is obtained as the first interface of the application to be tested in the current round.

13. The method according to claim 12, characterized in that If a system event is detected, continuously acquiring new system events until no new system events are received includes: If a system event is detected, obtaining the response time of the system event; If the response time is greater than a specified threshold, it is determined that the interface of the application to be tested is stuck and the information is recorded in the system log; Continue to obtain new system events until no new system events are received.

14. The method according to claim 1, characterized in that After triggering the target interactive object to complete the current round of testing on the electronic device, the method further includes: The next round of the current round is used as a new current round, and the first interface of the application program to be tested of the current round and subsequent steps are returned to be executed.

15. A testing device, characterized in that: Applied to electronic equipment, the device comprises: An acquisition unit, used for acquiring the first interface of the application to be tested in the current round; A first determining unit, used to determine a target layout parameter of the first interface; A second determining unit is configured to determine a state parameter of the target layout parameter based on the target layout parameter and a historical layout table, wherein the historical layout table includes historical layout parameters before the current round and historical state parameters corresponding to the historical layout parameters, and the state parameters include a triggered interactive object used to characterize a triggered interactive object; A third determining unit, configured to determine, based on the state parameter, at least one interactive object among the interactive objects of the first interface except the triggered interactive object as a target interactive object; The testing unit is used to trigger the target interactive object to complete the current round of testing of the electronic device.

16. An electronic device, characterized in that: include: one or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1-14.

17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 14.

18. A computer program product, characterized in that The method comprises a computer program / instruction, which implements the method according to any one of claims 1 to 14 when executed by a processor.