Page testing method, device, electronic device and medium
By combining page structure information and image recognition technology in page testing, the elements to be tested are determined and matching tests are carried out, and the problem of inaccurate or excessive time-consuming tests in the prior art is solved, and more efficient and accurate page testing is achieved.
Patent Information
- Application Number
- CN202210531474.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-13
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2042-05-13
AI Technical Summary
The prior art is difficult to effectively test the differences between different versions of application pages, resulting in inaccurate test results or excessive time-consuming.
By determining the initial element based on page structure information, and obtaining the second initial element in combination with image recognition technology, comprehensively determining the elements to be tested, and then performing matching tests to obtain the page test results.
Improve the accuracy of the elements to be tested and the accuracy of the page test results, reducing uncertainty and time-consuming during the testing process.
Smart Images

Figure CN114924959B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer vision, specifically to the field of image processing technology, and more specifically to a page testing method, device, electronic device, medium and program product. Background Art
[0002] In the related technology, it is usually necessary to test the pages of the application program. For example, for different versions of the application program, the corresponding pages are usually different, so it is necessary to test the pages of the application program in order to know the differences between the various versions of the application program. Summary of the invention
[0003] The present disclosure provides a page testing method, device, electronic device, storage medium and program product.
[0004] According to one aspect of the present disclosure, a page testing method is provided, comprising: determining a first initial element for a page to be tested based on page structure information of the page to be tested; identifying an image to be tested associated with the page to be tested, and obtaining a second initial element for the image to be tested; determining an element to be tested for the page to be tested based on the first initial element and the second initial element; and testing the element to be tested.
[0005] According to another aspect of the present disclosure, a page testing device is provided, comprising: a first determination module, an identification module, a second determination module and a testing module. The first determination module is used to determine a first initial element for a page to be tested based on page structure information of the page to be tested; the identification module is used to identify an image to be tested associated with the page to be tested, and obtain a second initial element for the image to be tested; the second determination module is used to determine an element to be tested for the page to be tested based on the first initial element and the second initial element; and the testing module is used to test the element to be tested.
[0006] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor and a memory in communication with the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the above-mentioned page test method.
[0007] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the above-mentioned page testing method.
[0008] According to another aspect of the present disclosure, a computer program product is provided, including a computer program / instruction, wherein the computer program / instruction implements the steps of the above-mentioned page testing method when executed by a processor.
[0009] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0011] Figure 1 The application scenario of the page test according to an embodiment of the present disclosure is schematically shown;
[0012] Figure 2 A flow chart of a page testing method according to an embodiment of the present disclosure is schematically shown;
[0013] Figure 3 A schematic diagram of a page testing method according to an embodiment of the present disclosure is shown;
[0014] Figure 4 A schematic diagram of determining a first initial element according to an embodiment of the present disclosure is schematically shown;
[0015] Figure 5-6 A schematic diagram of determining a second initial element according to an embodiment of the present disclosure is schematically shown;
[0016] Figure 7 A schematic diagram of determining an element to be tested according to an embodiment of the present disclosure is schematically shown;
[0017] Figure 8 A block diagram schematically shows a page testing device according to an embodiment of the present disclosure; and
[0018] Fig. 9 The block diagram is a block diagram of an electronic device for performing a page test to implement an embodiment of the present disclosure. DETAILED DESCRIPTION
[0019] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0020] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0021] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0022] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0023] Figure 1 The following schematically illustrates an application scenario of a page test according to an embodiment of the present disclosure. It should be noted that: Figure 1 What is shown are merely examples of application scenarios to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0024] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a reference page 110 and a page to be tested 120 .
[0025] For the first version of the target application, the first version of the target application is run on the electronic device, and the displayed page is, for example, the page to be tested 120. For the second version of the target application, the second version of the target application is run on the electronic device, and the displayed page is, for example, the reference page 110.
[0026] The first version of the target application includes, for example, a large font version of the target application, and the second version of the target application includes, for example, a standard font version of the target application.
[0027] The first version of the target application and the second version of the target application can be run on the same electronic device to avoid the electronic device model from affecting the reference page 110 and the page to be tested 120. The electronic device includes but is not limited to a smart phone, a computer, a tablet computer, and the like.
[0028] Both the reference page 110 and the page to be tested 120 have multiple elements, which may be images, texts, icons, etc. The elements of the reference page 110 and the page to be tested 120 are extracted respectively, and the elements are matched to obtain the different elements between the reference page 110 and the page to be tested 120. For example, the element 121 of the page to be tested 120 is different from the element 111 of the reference page 110.
[0029] Combine the following Figure 1 For application scenarios, refer to Figure 2 to Figure 7 A page testing method according to an exemplary embodiment of the present disclosure is described below.
[0030] Figure 2 The flowchart of the page testing method according to an embodiment of the present disclosure is schematically shown.
[0031] like Figure 2 As shown, the page testing method 200 of the embodiment of the present disclosure may include, for example, operations S210 to S240.
[0032] In operation S210 , a first initial element for the page to be tested is determined based on page structure information of the page to be tested.
[0033] In operation S220, for an image to be tested associated with the page to be tested, the image to be tested is identified to obtain a second initial element for the image to be tested.
[0034] In operation S230 , an element to be tested for the page to be tested is determined based on the first initial element and the second initial element.
[0035] In operation S240 , a matching test is performed between the element to be tested and a reference element of the reference page.
[0036] Exemplarily, the page structure information includes DOM (Document Object Model) information. By parsing the page structure information of the page to be tested, the first initial element for the page to be tested can be obtained. The first initial element includes but is not limited to text, images, and icons.
[0037] Since the first initial element may be incomplete or inaccurate, the page to be tested may be processed in other ways to obtain the second initial element. For example, a screenshot of the page to be tested may be taken to obtain the image to be tested, and image recognition or text recognition may be performed on the image to be tested to obtain the second initial element for the image to be tested.
[0038] After obtaining the first initial element and the second initial element, the first initial element and the second initial element can be combined to determine the element to be tested for the page to be tested. Then, the element to be tested and the reference element for the reference page are matched to obtain a test result, which, for example, characterizes the difference between the page to be tested and the reference page.
[0039] According to the embodiments of the present disclosure, a first initial element is determined based on the page structure information of the page to be tested, a second initial element is obtained by identifying the image to be tested, an element to be tested is determined based on the first initial element and the second initial element, and a matching test is performed between the element to be tested and the reference element to obtain a test result for the page to be tested. It can be understood that the embodiments of the present disclosure combine different methods to finally determine the element to be tested, thereby improving the accuracy of the element to be tested and thus improving the accuracy of the result of the page test.
[0040] Figure 3 The schematic diagram shows a principle diagram of a page testing method according to an embodiment of the present disclosure.
[0041] like Figure 3 As shown, the page to be tested 320 includes a display page of the first version of the target application, and the reference page 310 includes a display page of the second version of the target application. The page to be tested 320 is screenshotted to obtain a test image, and the reference page 310 is screenshotted to obtain a reference image.
[0042] In one example, the first version of the target application includes, for example, a large font version of the target application, and the second version of the target application includes, for example, a standard font version of the target application.
[0043] Next, the element to be tested 321 for the page to be tested 320 and the reference element 311 for the reference page 310 are obtained. The method of obtaining the reference element 311 is similar to the method of obtaining the element to be tested 321 mentioned above. For example, for the reference element 311, based on the page structure information of the reference page 310, the third initial element for the reference page 310 is determined, and for the reference image associated with the reference page 310, the reference image is identified to obtain the fourth initial element for the reference image, and based on the third initial element and the fourth initial element, the reference element 311 for the reference page is determined.
[0044] Next, the reference element 311 is classified to obtain a classification result 312, which includes, for example, text elements and image elements. The element to be tested 321 is classified to obtain a classification result 322, which includes, for example, text elements and image elements.
[0045] Next, before performing a matching test on the element to be tested 321 and the reference element 311, the page to be tested 320 and the element to be tested 321 (the element to be tested 321 may include text elements and image elements in the classification result 322) may be normalized to obtain a normalized result 323, and the reference page 310 and the reference element 311 (the reference element 311 may include text elements and image elements in the classification result 312) may be normalized to obtain a normalized result 313.
[0046] Exemplarily, the normalization process includes, for example, adjusting the size of the image to be tested 320 and the reference image 310 so that the size of the image to be tested 320 is consistent with the size of the reference image 310. The size of the element to be tested 321 and the reference element 311 may also be adjusted so that the size of the element to be tested 321 and the reference element 311 is consistent.
[0047] After normalization, the corresponding elements in the benchmark element 311 (including the text elements and image elements in the classification result 312) and the element to be tested 321 (including the text elements and image elements in the classification result 322) are matched so as to determine the abnormal elements different from the benchmark element 311 from the element to be tested 321.
[0048] For example, according to the classification results 322 and 312, the text elements in the element to be tested 321 are matched with the corresponding text elements in the reference element 311. According to the classification results 322 and 312, the image elements in the element to be tested 321 are matched with the corresponding image elements in the reference element 311. The element to be tested 321 (including the text elements and the image elements) is matched with the corresponding reference element 311 (including the text elements and the image elements) in color. The element to be tested 321 (including the text elements and the image elements) is matched with the corresponding reference element 311 (including the text elements and the image elements) in layout.
[0049] Regarding text matching, since the first version of the target application corresponding to the element to be tested 321 includes a large-font version application, and the second version of the target application corresponding to the benchmark element 311 includes a standard-font version application, the font in the element to be tested 321 is usually larger than the font in the benchmark element 311, and thus the number of words in the element to be tested 321 is usually smaller than the number of words in the benchmark element 311.
[0050] For example, for the M characters in the reference element 311 and for the N characters in the element to be tested 321, N is an integer greater than or equal to 1, and M is an integer greater than or equal to N. Determine the first N characters from the M characters in the reference element 311, and match the determined N characters with the N characters in the element to be tested 321 one by one to obtain a text matching result. The text matching result represents the number of similar characters. If M is equal to N, directly match all the characters in the reference element 311 with all the characters in the element to be tested 321 character by character.
[0051] For image matching, image elements in the element to be tested 321 and image elements in the reference element 311 are matched for image similarity. Image similarity is associated with at least one of structure similarity (Structure Similarity, SSIM) and normalized cross correlation coefficient (Normalized Cross Correlation, NCC). For example, image similarity is characterized by a weighted average of structure similarity and normalized cross correlation coefficient.
[0052] For color matching, the color information of the tested element 321 (including text elements and image elements) is matched with the color information of the corresponding reference element 311 (including text elements and image elements) to obtain a color matching result, which is represented by the similarity of the color histogram, for example.
[0053] For layout matching, the relative position information of the element to be tested 321 (including text elements and image elements) in the image to be tested and the relative position information of the reference element 311 (including text elements and image elements) in the reference image are matched. Taking an element to be tested 321 as an example, the distance between the element to be tested 321 and the reference position in the image to be tested (for example, the position of the upper left corner pixel) is determined. For example, the position coordinates of the element to be tested 321 are (X1, Y1), and the width and height of the image to be tested are W and H respectively, then the relative position information of the element to be tested 321 in the image to be tested can be expressed as (X1 / W, Y1 / H). Similarly, the relative position information of the corresponding reference element 311 in the reference image can be obtained. The layout matching result, for example, characterizes the consistency between the relative position information of the element to be tested 321 and the relative position information of the corresponding reference element 311.
[0054] After obtaining the text matching result, image matching result, color matching result, and layout matching result, the final matching test result 330 can be determined based on any one or more of the matching results. The matching test result 330, for example, characterizes the abnormal element in the element to be tested 321 that is different from the reference element 311. For example, if any one of the text matching result, image matching result, color matching result, and layout matching result for an element to be tested indicates that the element to be tested does not match the corresponding reference element, the element to be tested can be determined to be an abnormal element. In addition, the abnormal element can be visualized on the page to be tested 320 to facilitate the tester to further verify the abnormal element.
[0055] According to the embodiments of the present disclosure, multiple matching methods are used to match the element to be tested and the reference element, thereby improving the accuracy of the matching test. In addition, before matching, normalization processing is performed to reduce the interference of external factors, thereby improving the effect of the matching test.
[0056] In another example of the present disclosure, the elements to be tested and the reference elements can be determined by combining page structure information and image recognition. The determination of the elements to be tested and the reference elements is similar. Taking the determination of the elements to be tested as an example, the following Figures 4 to 7 to explain.
[0057] Figure 4 The figure schematically shows a schematic diagram of determining a first initial element according to an embodiment of the present disclosure.
[0058] like Figure 4 As shown, based on the page structure information of the page to be tested, the first initial elements 421-429 for the page to be tested are determined.
[0059] Exemplarily, the page structure information includes DOM (Document Object Model) information. By parsing the page structure information of the page to be tested, the first initial element for the page to be tested can be obtained. The first initial element includes but is not limited to text, images, and icons.
[0060] Exemplarily, the page to be tested may include multiple cards. Figure 4 A card is shown in FIG. The DOM information corresponding to the page to be tested may be the page structure file pagesource, and each card corresponds to XPATH, which may be expressed as the card identifier or attribute. For a card, the local pagesource for the card is located from the page structure file pagesource according to the XPATH of the card, and the local pagesource is parsed to extract all leaf nodes, and the first initial elements 421 to 429 are obtained based on the leaf nodes.
[0061] It is understandable that the first initial elements 421-429 may be incomplete or inaccurate, for example, there are blank elements 423, 427, 429, and the blank elements 423, 427, 429 may affect the test results, so the test page can be processed in other ways to obtain the second initial element, so as to adjust the first initial element based on the second initial element. Figure 5-6 shown.
[0062] Figure 5-6 The figure schematically shows a schematic diagram of determining a second initial element according to an embodiment of the present disclosure.
[0063] like Figure 5 , taking a screenshot of the page to be tested to obtain an image to be tested 520 , identifying the image to be tested 520 , and obtaining a second initial element for the image to be tested.
[0064] For example, edge extraction is performed on the test image 520 to obtain multiple elements, each of which is indicated by a dotted box. For example, the test image 520 can be processed using image binarization, noise filtering, edge extraction operators, region selection algorithms, etc. to obtain multiple elements.
[0065] Then, the multiple elements are integrated by optical character recognition (OCR). For example, if the distance between adjacent elements in the multiple elements is less than a preset distance, the element type of the adjacent elements is further determined based on the text recognition result. If the element types of the adjacent elements are consistent, for example, they are all text types, the adjacent elements can be merged to obtain a second initial element.
[0066] like Figure 6 As shown, for the image to be tested 620, the second initial element obtained by merging adjacent elements of the element type being text is indicated by a dotted frame.
[0067] Figure 7 A schematic diagram of determining an element to be tested according to an embodiment of the present disclosure is schematically shown.
[0068] like Figure 7 As shown, for the first initial elements 721 to 729, the second initial elements are used as references to delete blank elements from the first initial elements 721 to 729. For example, the first initial elements 723, 727, and 729 do not have corresponding second initial elements, so the first initial elements 723, 727, and 729 are deleted as blank elements, and the remaining first initial elements 721, 722, 724, 725, 726, and 728 are used as elements to be tested.
[0069] In another example, for each first initial element, if the region where the first initial element is located includes at least one second initial element, the first initial element is determined to be an element to be tested.
[0070] For example, taking the first initial element 725 as an example, the area where the first initial element 725 is located includes the second initial elements 725A and 725B, and the first initial element 725 is determined to be the element to be tested. Taking the first initial element 723 as an example, the area where the first initial element 723 is located does not have a corresponding second initial element, so the first initial element 723 can be deleted as a blank element.
[0071] According to an embodiment of the present disclosure, in order to improve the accuracy of the first initial element, the image to be tested is further processed by means of image recognition and text recognition to obtain a second initial element, and the element to be tested is determined from the first initial element using the second initial element as a reference, thereby improving the accuracy of the element to be tested and thus improving the testing effect of the page.
[0072] It is understandable that the acquisition method of the reference element is similar to the acquisition method of the element to be tested, which will not be repeated here. After acquiring the reference element and the element to be tested, the reference element and the element to be tested are matched to obtain a matching test result for the page to be tested.
[0073] Figure 8 The block diagram schematically shows a page testing device according to an embodiment of the present disclosure.
[0074] like Figure 8 As shown, the page testing device 800 of the embodiment of the present disclosure includes, for example, a first determination module 810 , an identification module 820 , a second determination module 830 and a testing module 840 .
[0075] The first determination module 810 may be used to determine the first initial element for the page to be tested based on the page structure information of the page to be tested. According to the embodiment of the present disclosure, the first determination module 810 may, for example, execute the above reference Figure 2 The operation S210 described above will not be described in detail here.
[0076] The recognition module 820 may be used to recognize the image to be tested associated with the page to be tested, and obtain the second initial element for the image to be tested. Figure 2 The operation S220 described above will not be described in detail here.
[0077] The second determination module 830 may be used to determine the element to be tested for the page to be tested based on the first initial element and the second initial element. According to an embodiment of the present disclosure, the second determination module 830 may, for example, execute the above reference Figure 2 The operation S230 described above will not be described in detail here.
[0078] The test module 840 can be used to perform a matching test on the element to be tested and the reference element of the reference page. According to an embodiment of the present disclosure, the test module 840 can, for example, execute the above reference Figure 2 The operation S240 described above will not be described in detail here.
[0079] According to an embodiment of the present disclosure, the apparatus 800 may further include: an acquisition module, which is used to acquire a reference element for a reference page; the acquisition module includes: a first determination submodule, an identification submodule, and a second determination submodule. The first determination submodule is used to determine a third initial element for the reference page based on the page structure information of the reference page; the identification submodule is used to identify the reference image associated with the reference page to obtain a fourth initial element for the reference image; the second determination submodule is used to determine the reference element for the reference page based on the third initial element and the fourth initial element.
[0080] According to an embodiment of the present disclosure, the recognition module 820 includes: an extraction submodule, a third determination submodule, and a merging submodule. The extraction submodule is used to perform edge extraction on the image to be tested to obtain multiple elements; the third determination submodule is used to determine the element type of the adjacent elements in response to determining that the distance between adjacent elements in the multiple elements is less than a preset distance; the merging submodule is used to merge the adjacent elements in response to determining that the element types of the adjacent elements are consistent to obtain a second initial element.
[0081] According to the embodiment of the present disclosure, the second determination module 830 includes: a deletion submodule and a fourth determination submodule. The deletion submodule is used to delete blank elements from the first initial elements with reference to the second initial elements; and the fourth determination submodule is used to determine that the remaining first initial elements are elements to be tested.
[0082] According to an embodiment of the present disclosure, the second determination module 830 includes: a fifth determination submodule, configured to determine that the first initial element is an element to be tested in response to the region where the first initial element is located including at least one second initial element.
[0083] According to an embodiment of the present disclosure, the test module 840 includes at least one of the following: a first matching submodule, a second matching submodule, a third matching submodule, and a fourth matching submodule. The first matching submodule is used to match N characters of M characters with N characters for M characters in the reference element and N characters in the element to be tested, where N is an integer greater than or equal to 1 and M is an integer greater than or equal to N; the second matching submodule is used to match image elements in the element to be tested with image elements in the reference element for image similarity, where the image similarity is associated with at least one of structural similarity and a normalized correlation coefficient; the third matching submodule is used to match color information of the element to be tested with color information of the reference element; the fourth matching submodule is used to match relative position information of the element to be tested in the image to be tested with relative position information of the reference element in the reference image.
[0084] According to an embodiment of the present disclosure, the testing module 840 is further used to determine abnormal elements that are different from the reference elements from the elements to be tested.
[0085] According to an embodiment of the present disclosure, before the element to be tested is matched with the reference element of the reference page, at least one of the following items is further included: a first adjustment module and a second adjustment module. The first adjustment module is used to adjust the size of the image to be tested and the reference image; the second adjustment module is used to adjust the size of the element to be tested and the reference element.
[0086] According to an embodiment of the present disclosure, the page to be tested includes a display page of a first version of a target application, and the reference page includes a display page of a second version of the target application.
[0087] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure and application of user personal information involved comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.
[0088] In the technical solution of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0089] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0090] According to an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, where the computer instructions are used to enable a computer to execute the page testing method described above.
[0091] According to an embodiment of the present disclosure, a computer program product is provided, including a computer program / instruction, and when the computer program / instruction is executed by a processor, the page testing method described above is implemented.
[0092] Fig. 9 The block diagram is a block diagram of an electronic device for performing a page test to implement an embodiment of the present disclosure.
[0093] Fig. 9 A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device 900 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0094] like Fig. 9 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0095] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0096] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as the page test method. For example, in some embodiments, the page test method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by the computing unit 901, one or more steps of the page test method described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the page test method in any other appropriate manner (e.g., by means of firmware).
[0097] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0098] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable page test device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0099] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0100] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0101] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0102] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0103] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0104] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A page testing method, comprising: Determining a first initial element for the page to be tested based on page structure information of the page to be tested; For the image to be tested associated with the page to be tested, edge extraction is performed on the image to be tested to obtain a plurality of elements; In response to determining that a distance between adjacent elements of the plurality of elements is less than a preset distance, determining element types of the adjacent elements; In response to determining that the element types of the adjacent elements are consistent, merging the adjacent elements to obtain a second initial element; Determining an element to be tested for the page to be tested based on the first initial element and the second initial element; as well as A matching test is performed on the element to be tested and a reference element of a reference page.
2. The method according to claim 1, further comprising: Obtaining the reference element for the reference page; The acquiring the reference element for the reference page comprises: Determining a third initial element for the reference page based on the page structure information of the reference page; For a reference image associated with the reference page, identifying the reference image to obtain a fourth initial element for the reference image; and The reference element for the reference page is determined based on the third initial element and the fourth initial element.
3. The method according to claim 1, wherein: The determining, based on the first initial element and the second initial element, the element to be tested for the page to be tested comprises: Taking the second initial element as a reference, deleting blank elements from the first initial element; and The remaining first initial element is determined to be the element to be tested.
4. The method according to claim 1, wherein: The determining, based on the first initial element and the second initial element, the element to be tested for the page to be tested comprises: In response to the region where the first initial element is located including at least one second initial element, the first initial element is determined to be the element to be tested.
5. The method according to claim 1, wherein: The matching test of the element to be tested with the reference element of the reference page includes at least one of the following: For the M characters in the reference element and for the N characters in the element to be tested, matching N of the M characters with the N characters, where N is an integer greater than or equal to 1, and M is an integer greater than or equal to N; Performing image similarity matching between the image element in the element to be tested and the image element in the reference element, wherein the image similarity is associated with at least one of a structural similarity and a normalized correlation coefficient; Matching the color information of the element to be tested with the color information of the reference element; and The relative position information of the element to be tested in the image to be tested and the relative position information of the reference element in the reference image are matched.
6. The method according to claim 5, wherein: The testing of the element to be tested comprises: An abnormal element different from the reference element is determined from the elements to be tested.
7. The method according to claim 6, before performing a matching test on the element to be tested and a reference element of a reference page, further comprising at least one of the following: Adjusting the sizes of the image to be tested and the reference image; The sizes of the element to be tested and the reference element are adjusted.
8. The method according to any one of claims 1 to 7, wherein: The page to be tested includes a display page of a first version of a target application, and the reference page includes a display page of a second version of a target application.
9. A page testing device, comprising: A first determination module, configured to determine a first initial element for the page to be tested based on page structure information of the page to be tested; An extraction submodule, used for performing edge extraction on the image to be tested associated with the page to be tested to obtain a plurality of elements; a third determining submodule, configured to determine an element type of the adjacent elements in response to determining that the distance between adjacent elements among the plurality of elements is less than a preset distance; a merging submodule, configured to merge the adjacent elements in response to determining that the element types of the adjacent elements are consistent, to obtain a second initial element; A second determining module, configured to determine an element to be tested for the page to be tested based on the first initial element and the second initial element; as well as The testing module is used to perform a matching test on the element to be tested and a reference element of a reference page.
10. The apparatus according to claim 9, further comprising: An acquisition module, used for acquiring the reference element for the reference page; The acquisition module comprises: A first determining submodule, configured to determine a third initial element for the reference page based on the page structure information of the reference page; an identification submodule, configured to identify a reference image associated with the reference page, and obtain a fourth initial element for the reference image; and The second determining submodule is configured to determine the reference element for the reference page based on the third initial element and the fourth initial element.
11. The device according to claim 9, wherein: The second determining module comprises: a deletion submodule, configured to delete blank elements from the first initial element with reference to the second initial element; and The fourth determining submodule is used to determine that the remaining first initial elements are the elements to be tested.
12. The device according to claim 9, wherein: The second determining module comprises: The fifth determining submodule is configured to determine that the first initial element is the element to be tested in response to the region where the first initial element is located including at least one second initial element.
13. The device according to claim 9, wherein: The test module includes at least one of the following: A first matching submodule, for matching N of the M characters with the N characters in the element to be tested, wherein N is an integer greater than or equal to 1, and M is an integer greater than or equal to N; A second matching submodule, configured to perform image similarity matching between the image elements in the element to be tested and the image elements in the reference element, wherein the image similarity is associated with at least one of the structural similarity and the normalized correlation coefficient; A third matching submodule, configured to match the color information of the element to be tested with the color information of the reference element; and The fourth matching submodule is used to match the relative position information of the element to be tested in the image to be tested with the relative position information of the reference element in the reference image.
14. The device according to claim 13, wherein: The test module is also used to: An abnormal element different from the reference element is determined from the elements to be tested.
15. The apparatus according to claim 14, further comprising at least one of the following before performing a matching test on the element to be tested and a reference element of a reference page: A first adjustment module, used for adjusting the sizes of the image to be tested and the reference image; The second adjustment module is used to adjust the sizes of the element to be tested and the reference element.
16. The device according to any one of claims 9 to 15, wherein: The page to be tested includes a display page of a first version of a target application, and the reference page includes a display page of a second version of a target application.
17. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.
18. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 8.
19. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
UI page test method, device and equipment and readable storage medium
CN114218078A
System and methods for scalably identifying and characterizing structural differences between document object models
US20140173744A1