Method and device for automatically testing APP page

By generating unique buried point identifiers on the APP page and combining Xpath sniffing technology, the low test efficiency problem caused by high-frequency iteration of the APP page is solved, and efficient automated testing is achieved when page elements change.

CN120336149APending Publication Date: 2025-07-18FUJIAN FUNO MOBILE COMM TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410276634.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-12
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

When facing high-frequency iterations, the existing APP page automation testing methods are difficult to adapt to changes in the graphic content and layout of page elements, resulting in frequent modification of the test scripts, which affects the testing efficiency.

Method used

By generating unique buried point identifiers, the page elements are injected, and the complete page structure is obtained using Xpath sniffing technology, the dependence between page elements and text content and Xpath path is eliminated, and the automatic positioning and testing of the elements to be tested is realized.

Benefits of technology

In the case of high-frequency iteration of the page, the elements to be tested can be accurately positioned, the efficiency of automated testing can be improved, and the workload of modifying the test script is reduced. It is suitable for a variety of models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120336149A_ABST
    Figure CN120336149A_ABST
Patent Text Reader

Abstract

The invention relates to an automatic testing method and device for an APP page, and the method comprises the steps: generating a unique buried point identifier for an obtained page element according to a buried point generation rule, and injecting the unique buried point identifier as a resource number into a page code of a webpage through a code injection technology, thereby achieving the buried point injection of the page element, and achieving the automatic testing of the page element. Starting an automatic test tool according to a received test request to obtain a complete page structure of the target APP, performing buried point sniffing on a complete page result through an Xpath sniffing technology to obtain element information of page elements of each page, judging the page elements corresponding to non-empty resource numbers in the element information as to-be-tested elements, and testing the to-be-tested elements according to the to-be-tested elements. And automatic testing is carried out. Therefore, coupling of the page elements and the image-text content is relieved through the unique buried point identification, the checking operation of the page elements and dependence of the Xpath are relieved, and when the APP page is subjected to high-frequency iteration, the to-be-tested elements can still be positioned through the unique buried point identification, and automatic testing is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computing, and in particular to a method and device for automated testing of APP pages. Background Art

[0002] In traditional APP page automated testing methods, testers write test scripts to verify the functions of APPs, and then deliver the test scripts to automated testing tools. The automated testing tools automatically execute the test scripts to achieve automated testing of APP pages. Before the test script detects the function of a certain page element on the APP page, it needs to first locate the page element. There are mainly two conventional positioning methods:

[0003] (1) Directly search by controlling the number, but this method is only applicable to native controls of APPs and not applicable to element components on H5 pages, making it difficult to promote and apply;

[0004] (2) Set a marked picture of the page element in the test script, and use image comparison technology to find the position area of the feature area in the APP page, and use the identified position area as the target element for detection. However, this method depends on the display appearance of the element area, requiring both the display style of the page element to remain unchanged on different models and the text and graphic content on the page element to remain unchanged. It is difficult to make a test script applicable to all models. Once the text or icon of the page element changes, the element mark in the test script needs to be replaced, increasing the workload of testers and reducing the efficiency of APP page automated testing.

[0005] Application No.: CN202310053171.X, which discloses an "APP Automated Testing Method, Device and Automated Testing System". This solution locates various Xpath paths in the APP using an element location tool, and locates each page element of the APP according to each Xpath path, thereby decoupling the page element from the marked picture, solving the problem that the test script needs to be changed when the graphic content on the page element changes, and realizing the automated detection of the APP page. However, this method depends on the Xpath path of the page element. During the iteration of the APP, not only the text and icons are simply replaced, but the page layout is often adjusted. When the page layout is adjusted, even if only a certain corner is adjusted, it will cause the Xpath paths of all elements on the APP page to be rearranged, and the rearranged Xpath path may be different from the original Xpath path, resulting in the failure or inaccuracy of the automated test. Moreover, the Xpath path itself does not carry test information, and a configuration relationship between the test operation and the Xpath path needs to be established separately. Therefore, if the Xpath path changes due to page layout adjustment, the configuration relationship between the test operation and the Xpath path needs to be modified, which will bring additional configuration work and affect the efficiency of the APP page automated test. Summary of the Invention

[0006] The technical problem to be solved by the present invention is: The present invention provides a method and device for automated testing of APP pages, which improve the efficiency of automated testing of APP pages while adapting to the characteristics of high-frequency iteration of APP pages.

[0007] To solve the above technical problems, the technical solution adopted by the present invention is:

[0008] In a first aspect, the present invention provides a method for automated testing of APP pages, including:

[0009] Obtain the page elements of the web page, generate a unique buried point identifier for the page elements according to the buried point generation rule, use the unique buried point identifier as the resource number of the page elements, and inject the resource number into the page code of the web page by using code injection technology to achieve buried point injection of the page elements;

[0010] Receive a test request, start an automated testing tool according to the test request, the automated testing tool obtains the complete page structure of the target APP, and performs buried point sniffing on the complete page structure through Xpath sniffing technology to obtain the element information of the page elements of each page in the complete page structure;

[0011] It is determined whether the resource number in each of the element information is empty. If not, the page element corresponding to the element information is used as the element to be tested, and all the elements to be tested are automatically tested to obtain the test results.

[0012] The beneficial effects of the present invention are: generating a unique embedding identifier for a page element of a web page, and injecting the unique embedding identifier into the page code of the web page through code injection technology, so as to realize embedding injection of the web page element. Therefore, when testing the page of the target APP, it is only necessary to obtain the complete page structure of the target APP and perform embedding sniffing on the complete page structure through Xpath sniffing technology, that is, sniffing out the page element with the unique embedding identifier in the complete page structure to realize the positioning of the element to be tested, thereby realizing automatic detection of the APP page, that is, through the unique embedding identifier, not only the coupling relationship between the page element and the graphic content is released, but also the dependency relationship between the inspection operation of the page element and the Xpath path is released. Even if the graphic content or the page layout changes, the element to be tested can be located through the unique embedding identifier, thereby realizing automatic testing of the APP page, adapting to the high-frequency iteration characteristics of the APP page while improving the efficiency of automatic testing of the APP page.

[0013] Optionally, the step of obtaining the page element of the webpage includes:

[0014] Receive an operation behavior of an administrator, perform component information configuration on the page element according to the operation behavior, and obtain the page element after the component information configuration, wherein the component information configuration includes an attributed page, an attributed area, an element type, a display text, a display image, and a jump link;

[0015] The page elements after component information configuration are added to the web page, and the page elements after component configuration are saved to the database.

[0016] According to the above description, the page elements added to the web page are page elements after component information configuration, which ensures the availability of the page elements. At the same time, the page elements after component information configuration are saved to the database, which is convenient for subsequent retrieval of the page elements from the database for modification, copying and other operations, thereby realizing multiple reuse of page elements.

[0017] Optionally, the acquiring a page element of a web page and generating a unique embedding point identifier of the page element according to an embedding point identifier rule includes:

[0018] The page ID, area ID, element type, operation type and serial number of the page element are obtained, and a unique embedding point ID of the page element is generated according to the page ID, area ID, element type, operation type and serial number.

[0019] According to the above description, the unique tracking identifier of the page element carries the page identifier and the area identifier, which facilitates the subsequent rapid positioning of the page element according to the test result. At the same time, it carries the operation type, which facilitates the subsequent execution of corresponding tests on the page element.

[0020] Optionally, the automated testing tool obtains the complete page structure of the target APP, and performs tracking sniffing on the complete page structure through the Xpath sniffing technology. The element information of the page elements of each page in the complete page structure includes:

[0021] The automated testing tool connects to the daemon APP on the target client through adb, and obtains the complete page structure of the target APP through the daemon APP. The complete page structure includes all pages of the target APP, the page elements of each page, and the Xpath directory structure;

[0022] Perform tracking sniffing on the complete page structure through the Xpath sniffing technology to obtain the element information of the page elements of each page in the complete page structure.

[0023] According to the above description, the automated testing tool obtains the complete page structure of the target APP through the daemon APP, without adding additional configuration acquisition interfaces, saving system resource overhead. Moreover, the obtained complete page structure includes all pages, the page elements of each page, and the Xpath directory structure, ensuring the comprehensiveness of the complete page structure.

[0024] Optionally, the Xpath directory structure is a tree structure. The element information of the page elements of each page in the complete page structure obtained by performing tracking sniffing on the complete page structure through the Xpath sniffing technology includes:

[0025] Start sniffing from the root node of the tree structure through the Xpath sniffing technology and sequentially sniff the leaf nodes where the page elements of each page are located to obtain the element information of the page elements of each page.

[0026] According to the above description, the Xpath sniffing technology starts sniffing from the root node for all leaf nodes, that is, traverses the leaf nodes where all page elements are located, ensuring the integrity and comprehensiveness of the obtained element information of the page elements.

[0027] Optionally, the test result includes a gesture test result and a page auditing result. The automated testing of all the elements to be tested to obtain the test result includes:

[0028] Perform buried-point parsing on the resource numbers of all the elements to be tested, and obtain the operation types of each of the elements to be tested. The operation types include gesture interaction operations and page auditing operations;

[0029] When the operation type is a gesture interaction operation, the automated testing tool sends the gesture interaction operation to the daemon APP through adb. The daemon APP automatically executes the gesture interaction operation on the target APP to obtain an execution result, and uses the execution result as the gesture test result;

[0030] When the operation type is a page auditing operation, the automated testing tool takes a regional screenshot of the area where the element to be tested is located to obtain the area to be tested, performs text recognition on the area to be tested through OCR technology to obtain the text to be tested, and performs text error correction on the text to be tested through AI technology to obtain the page auditing result.

[0031] According to the above description, by performing buried-point parsing on non-empty resource numbers, the operation types of the elements to be tested can be obtained. This operation type provides operation guidelines for subsequent automated testing. Different tests are used for different operation types. When the operation type is a gesture interaction operation, the gesture interaction operation is executed on the target APP through the daemon APP, realizing the page verification operation of the automated testing tool on the target APP. And the obtained test results include gesture test results and page auditing results, ensuring the comprehensiveness of the test results.

[0032] Optionally, obtaining the operation types of each of the elements to be tested includes:

[0033] Classify all the elements to be tested according to the operation type to obtain a gesture interaction verification tree and a page auditing verification tree. When the automated testing tool performs automated testing on the elements to be tested in the gesture interaction verification tree, it is carried out in a serial manner. When the automated testing tool performs automated testing on the elements to be tested in the page auditing verification tree, it is carried out in a parallel manner.

[0034] According to the above description, constructing a gesture interaction verification tree and a page auditing verification tree, considering that when performing automated testing on each of the elements to be tested in the gesture interaction verification tree, the page of the target APP will change, that is, the elements to be tested are dynamic, so a serial manner is adopted. And when performing automated testing on the elements to be tested in the page auditing verification tree, only the compliance of rich media content is audited, that is, the elements to be tested are static, so a parallel manner is adopted, which not only improves the test speed of the automated testing but also ensures the rationality of the automated testing.

[0035] Optionally, the gesture interaction operations include click, long press, slide, and page turn.

[0036] In a second aspect, the present invention provides an apparatus for automated testing of APP pages, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the method for automated testing of APP pages described in the first aspect.

[0037] Among them, for the technical effects corresponding to the apparatus for automated testing of APP pages provided in the second aspect, reference may be made to the relevant descriptions of the method for automated testing of APP pages provided in the first aspect. Description of the Drawings

[0038] Figure 1 is a flowchart of the method for automated testing of APP pages provided in this embodiment;

[0039] Figure 2 is a schematic diagram of the overall process of the method for automated testing of APP pages provided in this embodiment;

[0040] Figure 3 is a schematic diagram of the structure of the apparatus for automated testing of APP pages provided in this embodiment.

[0041]

Description of the Reference Numerals in the Drawings

[0042] 1. An apparatus for automated testing of APP pages;

[0043] 2. Processor;

[0044] 3. Memory. Detailed Embodiments

[0045] To better understand the above technical solutions, the exemplary embodiments of the present invention will be described in more detail with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more clear and thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.

[0046] Embodiment 1

[0047] Please refer to Figures 1 to 2 , the present invention provides a method for automated testing of APP pages, including the steps of:

[0048] S1. Obtain the page elements of the web page, generate a unique buried point identifier for the page elements according to the buried point generation rule, use the unique buried point identifier as the resource number of the page elements, and inject the resource number into the page code of the web page by using the code injection technology to achieve the buried point injection of the page elements;

[0049] In this embodiment, as Figure 2 shown, according to the data point generation rule, a corresponding unique data point identifier is generated for each page element on the web page, and the unique data point identifier is used as the resource number of the page element. The code injection technology is used to inject it into the page code of the web page. The injection method can be to wrap a div tag in the form of <div id=唯一埋点标识> …… " outside the html tag of the page element, indicating that the resource number of the page element is the corresponding unique data point identifier, so as to realize the data point injection of the page element.

[0050] At this time, before obtaining the page elements of the web page in step S1, it includes:

[0051] S11. Receive the operation behavior of the administrator, configure the component information for the page element according to the operation behavior, and obtain the page element after the component information is configured. The component information configuration includes the belonging page, the belonging area, the element type, the displayed text, the displayed picture, and the jump link;

[0052] S12. Add the page element after the component information is configured to the web page, and save the page element after the component information is configured to the database.

[0053] In this embodiment, the component information of the page element is pre-configured according to the operation behavior of the administrator to obtain the page element after the component is configured, and the page element after the component information is configured is added to the web page. At the same time, it also supports the administrator to add the page element after the component is configured to the web page through the visual drag-and-drop method.

[0054] At this time, for obtaining the page elements of the web page in step S1 and generating the unique data point identifier of the page element according to the data point identifier rule, it includes:

[0055] S13. Obtain the page identifier, area identifier, element type, operation type, and serial number of the page element, and generate the unique data point identifier of the page element according to the page identifier, area identifier, element type, operation type, and serial number.

[0056] In this embodiment, as Figure 2 shown, the unique data point identifier is generated according to the page identifier, area identifier, element type, operation type, and serial number of the page element. The generated unique data point identifier is in the form of a string "page identifier - area identifier - element type - operation type - serial number", where the data point identifier rule can be adjusted and set according to actual needs.

[0057] S2. Receive a test request, and start an automated testing tool according to the test request. The automated testing tool obtains the complete page structure of the target APP, performs point sniffing on the complete page structure through Xpath sniffing technology, and obtains element information of page elements of each page in the complete page structure;

[0058] At this time, the automated testing tool in step S2 obtains the complete page structure of the target APP, and performs point sniffing on the complete page structure through Xpath sniffing technology, and obtains the element information of the page elements of each page in the complete page structure, including:

[0059] S21, the automated testing tool connects to the guardian APP on the target client through adb, and obtains the complete page structure of the target APP through the guardian APP, wherein the complete page structure includes all pages of the target APP, page elements of each page, and Xpath directory structure;

[0060] In this embodiment, if Figure 2 As shown, the automated testing tool connects to the guardian APP on the target client through adb (Android Debug Bridg). The guardian APP is an APP installed on the target client in advance. With the help of the accessibility service of the target client, it can not only perform gesture interaction operations on the target APP, but also capture all pages of the target APP, the page elements of each page and the Xpath directory structure, that is, the complete page structure.

[0061] S22. Perform point sniffing on the complete page structure through Xpath sniffing technology to obtain element information of page elements of each page in the complete page structure.

[0062] At this time, the Xpath directory structure is a tree structure, and step S22 includes:

[0063] S221. Using Xpath sniffing technology, sniff the leaf nodes where the page elements of each page are located in sequence starting from the root node of the tree structure to obtain element information of the page elements of each page.

[0064] In this embodiment, if Figure 2 As shown, the Xpath sniffing technology is used to sniff the leaf nodes where the page elements of each page are located in turn from the root node of the tree structure, that is, all page elements are traversed to obtain the element information of the page elements of each page, where the element information includes the Xpath path, control type, control name, control position, control size and resource number.

[0065] S3. Determine whether the resource number in each of the element information is empty. If not, use the page element corresponding to the element information as the element to be tested, and perform automated testing on all the elements to be tested to obtain a test result.

[0066] In this embodiment, if the resource number is non-empty, it has a unique data tracking identifier. Therefore, use the corresponding page element as the element to be tested and perform automated testing on the element to be tested.

[0067] At this time, the test result includes a gesture test result and a page auditing result. The automated testing of the elements to be tested in step S3 to obtain a test result includes:

[0068] S31. Perform data tracking analysis on the resource numbers of all the elements to be tested to obtain the operation type of each element to be tested. The operation type includes gesture interaction operations and page auditing operations.

[0069] At this time, obtaining the operation type of each element to be tested in step S31 includes:

[0070] S311. Classify all the elements to be tested according to the operation type to obtain a gesture interaction verification tree and a page auditing verification tree. When the automated testing tool performs automated testing on the elements to be tested in the gesture interaction verification tree, it is carried out in a serial manner. When the automated testing tool performs automated testing on the elements to be tested in the page auditing verification tree, it is carried out in a parallel manner.

[0071] In this embodiment, as Figure 2 shown, the operation type includes gesture interaction operations and page auditing operations. Gesture interaction operations include click, long press, slide, and page flip. The page auditing operation is to check whether the rich media content is compliant, such as whether there are typos, whether there are sensitive words in the text content, and whether there are sensitive patterns in the image content, etc. Classify the elements to be tested according to the operation type, construct a gesture interaction verification tree and a page auditing verification tree, and perform automated testing on the elements to be tested in the gesture interaction verification tree in a serial manner, and perform automated testing on the elements to be tested in the page auditing verification tree in a parallel manner.

[0072] S32. When the operation type is a gesture interaction operation, the automated testing tool sends the gesture interaction operation to the daemon APP through adb, and the daemon APP automatically executes the gesture interaction operation on the target APP to obtain an execution result, and use the execution result as the gesture test result.

[0073] In this embodiment, when operating a gesture interaction operation, the automated test tool sends the gesture interaction operation to the daemon APP through adb, informing the daemon APP of which gesture interaction operation should be executed. Then, the daemon APP automatically executes it on the target APP, that is, the daemon APP manipulates the target APP to execute the corresponding gesture interaction operation and generates the corresponding execution result. Specifically, regarding how to detect whether an error occurs during the execution of the gesture interaction operation, taking the event of the gesture interaction operation being a click as an example, the automated test tool executes a click operation on the specified page element of the target APP through the daemon APP. At this time, a pop-up prompt window may appear on the target APP page or a result page may be opened, etc. For a successful situation, a buried point identifier in the form of "page identifier - region identifier - element type - operation type - serial number - success" is fixedly embedded in the front-end web page. For an error situation, a buried point identifier in the form of "page identifier - region identifier - element type - operation type - serial number - fail - error code" is fixedly embedded in the front-end web page. At this time, the automated test tool calls the Xpath sniffing technology to traverse all page elements again from the refreshed APP page. If a page element with a resource number of "*** - success" is found, it indicates that the gesture interaction is successful and an execution result of successful gesture interaction is generated; if a page element with a resource number of "*** - fail - error code" is found, it indicates that the gesture interaction fails and an execution result of failed gesture interaction is generated. If no page element with a resource number of "*** - success" or "*** - fail - error code" is found after exceeding the preset specified time, it indicates that the gesture interaction times out and an execution result of gesture interaction timeout is generated.

[0074] S33. When the operation type is a page auditing operation, the automated test tool takes a regional screenshot of the area where the element to be tested is located to obtain a to-be-tested area, performs character recognition on the to-be-tested area through OCR technology to obtain to-be-tested text, and performs text error correction on the to-be-tested text through AI technology to obtain a page auditing result.

[0075] In this embodiment, as Figure 2 shown, when the operation type is a page auditing operation, the automated test tool first takes a screenshot of the entire current page, and then takes a regional screenshot of the area where the element to be tested is located to obtain a to-be-detected area. Regarding the regional screenshot, the position of the control found through the Xpath sniffing technology is the center point coordinates of the page element, and the control size is the width and height of the rectangular area where the page element is located. Therefore, the rectangular area cropped according to the center point coordinates and the width and height is the to-be-detected area, and the calculation methods of the coordinate values of the left, right, upper, and lower four directions of this rectangular area are as follows:

[0076] Left = (x * 2 - w) / 2;

[0077] Right = Left + w

[0078] Top = (y * 2 - h) / 2;

[0079] Bottom = Top + h

[0080] Wherein, x represents the abscissa of the center point coordinate, y represents the ordinate of the center point coordinate, w represents the width, and h represents the height. Text error correction for the text to be tested is performed through AI technology, including identifying typos and sensitive words, etc.

[0081] Embodiment 2

[0082] Please refer to Figure 3 , an apparatus 1 for automated testing of APP pages, including a memory 3, a processor 2, and a computer program stored on the memory 3 and executable on the processor 2. When the processor 2 executes the computer program, the steps in the first embodiment above are implemented.

[0083] Since the system / apparatus described in the above embodiments of the present invention is the system / apparatus adopted for implementing the method in the above embodiments of the present invention, based on the method described in the above embodiments of the present invention, those skilled in the art can understand the specific structure and variations of the system / apparatus, and thus will not be elaborated herein. Any system / apparatus adopted by the method in the above embodiments of the present invention falls within the scope of protection of the present invention.

[0084] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can be implemented in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can be implemented in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0085] The present invention is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions.

[0086] It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention can be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a claim listing several means, several of these means can be embodied by the same hardware item. The use of the terms first, second, third, etc. is for convenience only and does not denote any order. These terms can be understood as part of the name of the element.

[0087] In addition, it should be noted that in the description of this specification, the descriptions of the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples", etc. mean that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0088] Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications after learning the basic creative concepts. Therefore, the claims should be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of the present invention.

[0089] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention should also include these modifications and variations.

Claims

1. A method for automated testing of APP pages, characterized in that, Including: Obtain the page elements of a web page, generate a unique buried point identifier for the page elements according to the buried point generation rule, use the unique buried point identifier as the resource number of the page elements, and inject the resource number into the page code of the web page by using code injection technology to achieve buried point injection for the page elements; Receive a test request, start an automated test tool according to the test request, the automated test tool obtains the complete page structure of the target APP, and performs buried point sniffing on the complete page structure through Xpath sniffing technology to obtain the element information of the page elements of each page in the complete page structure; Judge whether the resource number in each piece of element information is empty. If not, use the page element corresponding to the element information as the element to be tested, and perform automated testing on all the elements to be tested to obtain the test results.

2. The method for automated testing of an APP page according to claim 1, characterized in that, Before obtaining the page elements of the web page, it includes: Receive the operation behavior of the administrator, configure the component information for the page elements according to the operation behavior to obtain the page elements after component information configuration, and the component information configuration includes the belonging page, belonging area, element type, display text, display picture, and jump link; Add the page elements after component information configuration to the web page, and save the page elements after component information configuration to the database.

3. A method for automated testing of an APP page according to claim 1, characterized in that, The obtaining of the page elements of the web page and generating the unique buried point identifier for the page elements according to the buried point identifier rule includes: Obtain the page identifier, area identifier, element type, operation type, and serial number of the page elements, and generate the unique buried point identifier for the page elements according to the page identifier, area identifier, element type, operation type, and serial number.

4. The method for automatically testing an APP page according to claim 1, wherein The automated test tool obtains the complete page structure of the target APP, and performs buried point sniffing on the complete page structure through Xpath sniffing technology to obtain the element information of the page elements of each page in the complete page structure, including: The automated test tool connects to the daemon APP on the target client through adb, and obtains the complete page structure of the target APP through the daemon APP. The complete page structure includes all pages of the target APP, the page elements of each page, and the Xpath directory structure; Perform buried point sniffing on the complete page structure through Xpath sniffing technology to obtain the element information of the page elements of each page in the complete page structure.

5. A method for automated testing of an APP page according to claim 4, characterized in that, The Xpath directory structure is a tree structure. The performing of buried point sniffing on the complete page structure through Xpath sniffing technology to obtain the element information of the page elements of each page in the complete page structure includes: Start sniffing from the root node of the tree structure through Xpath sniffing technology in sequence for the leaf nodes where the page elements of each page are located, and obtain the element information of the page elements of each page.

6. The method for automatically testing an APP page according to claim 1, wherein The test results include gesture test results and page auditing results. The performing of automated testing on all the elements to be tested to obtain the test results includes: Perform buried point parsing on the resource numbers of all the elements to be tested, and obtain the operation types of each of the elements to be tested. The operation types include gesture interaction operations and page auditing operations; When the operation type is a gesture interaction operation, the automated testing tool sends the gesture interaction operation to the daemon APP through adb. The daemon APP automatically executes the gesture interaction operation on the target APP to obtain an execution result, and uses the execution result as the gesture test result; When the operation type is a page auditing operation, the automated testing tool takes a regional screenshot of the area where the element to be tested is located to obtain the area to be tested, performs character recognition on the area to be tested through OCR technology to obtain the text to be tested, and performs text error correction on the text to be tested through AI technology to obtain the page auditing result.

7. The method for automatically testing an APP page according to claim 6, wherein, The obtaining of the operation types of each of the elements to be tested includes: Classify all the elements to be tested according to the operation type to obtain a gesture interaction verification tree and a page auditing verification tree. When the automated testing tool performs automated testing on the elements to be tested in the gesture interaction verification tree, it is carried out in a serial manner. When the automated testing tool performs automated testing on the elements to be tested in the page auditing verification tree, it is carried out in a parallel manner.

8. The method for automated testing of an APP page according to claim 6, characterized in that, The gesture interaction operations include click, long press, slide, and page turning.

9. An apparatus for automated testing of APP pages, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • APP automatic testing method and device and automatic testing system

    CN115858397A