An application APP testing method, device, electronic device and storage medium

By determining the poco tree structure in the app and automatically comparing the node content, the problems of high manual testing cost and low efficiency in app internationalization testing are solved, and efficient and accurate automated testing is achieved.

CN114020636BActive Publication Date: 2025-09-23CHINA UNIONPAY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111407428.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-24
Publication Date
2025-09-23
Estimated Expiration
2041-11-24

AI Technical Summary

Technical Problem

In the existing technology, manual testing during APP internationalization testing consumes a lot of human resources and costs, the test accuracy cannot be guaranteed, and the test efficiency is low.

Method used

By determining the poco tree structure of the APP, determining the target path according to the node to be tested, and comparing the display content of the node to be tested with the content in the development APP file, automated testing is achieved.

Benefits of technology

Automatically complete the testing of each node in each language mode, avoiding the high cost and low efficiency of manual testing and improving the accuracy and efficiency of testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114020636B_ABST
    Figure CN114020636B_ABST
Patent Text Reader

Abstract

The present invention discloses an application APP testing method, device, electronic device and storage medium, the method comprising: determining the poco tree structure of an APP, determining the target path corresponding to the node to be tested in the poco tree structure according to the node to be tested in the APP; determining the display content of the node to be tested according to the target path, comparing the display content of the node to be tested with the content in the file used to develop the APP, and completing the test of the node to be tested. Based on the above scheme, the test of each node in each language mode can be automatically completed, avoiding the problems of manual testing consuming large human resources and costs, the inability to guarantee the accuracy of the test, and the low efficiency of the test.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of application APP testing technology, and in particular to an application APP testing method, device, electronic device and storage medium. Background Art

[0002] To support overseas user growth, a comprehensive app with support in major global languages ​​is required. Once the app is developed, it needs to be tested to ensure accuracy and efficiency during localization.

[0003] In the internationalization of apps, current testing typically involves manually verifying the text in the languages ​​of 18 different countries and regions. This involves comparing the text in the app with the text in the development files. The problems with manual testing are obvious. First, due to the limited proficiency of testers in multiple international languages, further understanding and learning of these languages ​​is required during the testing process, which consumes significant human resources and costs, and the accuracy of the tests cannot be guaranteed. Second, manual testing of text in the languages ​​of 18 different countries and regions results in low app testing efficiency. Summary of the Invention

[0004] The embodiments of the present invention provide an application APP testing method, device, electronic device and storage medium to solve the problems of existing manual testing technology that consumes a lot of human resources and costs, the accuracy of the test cannot be guaranteed, and the test efficiency is low.

[0005] An embodiment of the present invention provides an application APP testing method, the method comprising:

[0006] Determine the poco tree structure of the APP, and determine the target path corresponding to the node to be tested in the poco tree structure according to the node to be tested in the APP;

[0007] The display content of the node to be tested is determined according to the target path, and the display content of the node to be tested is compared with the content in the file used to develop the APP to complete the test of the node to be tested.

[0008] Furthermore, determining the target path corresponding to the node to be tested in the poco tree structure according to the node to be tested in the APP includes:

[0009] Determine the name attribute of the node to be tested in the APP, determine the target node with the same name attribute in the poco tree structure, and determine the path to which the target node belongs as the target path corresponding to the node to be tested.

[0010] Further, determining the path to which the target node belongs as the target path corresponding to the node to be tested includes:

[0011] Determine the path to which the target node belongs as the candidate path corresponding to the node to be tested;

[0012] If, in addition to the node to be tested, there is a parent node other than Other in the candidate path, the path between the non-Other node closest to the node to be tested and the node to be tested is used as the target path.

[0013] Furthermore, the test of the node to be tested is completed by comparing the displayed content of the node to be tested with the content in the file used to develop the APP, including:

[0014] Determining a target key value corresponding to the display content of the node to be tested according to the display content of the node to be tested and a preset correspondence between the display content and the key value;

[0015] Determine the content corresponding to the target key value in the file used to develop the APP, compare the content corresponding to the target key value with the display content of the node to be tested, and complete the test of the node to be tested.

[0016] Furthermore, determining the content corresponding to the target key value in the file used to develop the APP, comparing the content corresponding to the target key value with the display content of the node to be tested, and completing the test of the node to be tested includes:

[0017] Obtain the current language mode of the APP, determine the content in the language mode in the content corresponding to the target key value in the file used to develop the APP, if the content in the language mode is the same as the display content of the node to be tested, determine that the test of the node to be tested is successful; if the content in the language mode is different from the display content of the node to be tested, determine that the test of the node to be tested has failed.

[0018] Furthermore, the method further comprises:

[0019] According to the screen size of the device on which the APP is installed, the size of the nodes in each path in the poco tree structure, and the positional relationship between the nodes and the node to be clicked, the position of the node to be clicked on the screen is determined, and the click event on the node to be clicked is completed according to the position of the node to be clicked on the screen.

[0020] On the other hand, an embodiment of the present invention provides an application APP testing device, the device comprising:

[0021] A determination module is used to determine the poco tree structure of the APP, and determine the target path corresponding to the node to be tested in the poco tree structure according to the node to be tested in the APP;

[0022] The testing module is used to determine the display content of the node to be tested according to the target path, compare the display content of the node to be tested with the content in the file used to develop the APP, and complete the test of the node to be tested.

[0023] Furthermore, the determination module is specifically used to determine the name attribute of the node to be tested in the APP, determine the target node with the same name attribute in the poco tree structure, and determine the path to which the target node belongs as the target path corresponding to the node to be tested.

[0024] Furthermore, the determination module is specifically used to determine the path to which the target node belongs as the candidate path corresponding to the node to be tested; if there is a non-Other parent node in the candidate path other than the node to be tested, the path between the non-Other node closest to the node to be tested and the node to be tested is used as the target path.

[0025] Furthermore, the test module is specifically used to determine the target key value corresponding to the display content of the node to be tested based on the display content of the node to be tested and the pre-set correspondence between the display content and the key value; determine the content corresponding to the target key value in the file used to develop the APP, compare the content corresponding to the target key value with the display content of the node to be tested, and complete the test of the node to be tested.

[0026] Furthermore, the test module is specifically used to obtain the current language mode of the APP, determine the content under the language mode in the content corresponding to the target key value in the file used to develop the APP, if the content under the language mode is the same as the display content of the node to be tested, then it is determined that the test of the node to be tested is successful; if the content under the language mode is different from the display content of the node to be tested, then it is determined that the test of the node to be tested has failed.

[0027] Furthermore, the test module is also used to determine the position of the node to be clicked on the screen based on the screen size of the device on which the APP is installed, the size of the node in each path in the poco tree structure, and the positional relationship between the node and the node to be clicked, and complete the click event on the node to be clicked based on the position of the node to be clicked on the screen.

[0028] On the other hand, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0029] Memory for storing computer programs;

[0030] The processor is configured to implement any of the above method steps when executing a program stored in the memory.

[0031] On the other hand, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the method steps described above is implemented.

[0032] An embodiment of the present invention provides an application APP testing method, device, electronic device and storage medium, the method comprising: determining the poco tree structure of the APP, and determining the target path corresponding to the node to be tested in the poco tree structure based on the node to be tested in the APP; determining the display content of the node to be tested based on the target path, and completing the test of the node to be tested by comparing the display content of the node to be tested with the content in the file used to develop the APP.

[0033] The above technical solution has the following advantages or beneficial effects:

[0034] Because in the embodiment of the present invention, for the APP to be tested, the poco tree structure of the APP is first determined, and the target path corresponding to the node to be tested is determined from the poco tree structure for the node to be tested in the APP. Finally, the display content of the node to be tested is determined according to the target path, and the display content of the node to be tested is compared with the content in the file used to develop the APP to complete the test of the node to be tested. Based on the above scheme, the test of each node in each language mode can be automatically completed, avoiding the problems of manual testing consuming large human resources and costs, the inability to guarantee the accuracy of the test, and the low efficiency of the test. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0036] Figure 1 A schematic diagram of the application APP testing process provided by an embodiment of the present invention;

[0037] Figure 2 A schematic diagram of determining a target path provided by an embodiment of the present invention;

[0038] Figure 3 A schematic diagram of determining a node to be clicked provided by an embodiment of the present invention;

[0039] Figure 4 A schematic diagram of the structure of an application APP testing device provided in an embodiment of the present invention;

[0040] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0041] The present invention will be further described in detail below with reference to the accompanying drawings. It is apparent that the embodiments described are only some, not all, of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are intended to fall within the scope of protection of the present invention.

[0042] Example 1:

[0043] Figure 1 A schematic diagram of an application testing process provided in an embodiment of the present invention includes the following steps:

[0044] S101: Determine the poco tree structure of the APP, and determine the target path corresponding to the node to be tested in the poco tree structure according to the node to be tested in the APP.

[0045] S102: Determine the display content of the node to be tested according to the target path, compare the display content of the node to be tested with the content in the file used to develop the APP, and complete the test of the node to be tested.

[0046] The APP testing method provided in the embodiment of the present invention is applied to electronic devices. The embodiment of the present invention is mainly a testing method for iOS APPs. The electronic device can be an iPhone, iPad, or other device with an iOS APP installed.

[0047] The APP testing method provided by the embodiment of the present invention is a testing method based on the poco tree of the internationalized APP on the iOS side. During the APP testing process, the poco node name of the Android system can be bound to the id in the code for search, but the iOS system does not have a concept similar to the node id of the Android system. When searching for the poco node, it is necessary to search down to the node to be tested in the poco tree one level at a time, and the iOS-side poco tree nodes directly mapped by conventional testing tools are mostly "Other" nodes, and the names of non-"Other" nodes will change as the iOS system switches languages. Therefore, the global multilingual APP cannot find the poco tree node by using the name of the node to be tested. A more complete poco tree node retrieval device is needed to meet the needs of global language APP testing business. In order to solve the above problems, the embodiment of the present invention provides a testing method based on the poco tree of the international multilingual APP on the iOS side. Under the premise of focusing on solving the testing of multilingual texts of international language APPs, it takes into account the improvement of test efficiency, supports multi-machine parallel testing at the same time, and ensures the integrity and accuracy of the test.

[0048] In an embodiment of the present invention, for the APP to be tested, the POCO tree structure of the APP is first determined, and the POCO tree structure includes multiple paths of the APP. For the node to be tested, the target path corresponding to the node to be tested in the POCO tree structure is determined. The display content of the node to be tested is determined according to the target path, and the display content of the node to be tested is compared with the content in the file used to develop the APP to complete the test of the node to be tested. If the comparison is successful, the test of the node to be tested is successful. If the comparison fails, the test of the node to be tested fails.

[0049] This embodiment of the present invention uses the POCO tree structure to determine the target path corresponding to the node to be tested, and then determines the display content of the node to be tested based on the target path. The node to be tested is then tested based on its display content. This solves the problem that the names of non-"Other" nodes in the POCO tree change when the iOS system switches languages, affecting test results.

[0050] Because in the embodiment of the present invention, for the APP to be tested, the poco tree structure of the APP is first determined, and the target path corresponding to the node to be tested is determined from the poco tree structure for the node to be tested in the APP. Finally, the display content of the node to be tested is determined according to the target path, and the display content of the node to be tested is compared with the content in the file used to develop the APP to complete the test of the node to be tested. Based on the above scheme, the test of each node in each language mode can be automatically completed, avoiding the problems of manual testing consuming large human resources and costs, the inability to guarantee the accuracy of the test, and the low efficiency of the test.

[0051] In an embodiment of the present invention, determining the target path corresponding to the node to be tested in the poco tree structure according to the node to be tested in the APP includes:

[0052] Determine the name attribute of the node to be tested in the APP, determine the target node with the same name attribute in the poco tree structure, and determine the path to which the target node belongs as the target path corresponding to the node to be tested.

[0053] Each node in the Poco tree and the node to be tested include a name attribute. The name attribute of the node to be tested in the APP and the name attribute of each node in the Poco tree are determined. The target node with the same name attribute as the node to be tested is determined in the Poco tree through name attribute matching, and the path to which the determined target node belongs is determined as the target path corresponding to the node to be tested.

[0054] It should be noted that when writing a case, the test case is compiled according to the specific copy. Therefore, after finding the node to be tested, the target path corresponding to the node to be tested is determined. The convenient way is to use the copy to find this node. Therefore, when determining the target path, the name attribute of the last node of the path in the Poco tree is consistent with the copy to be tested, and then the target path is determined.

[0055] If the name attribute of the last node included in the path in the Poco tree is the same as the name attribute of the node to be tested, the path is determined as the target path. The target path determined at this time is longer and contains more nodes, which takes a long time to operate during testing, reducing the test efficiency. In order to optimize the target path, in an embodiment of the present invention, determining the path to which the target node belongs as the target path corresponding to the node to be tested includes:

[0056] Determine the path to which the target node belongs as the candidate path corresponding to the node to be tested;

[0057] If, in addition to the node to be tested, there is a parent node other than Other in the candidate path, the path between the non-Other node closest to the node to be tested and the node to be tested is used as the target path.

[0058] In an embodiment of the present invention, if the name attribute of the last node contained in the path in the Poco tree is the same as the name attribute of the node to be tested, the path is determined as a candidate path. Then, it is determined whether there is a parent node other than the node to be tested in the candidate path. If so, the parent node is used as the root node, and the path from the root node to the node to be tested is used as the target path. It should be noted that if there are multiple parent nodes other than Other in addition to the node to be tested, you can select any one of the parent nodes other than Other as the root node, use the parent node as the root node, and use the path from the root node to the node to be tested as the target path. Preferably, the non-Other node closest to the node to be tested can be selected as the root node according to the shortest path principle, and the path from the root node to the node to be tested can be used as the target path. Figure 2 As shown, Figure 2 The Window node is the root node in the candidate path. Figure 2 The non-Other node in is the parent node, Figure 2 The non-Other node in the query is used as the root node, and the path from the non-Other node to the POCO node to be tested is used as the target path. Use the non-Other node to directly output the search path to find the POCO node to be tested.

[0059] In this embodiment of the present invention, if the name attribute of the last node in a path in the Poco tree is the same as the name attribute of the node to be tested, the path is determined as a candidate path. If a candidate path contains a parent node other than the node to be tested that is not named "Other," the path from the nearest non-Other node to the node to be tested is used as the target path. This reduces the length of the target path and improves the efficiency of testing the node to be tested.

[0060] In an embodiment of the present invention, the test of the node to be tested is completed by comparing the displayed content of the node to be tested with the content in the file used to develop the APP, including:

[0061] Determining a target key value corresponding to the display content of the node to be tested according to the display content of the node to be tested and a preset correspondence between the display content and the key value;

[0062] Determine the content corresponding to the target key value in the file used to develop the APP, compare the content corresponding to the target key value with the display content of the node to be tested, and complete the test of the node to be tested.

[0063] The display content of the node to be tested is generally the display name of the node to be tested, and a correspondence between the display content and the key value is pre-set. For example, the key value corresponding to the display content "payment" is a, the key value corresponding to "balance" is b, and so on. According to the correspondence between the key values ​​to be tested, the target key value corresponding to the display content of the node to be tested is determined. There is a corresponding key value for each language in the file used to develop the APP, and the key values ​​corresponding to the contents of synonymous expressions in different languages ​​are the same. Determine the content corresponding to the target key value in the file used to develop the APP. For example, if the target key value is a, then determine the content corresponding to the target key value a in the file used to develop the APP, and the content corresponding to the target key value a includes content in various languages. Then compare the content corresponding to the target key value with the display content of the node to be tested. If the content corresponding to the target key value contains the same content as the display content of the node to be tested, it is determined that the test of the node to be tested is successful. If the content corresponding to the target key value does not contain the same content as the display content of the node to be tested, it is determined that the test of the node to be tested has failed.

[0064] To further improve testing efficiency, in an embodiment of the present invention, determining the content corresponding to the target key value in the file used to develop the APP, comparing the content corresponding to the target key value with the display content of the node to be tested, and completing the test of the node to be tested includes:

[0065] Obtain the current language mode of the APP, determine the content in the language mode in the content corresponding to the target key value in the file used to develop the APP, if the content in the language mode is the same as the display content of the node to be tested, determine that the test of the node to be tested is successful; if the content in the language mode is different from the display content of the node to be tested, determine that the test of the node to be tested has failed.

[0066] First, obtain the current language mode of the APP, for example, the current language mode is Chinese. Then determine the content in the language mode in the content corresponding to the target key value in the file used to develop the APP. Taking the target key value a corresponding to the content "payment" displayed by the node to be tested as an example, determine whether the content in the Chinese mode corresponding to the target key value a in the file used to develop the APP is "payment". If so, it is determined that the test of the node to be tested is successful. If not, it is determined that the test of the node to be tested has failed.

[0067] In an embodiment of the present invention, the current language mode of the APP is obtained, and the content in the language mode corresponding to the target key value in the file used to develop the APP is determined. If the content in the language mode is the same as the displayed content of the node to be tested, it is determined that the test of the node to be tested is successful. If the content in the language mode is different from the displayed content of the node to be tested, it is determined that the test of the node to be tested fails. There is no need to compare all the content corresponding to the target key value in the file used to develop the APP with the displayed content of the node to be tested, which further improves the test efficiency.

[0068] In the POCO tree search device, the node path in the device is output and the node name attribute is used to print the node name. If the name is consistent with the standard value of the node to be tested, the path is correct. However, the path is too long at this time, which will take up too much search time. We will continue to optimize the search path. Except for the last node, if there is a parent node that is not "Other", it will be directly used as the root node to avoid the reduction of test efficiency due to the long POCO node search path.

[0069] Use log viewer to print the path, and manually edit the poco tree search path according to the printed path. For example, if the printed path is [0, 0, 0, 1], then search from the root node in sequence for the Other node with index 0, the Other node with index 0, the Other node with index 0, and the Other node with index 1, and print the node name through the node name attribute.

[0070] When the actual value of the node child cannot be retrieved, offspring output is required. As shown in the figure above, the path is retrieved from the root node in sequence: Other node with index 0, Other node with index 0, Other node with index 0, and Offspring node with index 1. The node name is printed through the node name attribute.

[0071] In an embodiment of the present invention, for nodes that need to be clicked but cannot directly expose the path through the POCO search device (such as pictures and other controls), the positions of adjacent nodes can be calculated according to the screen size, and the adjacent nodes that can output the path are used to trigger the click event of the node to be tested. The method also includes:

[0072] According to the screen size of the device on which the APP is installed, the size of the nodes in each path in the poco tree structure, and the positional relationship between the nodes and the node to be clicked, the position of the node to be clicked on the screen is determined, and the click event of the node to be clicked is completed according to the position of the node to be clicked on the screen, and the test of the next node to be tested is carried out.

[0073] by Figure 3 For example, when the path of the node A to be tested cannot be output through the inherent path printing method, it can be assisted by the nearby node B that can output the path. Use get_position() to obtain the proportion of the width propW and height propH of the position of the B node in the entire screen, use get_bounds() to obtain the top, right, bottom, and left positions of the B node, and use device().get_current_resolution() to output the width and height of the entire screen, so as to obtain the position of the center of the B node (propW*width, propH*height). The distance between the center position of B and the upper edge of B is (propH-top)*height, so as to find any click position within the axis of A (propW*width, top*height-λ), (λ is a smaller value greater than zero) and complete the click event of the A node through the click() instruction.

[0074] After the test of a node to be tested is completed, the test of the next node to be tested can generally be carried out by responding to the click event of the clicked node.

[0075] The app testing method provided by this embodiment can output the path of the POCO nodes to be tested within a multilingual app and complete click operations for components whose node paths are difficult to output. Compiling a case script can use the optimal search scheme for each node to form a set of automated test cases, ultimately achieving automatic search and verification of POCO tree nodes and text for multilingual apps on iOS.

[0076] Example 2:

[0077] Figure 4 This is a schematic diagram of the structure of an application APP testing device provided in an embodiment of the present invention, which includes:

[0078] The determination module 41 is used to determine the poco tree structure of the APP, and determine the target path corresponding to the node to be tested in the poco tree structure according to the node to be tested in the APP;

[0079] The testing module 42 is used to determine the display content of the node to be tested according to the target path, and compare the display content of the node to be tested with the content in the file used to develop the APP to complete the test of the node to be tested.

[0080] The determination module 41 is specifically used to determine the name attribute of the node to be tested in the APP, determine the target node with the same name attribute in the poco tree structure, and determine the path to which the target node belongs as the target path corresponding to the node to be tested.

[0081] The determination module 41 is specifically used to determine the path to which the target node belongs as the candidate path corresponding to the node to be tested; if there is a non-Other parent node in the candidate path other than the node to be tested, the path between the non-Other node closest to the node to be tested and the node to be tested is used as the target path.

[0082] The testing module 42 is specifically used to determine the target key value corresponding to the display content of the node to be tested based on the display content of the node to be tested and the pre-set correspondence between the display content and the key value; determine the content corresponding to the target key value in the file used to develop the APP, compare the content corresponding to the target key value with the display content of the node to be tested, and complete the test of the node to be tested.

[0083] The testing module 42 is specifically used to obtain the current language mode of the APP, determine the content in the language mode in the content corresponding to the target key value in the file used to develop the APP, if the content in the language mode is the same as the display content of the node to be tested, then it is determined that the test of the node to be tested is successful; if the content in the language mode is different from the display content of the node to be tested, then it is determined that the test of the node to be tested has failed.

[0084] The testing module 42 is also used to determine the position of the node to be clicked on the screen based on the screen size of the device on which the APP is installed, the size of the node in each path in the poco tree structure, and the positional relationship between the node and the node to be clicked, and complete the click event on the node to be clicked based on the position of the node to be clicked on the screen.

[0085] Example 3:

[0086] On the basis of the above embodiments, an electronic device is further provided in an embodiment of the present invention, such as Figure 5 As shown, it includes: a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304;

[0087] The memory 303 stores a computer program. When the program is executed by the processor 301, the processor 301 performs the following steps:

[0088] Determine the poco tree structure of the APP, and determine the target path corresponding to the node to be tested in the poco tree structure according to the node to be tested in the APP;

[0089] The display content of the node to be tested is determined according to the target path, and the display content of the node to be tested is compared with the content in the file used to develop the APP to complete the test of the node to be tested.

[0090] Based on the same inventive concept, an electronic device is also provided in an embodiment of the present invention. Since the principle of solving the problem by the above electronic device is similar to that of the APP testing method, the implementation of the above electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0091] The communication bus mentioned in the electronic device mentioned above may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.

[0092] The communication interface 302 is used for communication between the electronic device and other devices.

[0093] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk memory. Alternatively, the memory may be at least one storage device located away from the processor.

[0094] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0095] In an embodiment of the present invention, when the processor executes the program stored in the memory, it determines the poco tree structure of the APP, and determines the target path corresponding to the node to be tested in the poco tree structure according to the node to be tested in the APP; determines the display content of the node to be tested according to the target path, and compares the display content of the node to be tested with the content in the file used to develop the APP to complete the test of the node to be tested.

[0096] Because in the embodiment of the present invention, for the APP to be tested, the poco tree structure of the APP is first determined, and the target path corresponding to the node to be tested is determined from the poco tree structure for the node to be tested in the APP. Finally, the display content of the node to be tested is determined according to the target path, and the display content of the node to be tested is compared with the content in the file used to develop the APP to complete the test of the node to be tested. Based on the above scheme, the test of each node in each language mode can be automatically completed, avoiding the problems of manual testing consuming large human resources and costs, the inability to guarantee the accuracy of the test, and the low efficiency of the test.

[0097] Example 4:

[0098] Based on the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by an electronic device. When the program is executed on the electronic device, the electronic device implements the following steps:

[0099] Determine the poco tree structure of the APP, and determine the target path corresponding to the node to be tested in the poco tree structure according to the node to be tested in the APP;

[0100] The display content of the node to be tested is determined according to the target path, and the display content of the node to be tested is compared with the content in the file used to develop the APP to complete the test of the node to be tested.

[0101] Based on the same inventive concept, a computer-readable storage medium is also provided in an embodiment of the present invention. Since the principle of solving the problem when the processor executes the computer program stored on the above-mentioned computer-readable storage medium is similar to the APP testing method, the implementation of the processor when executing the computer program stored on the above-mentioned computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.

[0102] The above-mentioned computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor in the electronic device, including but not limited to magnetic storage such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc., optical storage such as CDs, DVDs, BDs, HVDs, etc., and semiconductor storage such as ROMs, EPROMs, EEPROMs, non-volatile memories (NANDFLASH), solid-state drives (SSDs), etc.

[0103] A computer program is stored in a computer-readable storage medium provided in an embodiment of the present invention. When the computer program is executed by a processor, it determines the poco tree structure of the APP, determines the target path corresponding to the node to be tested in the poco tree structure according to the node to be tested in the APP; determines the display content of the node to be tested according to the target path, and completes the test of the node to be tested by comparing the display content of the node to be tested with the content in the file used to develop the APP.

[0104] Because in the embodiment of the present invention, for the APP to be tested, the poco tree structure of the APP is first determined, and the target path corresponding to the node to be tested is determined from the poco tree structure for the node to be tested in the APP. Finally, the display content of the node to be tested is determined according to the target path, and the display content of the node to be tested is compared with the content in the file used to develop the APP to complete the test of the node to be tested. Based on the above scheme, the test of each node in each language mode can be automatically completed, avoiding the problems of manual testing consuming large human resources and costs, the inability to guarantee the accuracy of the test, and the low efficiency of the test.

[0105] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0106] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0107] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0108] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0109] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

Claims

1. An application APP testing method, characterized in that: The method comprises: Determine the poco tree structure based on the internationalized APP on the iOS side, and determine the target path corresponding to the node to be tested in the poco tree structure according to the node to be tested in the APP; Determine the display content of the node to be tested according to the target path, compare the display content of the node to be tested with the content in the file used to develop the APP, and complete the test of the node to be tested; The determining, based on the node to be tested in the APP, a target path corresponding to the node to be tested in the poco tree structure includes: Determine the name attribute of the node to be tested in the APP, and determine the target node with the same name attribute in the poco tree structure; Determine the path to which the target node belongs as the candidate path corresponding to the node to be tested; If, in addition to the node to be tested, there is a parent node other than Other in the candidate path, the path between the non-Other node closest to the node to be tested and the node to be tested is used as the target path; The method further comprises: Determine the position of the node to be clicked on the screen according to the screen size of the device on which the APP is installed, the size of the node in each path in the poco tree structure, and the positional relationship between the node and the node to be clicked, and complete a click event on the node to be clicked according to the position of the node to be clicked on the screen; Among them, when the path of the node A to be tested cannot be output through the inherent path printing method, the node B that can output the path is used to assist in the search; the proportion of the width propW and the height propH of the position of the node B in the entire screen are obtained; the top, right, bottom, and left positions of the node B are obtained, and according to the width and height of the entire screen, the position of the center of the node B is obtained (propW*width, propH*height), and the distance between the center position of the node B and the upper edge of the node B is (propH-top)*height. Find any click position within the central axis of the node A (propW*width, top*height-λ), where λ is a smaller value greater than zero; and complete the node A click event according to the click position.

2. The method according to claim 1, wherein Comparing the displayed content of the node to be tested with the content in the file used to develop the APP, completing the test of the node to be tested includes: Determining a target key value corresponding to the display content of the node to be tested according to the display content of the node to be tested and a preset correspondence between the display content and the key value; Determine the content corresponding to the target key value in the file used to develop the APP, compare the content corresponding to the target key value with the display content of the node to be tested, and complete the test of the node to be tested.

3. The method according to claim 2, wherein Determining the content corresponding to the target key value in the file used to develop the APP, comparing the content corresponding to the target key value with the display content of the node to be tested, and completing the test of the node to be tested includes: Obtain the current language mode of the APP, determine the content in the language mode in the content corresponding to the target key value in the file used to develop the APP, if the content in the language mode is the same as the display content of the node to be tested, determine that the test of the node to be tested is successful; if the content in the language mode is different from the display content of the node to be tested, determine that the test of the node to be tested has failed.

4. An application APP testing device, characterized in that: The device comprises: A determination module is used to determine the poco tree structure based on the internationalized APP on the iOS side, and determine the target path corresponding to the node to be tested in the poco tree structure according to the node to be tested in the APP; A testing module, configured to determine the display content of the node to be tested according to the target path, compare the display content of the node to be tested with the content in the file used to develop the APP, and complete the test of the node to be tested; The determination module is specifically used to determine the name attribute of the node to be tested in the APP, determine the target node with the same name attribute in the poco tree structure; determine the path to which the target node belongs as the candidate path corresponding to the node to be tested; if there is a non-Other parent node in the candidate path other than the node to be tested, then the path between the non-Other node closest to the node to be tested and the node to be tested is used as the target path; The testing module is further configured to determine the position of the node to be clicked on the screen based on the screen size of the device on which the APP is installed, the size of the node in each path in the poco tree structure, and the positional relationship between the node and the node to be clicked, and complete a click event on the node to be clicked based on the position of the node to be clicked on the screen; Among them, when the path of the node A to be tested cannot be output through the inherent path printing method, the node B that can output the path is used to assist in the search; the proportion of the width propW and the height propH of the position of the node B in the entire screen are obtained; the top, right, bottom, and left positions of the node B are obtained, and according to the width and height of the entire screen, the position of the center of the node B is obtained (propW*width, propH*height), and the distance between the center position of the node B and the upper edge of the node B is (propH-top)*height. Find any click position within the central axis of the node A (propW*width, top*height-λ), where λ is a smaller value greater than zero; and complete the node A click event according to the click position.

5. The device according to claim 4, characterized in that The test module is specifically used to determine the target key value corresponding to the display content of the node to be tested based on the display content of the node to be tested and the pre-set correspondence between the display content and the key value; determine the content corresponding to the target key value in the file used to develop the APP, compare the content corresponding to the target key value with the display content of the node to be tested, and complete the test of the node to be tested.

6. The device according to claim 5, characterized in that The test module is specifically used to obtain the current language mode of the APP, determine the content under the language mode in the content corresponding to the target key value in the file used to develop the APP, if the content under the language mode is the same as the display content of the node to be tested, then it is determined that the test of the node to be tested is successful; if the content under the language mode is different from the display content of the node to be tested, then it is determined that the test of the node to be tested has failed.

7. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory for storing computer programs; A processor, configured to implement the method steps described in any one of claims 1 to 3 when executing a program stored in a memory.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Method for obtaining control in page test, server and readable storage medium

    CN110413520A

  • Page compatibility detection method and device, equipment and storage medium

    CN113094287A