Page testing method, device, equipment and storage medium
By obtaining the page description information of the application page and using template icon dictionary and image matching technology, the location information of the components to be tested is automatically determined, which solves the problem of high testing costs and incompatibility in the existing technology, and achieves efficient and automated Apply page test.
Patent Information
- Application Number
- CN202411600492.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-11-11
AI Technical Summary
The prior art requires manual labeling of a large number of page images in application page testing to train a dedicated recognition model, resulting in high testing cost and low efficiency, and inability to compatible with update icons.
By obtaining the page description information of the application page, using template icon dictionary and image matching technology, the location information of the components to be tested is automatically determined to realize the testing of the application page.
Reduces the cost and time of application page testing, improves testing efficiency, and is automatically compatible with update icons without retraining the recognition model.
Smart Images

Figure CN119088721B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of Internet technology, artificial intelligence, and in particular to a page testing method, device, equipment and storage medium. Background Art
[0002] With the development of Internet technology, applications can provide a variety of services for users' life, work, study and other scenarios. For example, social applications can provide people with remote communication services, and live broadcast applications can provide people with online shopping, online learning and other services. In order to provide users with more convenient services, before the application goes online, or after the application is updated, it is necessary to test the application page of the application to test whether the functional logic of the application page meets the user's needs. At present, the page image of the application page is mainly identified by a dedicated recognition model to obtain the positioning information of the component to be tested in the application page, and the component to be tested is tested according to the positioning information of the component to be tested to realize the test of the application page. The dedicated recognition model here refers to a model for identifying the component to be tested in the page image and obtaining the location information of the component to be tested, that is, the dedicated recognition model has the ability to identify the component to be tested from the page image, and the ability to obtain the location information of the component to be tested. However, before using the dedicated recognition model, a large number of page images need to be manually annotated to train the dedicated recognition model using the annotated page images, resulting in a relatively high test cost of the application page and a relatively low test efficiency. Summary of the invention
[0003] The embodiments of the present application provide a page testing method, apparatus, device and storage medium to improve the testing efficiency for application pages and reduce testing costs.
[0004] An embodiment of the present application provides a page testing method, including:
[0005] Obtaining page description information of the application page; the page description information includes component description information, display mode and operation mode of the component to be tested in the application page;
[0006] When the display mode is an icon display mode, a first template icon that matches the component description information of the component to be tested is searched from a template icon dictionary, where the template icon dictionary is obtained from a code database corresponding to the application page;
[0007] When the first template icon is found in the template icon dictionary, the page image of the application page is compared with the first template icon, and the location information of the component to be tested is determined according to the comparison result;
[0008] According to the above location information and the above operation mode, a test page corresponding to the above component to be tested is obtained;
[0009] According to the page description information, the component test result of the component to be tested is determined in the test page, and the page test result of the application page is determined according to the component test result of the component to be tested.
[0010] An embodiment of the present application provides a page testing device, including:
[0011] An acquisition module is used to acquire page description information of an application page; the page description information includes component description information, display mode and operation mode of the component to be tested in the application page;
[0012] A query module, used for querying a first template icon that matches the component description information of the component to be tested from a template icon dictionary when the display mode is an icon display mode, wherein the template icon dictionary is obtained from a code database corresponding to the application page;
[0013] a processing module, configured to compare the page image of the application page with the first template icon when the first template icon is found in the template icon dictionary, and determine the location information of the component to be tested according to the comparison result;
[0014] A test module, used to obtain a test page corresponding to the component to be tested according to the location information and the operation mode;
[0015] The determination module is used to determine the component test result of the component to be tested in the test page according to the page description information, and determine the page test result of the application page according to the component test result of the component to be tested.
[0016] On one hand, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0017] On one hand, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.
[0018] On the one hand, an embodiment of the present application provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.
[0019] In the present application, when the display mode of the component to be tested is an icon display mode, the first template icon associated with the component description information of the component to be tested is queried from the template icon dictionary, and the page image of the application page is compared with the first template image through image matching technology to obtain the location information of the component to be tested. According to the location information and operation mode of the component to be tested, the component to be tested and the application page are tested. That is, the test process of the application page does not need to rely on a dedicated recognition model, and therefore, there is no need to manually annotate a large number of page images, which greatly reduces the test cost of the application page and improves the test efficiency of the application page. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 It is a schematic diagram of a page testing system provided by this application;
[0022] Figure 2 It is a flow chart of a page testing method provided by this application;
[0023] Figure 3 It is a flowchart of another page testing method provided by this application;
[0024] Figure 4 It is a flowchart of another page testing method provided by the present application;
[0025] Figure 5 This is a schematic diagram of a scenario for obtaining the location information of a component to be tested by a positioning method based on template matching provided in this application;
[0026] Figure 6 It is a schematic diagram of a process of updating a template icon dictionary provided by the present application;
[0027] Figure 7 This is a schematic diagram of a scenario for obtaining the location information of the component to be tested based on a positioning method based on a component list provided by the present application;
[0028] Figure 8 This is a scenario diagram of a positioning method based on copy information provided by this application to obtain the location information of the component to be tested;
[0029] Fig. 9 This is a schematic diagram of an application page and an update application page provided by the present application;
[0030] Fig.10 is a structural schematic diagram of a page testing device provided in an embodiment of the present application;
[0031] Fig.11 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application. At present, the page image of the application page is mainly identified by a dedicated recognition model to obtain the component to be tested in the page image and the position information of the component to be tested, and the component to be tested is tested according to the positioning information of the component to be tested to achieve the test of the application page. Because when the display mode of the component to be tested is an icon display mode, the icons of different components to be tested are different, and the icons here are different. It means that the color, shape, pattern, etc. of the icon are different. Therefore, this page test method has the following defects: First, before using the dedicated recognition model, a large number of page images need to be manually annotated to train the dedicated recognition model with the annotated page image, so that the dedicated recognition model can derive the component to be tested and the position information of the component to be tested based on the image features in the page image, resulting in a relatively high test cost of the application page and a relatively low test efficiency. Second, the dedicated recognition model is not compatible with the update icon in the application page, that is, the dedicated recognition model cannot recognize the update icon in the application page. As a result, the update icon needs to be re-trained for the dedicated recognition model, which again increases the testing cost of the application page and consumes a lot of device resources.
[0033] Based on this, a page testing method is proposed in the present application. The page testing method uses image matching technology to compare the page image of the application page with the first template image to obtain the location information of the component to be tested. According to the location information and operation mode of the component to be tested, the component to be tested is tested to achieve the test of the application page. The present application has the following advantages: (1) The test process of the application page does not need to rely on a dedicated recognition model. Therefore, there is no need to manually annotate a large number of page images, which greatly reduces the test cost of the application page and improves the test efficiency of the application page. (2) After the update icon appears in the application page, it only needs to add the update icon to the template icon dictionary to test the component to be tested corresponding to the update icon. That is, the present application can automatically be compatible with the update icon, and there is no need to train the dedicated recognition model again, which can save equipment resources, reduce testing costs, and has strong versatility and adaptability.
[0034] In order to facilitate a clearer understanding of the present application, the page testing system for implementing the present application is first introduced. Figure 1 As shown, the page test system includes a server and a terminal cluster. The terminal cluster may include one or more terminals, and the number of terminals is not limited. Figure 1 As shown, taking the terminal cluster including 4 terminals as an example, the terminal cluster can specifically include a first terminal, a second terminal, a third terminal, and a fourth terminal; it can be understood that the first terminal, the second terminal, the third terminal, and the fourth terminal can all be connected to the server through a network connection, so that each terminal can exchange data with the server through the network connection.
[0035] It is understandable that the server can be an independent physical server, or a server cluster or distributed system composed of at least two physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud knowledge bases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN) and big data and artificial intelligence platforms. The terminal can specifically refer to a vehicle-mounted terminal, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a screen speaker, a smart TV, a smart watch, etc., but is not limited to this. Each terminal and server can be directly or indirectly connected via wired or wireless communication. At the same time, the number of terminals and servers can be one or at least two, and this application does not limit this.
[0036] Each terminal may include an application to be tested, which may refer to an application that is about to be launched, has a function update, or needs to be tested. The application to be tested may be an independent application, a web application, or a small program in a host application. The application to be tested may refer to a content input application (i.e., an input method), a game application, a social application, a shopping application, a content publishing application, or the like.
[0037] The server may refer to a device used to test the application to be tested in the terminal. For the specific testing process, please refer to the following description.
[0038] For further information, see Figure 2 , is a flow chart of a page testing method provided by an embodiment of the present application. Figure 2 As shown, this method can be Figure 1 It can be executed by any terminal in the terminal cluster in Figure 1 can be executed by the server in Figure 1 The terminal and server in the terminal cluster are executed in collaboration. The devices used to execute the page test processing method in this application can be collectively referred to as computer devices. The method may include the following steps:
[0039] S101. Obtain page description information of an application page; the page description information includes component description information, display mode, and operation mode of the component to be tested in the application page.
[0040] In the present application, the computer device can input the component description information, display mode and operation mode of the component to be tested in the application page into the generative model, and generate the page description information of the application page based on the component description information, display mode and operation mode of the component to be tested in the application page through the generative model. Alternatively, the computer device can obtain the page description information of the application page from the test case set of the application page, that is, the page description information can be the test case written by the tester for the application page.
[0041] The application page may refer to any page in the application to be tested, or the application page may refer to an updated page in the application to be tested. The application to be tested may refer to an application that is about to be launched, or the application to be tested may refer to an application that has been launched and updated. The component to be tested may refer to any application component in the application page, or the component to be tested may refer to an application component whose attributes such as position and display mode are updated in the application page.
[0042] Among them, application components can be called user interface controls, which refer to visual components used to interact with users in a graphical user interface (GUI). These application components can help users perform various operations, such as inputting data, selecting options, triggering events, etc.
[0043] The page description information includes component description information, display mode and operation mode of the component to be tested in the application page; the component description information of the component to be tested is used to reflect at least one of the component name, purpose, and rough position of the component to be tested, and the rough position can reflect the approximate position of the component to be tested in the application page, such as the rough position can be the top, upper left corner, lower right corner, etc. of the application page. The display mode of the component to be tested can include an icon display mode or a text display mode, and the operation mode can include a button, a text box, a drop-down list, etc.
[0044] Among them, the operation mode of the component to be tested can be determined according to the component type of the component to be tested. For example, when the component type of the component to be tested is a button or a drop-down list, the operation mode of the component to be tested is a click mode; when the component type of the component to be tested is an input box, the operation mode of the component to be tested is an edit mode.
[0045] Among them, the page description information is used to indicate a test path in the application page, that is, the page description information is used to describe the test operation steps on a test path. A test path may include one or more components to be tested, that is, the page description information is used to describe the test operation steps of the components to be tested. The page description information may also include a name field (i.e., "name") and a path field (i.e., "path"). The name field is used to mark the test path corresponding to the page description information, and can be used to reflect the purpose of the test path. The path field is used to describe the test operation steps on the test path. Each element in the path field is a tuple. A tuple includes the component description information, display method, and operation method of a component to be tested in the application page.
[0046] For example, when it is necessary to view the avatar that the user has recently used, the page description information may be: {"name":"Recently used-page entry", "path":[("touch", "icon", "'User avatar' in the upper left corner of the page"), ("touch", "text", "Recently used")]}. That is, the purpose of the test path described in the page description information is to test whether the user avatar that the user has recently used can be viewed through the "Recently used-page entry" in the application page. The path field includes two elements, namely ("touch", "icon", "'User avatar' in the upper left corner of the page") and ("touch", "text", "Recently used"). In ("touch", "icon", "'User avatar' in the upper left corner of the page"), "touch" (i.e. click) means that the operation mode of the user avatar component is click mode, "icon" means that the display mode of the user avatar component is icon display mode, and "'User avatar' in the upper left corner of the page" refers to the component description information of the user avatar component. In ("touch", "text", "recently used"), "touch" means that the recently used component is operated by clicking, "text" means that the recently used component is displayed as text, and "recently used" means the component description information (name) of the recently used component. The components to be tested in the page description information include the recently used component and the user avatar component. The test operation steps include first clicking the user avatar component in the application page, and then clicking the recently used component.
[0047] S102. When the display mode is an icon display mode, a first template icon that matches the component description information of the component to be tested is searched from a template icon dictionary, where the template icon dictionary is obtained from a code database corresponding to the application page.
[0048] The first template icon may refer to a template icon whose icon description information in the template icon dictionary has a similarity greater than a similarity threshold with the component description information of the component to be tested, and the first template icon may refer to the icon of the component to be tested.
[0049] In one embodiment, the computer device may obtain a product requirement design file of the application page, the product requirement design file including a template icon of the third type of application component, add the template icon of the third type of application component and icon description information of the template icon to a code database, and then generate a template icon dictionary based on the code database. The product requirement design file may be designed by a designer of the application page for the application page.
[0050] The code database corresponding to the application page may refer to a code database of the application program to which the application page belongs.
[0051] Among them, the template icon of the third-category application component can refer to the icon of the third-category application component. The icons of the same third-category application component in different application pages are the same, such as the icons of text boxes in different application pages are all rectangular boxes. Therefore, the icon of the third-category application component can be called the template icon (i.e., the universal icon) of the third-category application component. That is, the third-category application component is an application component whose display mode is an icon display mode and has a template icon.
[0052] S103: When the first template icon is found in the template icon dictionary, the page image of the application page is compared with the first template icon, and the location information of the component to be tested is determined according to the comparison result.
[0053] In steps S102 and S103, when the display mode of the component to be tested is an icon display mode, the computer device can use the positioning mode based on template matching as the positioning mode of the component to be tested, and obtain the position information of the component to be tested according to the component description information of the component to be tested and the template matching mode. Specifically, the computer device can query the first template icon of the component to be tested from the template icon dictionary according to the component description information of the component to be tested. When the first template icon is not found in the template icon dictionary, it indicates that the component to be tested does not have a template icon, that is, the component to be tested has a specific icon, or the template icon of the component to be tested is updated. At this time, the computer device can update the template icon dictionary based on the code database to re-follow steps S102 and S103 to obtain the position information of the component to be tested, or it can obtain the position information of the component to be tested according to the component description information of the component to be tested and the positioning mode based on the component list. The specific process can be referred to the description below. When the first template icon is found in the template icon dictionary, it indicates that the component to be tested is an application component with a template icon. The computer device can use image matching technology to compare the page image of the application page with the first template icon to obtain a comparison result, and determine the location information of the component to be tested based on the comparison result. The location information of the component to be tested is obtained through the template icon dictionary without relying on a dedicated recognition model, which is conducive to improving the test efficiency for the application page and reducing the test cost.
[0054] The page image of the application page may be obtained by taking a screenshot of the application page, or the page image of the application page may be obtained by photographing the application page.
[0055] The comparison result here may include a target image area in the page image that has a matching relationship with the first template icon.
[0056] Among them, when the icons of the same application component in different application pages are different, the application component can be said to have a specific icon, that is, a non-universal icon. The application component with a specific icon can be called a first-class application component, that is, a first-class application component is an application component whose display mode is an icon display mode and has a template icon. For example, the user avatar component usually has different user avatars corresponding to different users. Therefore, the user avatar component can be said to have a specific icon. For example, if the user avatar of user 1 is a cartoon image, the icon of the user avatar component in the user page corresponding to user 1 is a cartoon image; if the user avatar of user 2 is a landscape image, the icon of the user avatar component in the user page corresponding to user 2 is a landscape image.
[0057] It should be noted that the template icon dictionary contains template icons, which can avoid adding specific icons to the template icon dictionary, resulting in too many icons in the template icon dictionary and increasing query time; that is, through the template icon dictionary, the template icon of the component to be tested is queried, which is conducive to improving query efficiency, and then improving the testing efficiency for the application page.
[0058] In one embodiment, Figure 3 In the embodiment of the present invention, after the computer device obtains the prior information, the page image, and the component list, the computer device can select the positioning method for the component to be tested based on the display mode of the component to be tested, and obtain the position information of the component to be tested based on the positioning method and description information of the component to be tested. The positioning method includes a positioning method based on copy information, a positioning method based on the component list, and a positioning method based on template matching. When the display mode of the component to be tested is an icon display mode, a positioning method based on template matching can be selected as the positioning method of the component to be tested. Since the template icon dictionary does not contain a specific icon, the positioning method based on template matching can obtain the position information of the component to be tested with the template icon, but cannot obtain the position information of the component to be tested with the specific icon. Therefore, when the positioning method based on template matching cannot obtain the position information of the component to be tested, the positioning method based on the component list can be selected as the positioning method of the component to be tested. When the display mode of the component to be tested is a text display mode, the positioning method based on copy information can be selected as the positioning method of the component to be tested. By adaptively selecting the positioning mode of the component to be tested based on the display mode of the component to be tested, it is helpful to improve the accuracy of the position information of the component to be tested.
[0059] in, Figure 3 The prior information in may refer to the above-mentioned page description information and template icon dictionary. The execution component may be used to perform a test operation on the component to be tested to obtain a page test result of the application page. For the specific implementation process, please refer to the description below.
[0060] Among them, the positioning method based on template matching may refer to obtaining the location information of the component to be tested based on the template icon dictionary, the positioning method based on the component list may refer to obtaining the location information of the component to be tested based on the component list, and the positioning method based on copy information may refer to performing text recognition on the page image of the application page to obtain the location information of the component to be tested.
[0061] It should be noted that the position information of the component to be tested reflects the precise position of the component to be tested in the application page, that is, the position information of the component to be tested may refer to the coordinates of the test component in the application page.
[0062] S104: According to the above position information and the above operation mode, a test page corresponding to the above component to be tested is obtained.
[0063] In the present application, an example is given in which the test path described by the page description information includes M components to be tested, where M is a positive integer. The computer device can perform a test operation on the i-th component to be tested in the above application page according to the location information of the i-th component to be tested and the above operation mode, and obtain a test page corresponding to the i-th component to be tested. When M is greater than 1, a test operation is performed on the i+1-th component to be tested in the above application page according to the location information of the i+1-th component to be tested and the above operation mode, and a test page corresponding to the i+1-th component to be tested is obtained, where i is a positive integer less than or equal to M, until all the M components to be tested are tested.
[0064] The i+1th component to be tested is a component to be tested whose execution order in the test path is after the execution order of the ith component to be tested, and the execution order of the components to be tested can be determined according to the page description information. The test page can refer to a page after the component to be tested in the application page is tested.
[0065] In one embodiment, the above step S104 may include: the computer device may generate a test operation instruction of the component to be tested according to the operation mode and location information of the component to be tested, that is, the test operation instruction includes the operation mode and location information of the component to be tested, and execute the above test operation instruction on the component to be tested through the execution component to obtain the test page corresponding to the component to be tested. Through the execution component, the user operation is simulated to automatically execute the above test operation instruction on the component to be tested, so as to realize the automated testing of the application page and improve the testing efficiency.
[0066] The execution component may refer to an executor that simulates user operations and executes test operation instructions on the application page. The executor may be a hardware device, a software program, or a module that combines software and hardware. For example, the execution component may refer to the airtest framework (i.e., a cross-platform automated testing framework).
[0067] Among them, the test operation instruction is used to instruct to locate the component to be tested in the application page according to the location information, and to perform the test operation on the component to be tested according to the operation mode. For example, when the operation mode is a click operation, a click operation is performed on the component to be tested, and the test page may refer to the page after the component to be tested in the application page is clicked; when the operation mode is an input operation, a preset content is entered in the component to be tested, and the preset content may be pre-set in the page description information, and the test page may refer to the page after the preset content is entered in the component to be tested in the application page.
[0068] S105. Determine the component test result of the component to be tested in the test page according to the page description information, and determine the page test result of the application page according to the component test result of the component to be tested.
[0069] In the present application, the computer device can determine the component test result of the above-mentioned component to be tested in the above-mentioned test page according to the above-mentioned page description information, and the component test result of the component to be tested is used to indicate that the component to be tested has passed the test, or to indicate that the component to be tested has not passed the test. Further, the page test result of the application page can be determined according to the component test results of M components to be tested. For example, when there is a component test result of the component to be tested that fails the test, it is determined that the application page test has failed, and a test result indicating that the application page test has failed is generated. When the component test results of all components to be tested are all passed, it is determined that the application page test has passed, and a test result indicating that the application page test has passed is generated.
[0070] In one embodiment, the component test result of the component to be tested is determined according to the test page and the page description information corresponding to the component to be tested, including: the computer device can determine the logic test result of the component to be tested according to the test page and the page description information by asserting the network model, and the logic test result reflects whether the component to be tested can implement a certain business or function. Display anomaly detection is performed on the page image of the test page to obtain a display anomaly detection result, and the display anomaly detection is used to detect whether there is erroneous content, black and white screen, etc. in the test page. The computer device can generate the component test result of the component to be tested according to the logic test result and the display anomaly detection result, that is, the component test result of the component to be tested includes the display anomaly detection result and the logic test result. By measuring the final test result of the component to be tested through multiple dimensions of display anomaly detection and business, it is conducive to improving the comprehensiveness of the test and the accuracy of the test.
[0071] The assertion network model may refer to a model for determining a page test result of an application page, the assertion network model may be trained based on a test page and page description information of a sample application component, the sample application page may refer to an application component in a sample page, and the sample page may refer to an application page in a variety of applications. The assertion network model may refer to a deep neural network model, a pre-trained model for language representation (BidirectionalEncoder Representations from Transformers, BERT), a mixed-element large model, etc.
[0072] Among them, the assertion network model is a model with the ability to generate test results. When the icon and text of the component to be tested change, the business function of the component to be tested will not change. Therefore, when the icon and text of the component to be tested change, there is no need to retrain an assertion network model, that is, the assertion network model can refer to a general assertion model. In one embodiment, the above-mentioned determination of the logic test result of the component to be tested based on the above-mentioned test page and the above-mentioned page description information includes: the computer device can generate the expected logical state of the component to be tested based on the page description information through the assertion network model, such as determining the purpose of the component to be tested based on the component description information in the page description information, and determining the expected logical state of the component to be tested according to the purpose of the component to be tested. According to the above-mentioned test page, determine the test logic state of the component to be tested. According to the above-mentioned expected logic state and the above-mentioned test logic state, determine the logic test result of the component to be tested, obtain the logic test result of the component to be tested through the assertion network model, and realize intelligent acquisition of logic test results, without manual writing and maintenance, strong versatility, and can obtain test results in various scenarios, that is, realize assertions for various scenarios.
[0073] The test logic state may refer to the logic state actually reached by the application page after the test operation instruction is executed; the expected logic state reflects the logic state expected to be reached by the application page after the test operation is executed on the component to be tested.
[0074] For example, if the component to be tested is a user avatar component, the expected logical state of the component to be tested may mean that when a click operation on the user avatar component is detected, the user avatar most recently used by the user is displayed. When the test page includes the user avatar most recently used by the user, the test logical state of the component to be tested is determined to be that the user avatar most recently used by the user is displayed, and a logical test result of the component to be tested is generated, that is, the logical test result indicates that the logic (function) of the component to be tested meets expectations (that is, the logical test passes). When the test page does not include the user avatar most recently used by the user, the test logical state of the component to be tested is determined to be that the user avatar most recently used by the user is not displayed, and a logical test result of the component to be tested is generated, that is, the logical test result indicates that the logic (function) of the component to be tested does not meet expectations (that is, the logical test fails).
[0075] In one embodiment, a computer device may generate a first assertion prompt information, and the first assertion prompt information is used to instruct to perform display anomaly detection on a test page to obtain a display anomaly detection result. The first assertion prompt information and the page image of the test page are input into the assertion network model, and through the assertion network model, based on the first assertion prompt information, the page image of the test page is detected for display anomaly to obtain a display anomaly detection result. For example, the first assertion prompt information is: "Judge whether the current page has obvious black and white screen, anomaly, or erroneous content". The first assertion prompt information is universal for all test pages. In the display anomaly detection process of the page image of the test page, only the page image of the test page is required, and no additional input information is required, thereby reducing the complexity of the display anomaly detection process.
[0076] In one embodiment, the computer device can generate second assertion prompt information based on the page description information, and the second assertion prompt information is used to indicate the test business result of the component to be tested based on the test page and the page description information, and to indicate the format of the logic test result, etc. For example, the second assertion prompt information is: [f"After executing step {step}, the test page is entered. The test point is {test_point}. According to the page description information and the test page, it is determined whether the test page obviously does not meet the expected function of the operation step. Return json format: {'Meets expectations': 'Yes / No', 'Reason for judgment':''}. Among them, the input parameter "step" is the description of the current step, that is, the component description information of the component to be tested in the path of the "page description information" (the last value in the tuple), and the input parameter "test_point" is the "name" field value in the "page description information". The computer device can input the second assertion prompt information and the page image of the test page into the assertion network model, and output the logical test result of the component to be tested through the assertion network model. The logical test result is associated with the page description information, and can detect whether the content displayed on the test page meets the expectations of the operation path. Through the assertion network model, a more intelligent and more general assertion method is implemented, and it can adapt to the frequent changes of the application to be tested. There is no need to manually write / modify clear assertion content for each test case or even each operation step, which greatly reduces the cost of manual writing and maintenance.
[0077] In one embodiment, when each application page includes a page description information, and the page description information includes M components to be tested, when M is greater than 1, the computer device can perform display anomaly detection on the test pages corresponding to the M components to be tested according to the above method, and obtain the display anomaly detection results corresponding to the M components to be tested, and determine the logic test result based on the page description information and the test page corresponding to the component to be tested that is last in the execution order, and determine the page test result of the application page according to the logic test result and the display anomaly detection results of the M components to be tested.
[0078] For example, when the display anomaly detection results of M components to be tested indicate that: no black and white screen, anomaly, erroneous content, etc. appear in the test pages corresponding to the M components to be tested, and the logic test results indicate that the logic tests of the M components to be tested have all passed, a page test result indicating that the application page test has passed is generated. When the display anomaly detection results of M components to be tested indicate that: a black and white screen, anomaly, erroneous content, etc. appear in the test page corresponding to at least one component to be tested, or the logic test results indicate that at least one component to be tested among the M components to be tested has failed the logic test, a page test result indicating that the application page test has failed is generated. The page test result may also include the reason why the application page test has failed, such as when the logic test of the user avatar component has failed, the page test result may indicate that the logic test of the user avatar component has failed.
[0079] In one embodiment, when the application page includes at least one page description information, and when the component test results of all components to be tested in each page description information are all passed, a page test result indicating that the application page test has passed is generated. When there is at least one page test description information in which the component test result of the component to be tested is a test failure, a page test result indicating that the application page test has not passed is generated, and at this time, the page test result may also include the reason why the application page test has not passed. For example, the page test result may also be used to indicate the page description information to which the component to be tested that has failed the test belongs (i.e., the test path indicating the test failure) and the reason why the component to be tested has failed the test; the reason why the component to be tested has failed the test includes the failure of the logic test of the component to be tested, and at least one of the display abnormalities in the test page corresponding to the component to be tested; the display abnormality includes at least one of a black and white screen, anomalies, and error content.
[0080] It should be noted that the components to be tested described in different page description information may be partially different or completely different, that is, different page description information is used to indicate the testing of different components to be tested in the application page. For example, the page description information n1 can be: {"name":"Recently used-page entry", "path":[("touch", "icon", "'User avatar' in the upper left corner of the top of the page"), ("touch", "text", "Recently used")]}, indicating that the user avatar component and the recently used component in the application page are tested. The page description information n2 is: ["name":"System settings page entry", "path":[("touch", "icon", "'User avatar' in the upper left corner of the top of the page"), ("touch", "icon", "setting")], which is used to indicate the testing of the user avatar component and the setting component in the application page. Please refer to the following for a detailed explanation of the page description information n2.
[0081] In the present application, when the display mode of the component to be tested is an icon display mode, the first template icon associated with the component description information of the component to be tested is queried from the template icon dictionary, and the page image of the application page is compared with the first template image through image matching technology to obtain the location information of the component to be tested. According to the location information and operation mode of the component to be tested, the component to be tested is tested. That is, the test process of the application page does not need to rely on a dedicated recognition model, and therefore, there is no need to manually annotate a large number of page images, which greatly reduces the test cost of the application page and improves the test efficiency of the application page.
[0082] For further information, see Figure 4 , is a flow chart of another page testing method provided by an embodiment of the present application. Figure 4 As shown, this method can be Figure 1 It can be executed by any terminal in the terminal cluster in Figure 1 can be executed by the server in Figure 1 The terminal and server in the terminal cluster are executed in collaboration. The devices used to execute the page testing method in this application can be collectively referred to as computer devices. The method may include the following steps:
[0083] S201. Obtain page description information of an application page; the page description information includes component description information, display mode, and operation mode of the component to be tested in the application page.
[0084] S202. When the display mode is an icon display mode, a first template icon that matches the component description information of the component to be tested is searched from a template icon dictionary, where the template icon dictionary is obtained from a code database corresponding to the application page.
[0085] In one embodiment, the template icon dictionary includes template icons and icon description information of the template icons; that is, the template icon dictionary includes template icons of the third category application components in the application page, and icon description information of the template icons. The step S202 includes: the computer device can determine the similarity between the icon description information of the template icon in the template icon dictionary and the component description information of the component to be tested based on a similarity algorithm. When the similarity between the first description information in the template icon dictionary and the component description information of the component to be tested is greater than a similarity threshold, the template icon indicated by the first description information is determined as the first template icon that conforms to the component description information of the component to be tested. By obtaining the first template icon of the component to be tested from the template icon dictionary, that is, the target icon dictionary contains the template icon but does not contain the specific icon, this is beneficial to the query efficiency for the first template icon.
[0086] The icon description information of the template icon reflects the icon name, function, etc. of the template icon, for example, icontemplates={"remind":"ic_mine_msg_remind@3x.png","setting":"ic_mine_ sysetm_setting@3x.png"}. Icon templates refers to the template icon dictionary, which includes two template icons, namely template icon p1 and template icon p2. "remind" reflects that the function of template icon p1 is reminder, that is, template icon p1 is the icon of the reminder component, and ic_mine_msg_remind@3x.png is the icon name of template icon p1. "setting" reflects that the function of template icon p2 is setting, that is, template icon p2 is the icon of the setting component, and "ic_mine_ sysetm_setting@3x.png" refers to the icon name of template icon p2.
[0087] S203 , dividing the page image of the application page into regions to obtain N image regions in the page image; N is an integer greater than 1.
[0088] In the present application, the computer device can divide the page image of the application page into regions according to the size of the first template icon to obtain N image regions in the page image, that is, the size of the N image regions is the same as the size of the first template icon.
[0089] S204: Search, from the N image regions, for a target image region that matches the first template icon.
[0090] In the present application, a computer device can query a target image area that has a matching relationship with the first template icon from N image areas, that is, the target image area can refer to an image area in the N image areas whose first matching degree with the first template icon is greater than a first matching degree threshold, and the target image area can refer to the area of the first template icon of the component to be tested in the application page.
[0091] In one embodiment, the above step S204 includes: the computer device can determine the first matching degree between the above N image areas and the first template icon respectively through the network positioning model, that is, the matching degree j between the image feature of the j-th image area and the icon feature of the first template icon is calculated through the network positioning model, and the matching degree j is determined as the first matching degree between the j-th image area and the first template icon, where j is an integer less than or equal to N. When there is an image area among the above N image areas whose first matching degree with the above first template icon is greater than the first matching degree threshold, it indicates that the corresponding image area whose first matching degree is greater than the first matching degree threshold is the icon area of the first template icon in the page image, and the computer device can determine the image area whose matching degree with the first template icon is greater than the matching degree threshold as the target image area having a matching relationship with the above first template icon.
[0092] Among them, the network positioning model here can be generated based on an image matching algorithm, and the image matching algorithm can include a template matching algorithm, a feature matching algorithm, an image matching algorithm based on a deep learning network, etc. The first matching degree threshold can be set by the user.
[0093] It should be noted that the network positioning model here only needs to have the ability to calculate the matching degree between text features and the matching degree between image features, that is, the network positioning model does not need to have the ability to identify the component to be tested from the page image. Therefore, the network positioning model can be called a universal recognition model. That is, any model that has the ability to calculate the matching degree between text features and the matching degree between image features can be used as a network positioning model, that is, there is no need to train a dedicated recognition model for the page testing process. Similarly, when the icon of the component to be tested in the application page is updated, it is only necessary to update the template icon dictionary. Through the network positioning model, the location information of the component to be tested can be obtained by comparing the template icon in the updated template icon dictionary with the page image. There is no need to retrain the network positioning model, which reduces the testing cost, improves the testing efficiency, and improves the versatility of the testing method.
[0094] The image feature may include at least one of pixel value, texture feature, shape feature, point and line feature, etc. The text feature may include at least one of semantic feature, vocabulary feature, part of speech feature, etc. The image feature and text feature may be represented by numbers or symbols.
[0095] In one embodiment, a computer device may perform a dot product operation on a first pixel matrix corresponding to an image area and a second pixel matrix of a first template icon to obtain a first degree of matching between the image area and the first template icon. The first pixel matrix may refer to the pixel values of the pixel points in the image area, and the second pixel matrix may refer to the pixel values of the pixel points in the second template icon.
[0096] It should be noted that the background of the template icon obtained in the code database is usually transparent, that is, the pixel values of the background area of the template image are all 0. In this way, in the process of comparing the first template icon with the page image, this will easily cause the first matching degree between each image area and the first template icon to tend to 0, affecting the comparison result, and failing to obtain the target image area that has a matching relationship with the first template icon. Based on this, the computer device can adjust the background color of the template icon (or the second template icon) in the code database to a non-transparent color, and add the adjusted template icon to the template icon dictionary. The non-transparent color can refer to a color with a pixel value other than 0, such as white. When the background of the template icon is white, the pixel value of the background area of the template icon is 255. This can avoid the influence of the transparent background on the comparison result of the template icon.
[0097] S205 . When the target image region is found from the N image regions, the position information of the component to be tested is generated according to the position of the target image region in the page image.
[0098] In the present application, when the target image area is found from the N image areas, the computer device may use the position of the target image area in the page image as the position information of the component to be tested. Alternatively, the computer device may calculate the center coordinates of the target image area in the page image and use the center coordinates as the position information of the component to be tested; the center coordinates may refer to the coordinates of the center point of the target icon area in the page image.
[0099] For example, Figure 5As shown, the application page 51a includes a setting component 52a, a user avatar recently used by the agent, and information published by the agent ("Today's News"), etc. The template icon dictionary includes a template icon 53a, and the icon description information of the template icon 53a ("settings": "icon name a1"), a template icon 54a, and the icon description information of the template icon 54a ("reminder": "icon name a2"). The icon description information of the template icon 53a can be expressed as: ("setting": "ic_mine_sysetm_setting@3x.png"); the icon description information of the template icon 54a can be expressed as: ("remind": "ic_mine_msg_remind@3x.png"). The page description information is used to indicate that the system setting page entry in the application page 51a is tested, and the page description information is: ["name": "system setting page entry", "path": [("click", "icon", "'user avatar' in the upper left corner of the top of the page"), ("click", "icon", "setting")]. The page description information can be expressed as: ["name":"System settings page entry", "path":[("touch", "icon", "'user avatar' in the upper left corner of the page"), ("touch", "icon", "setting")]. The page description information is used to indicate that the user avatar component and the setting component are tested to test whether the system settings page can be entered through the user avatar component and the setting component. After performing a test operation on the user avatar component (the specific implementation process can be found below), the computer device can perform a test operation on the setting component. Specifically, the computer device can determine that the display mode of the setting component is an icon display mode (i.e., "icon") based on the corresponding tuple ("click", "icon", "setting") of the setting component in the page description information. The computer device can respectively calculate the similarity between the component description information ("settings") of the setting component and the icon description information of the template icon 53a and the icon description information of the template icon 54a, such as encoding the component description information of the setting component to obtain the first text feature of the component description information of the setting component, encoding the icon description information of the template icon 53a and the icon description information of the template icon 54a to obtain the second text feature of the icon description information of the template icon 53a and the third text feature of the icon description information of the template icon 54a. Performing a dot product operation on the first text feature and the second text feature to obtain the similarity between the component description information of the setting component and the icon description information of the template icon 53a; performing a dot product operation on the first text feature and the third text feature to obtain the similarity between the component description information of the setting component and the icon description information of the template icon 54a.When the similarity between the icon description information of the template icon 53a and the component description information of the setting component is greater than the similarity threshold, the template icon 53a can be used as the first template icon of the setting component. The template icon 53a is compared with the page image of the application page 51a to calculate the first matching degree between the first template icon and the image area in the page image of the application page 51a. When the target image area with the first matching degree greater than the matching threshold is found in the application page 51a, the position of the target image area in the page image of the application page 51a can be used as the position information of the setting component. For example, the first matching degree between the target image area and the first template icon can be 0.99, and the position information of the setting component is: (994, 216).
[0100] It should be noted that, in performing a dot product operation between text features, if the lengths of the two text features are different, the lengths of the two text features can be adjusted to be the same length before performing the dot product operation. For example, when the size of the first text feature is smaller than the size of the second text feature, invalid characters can be added to the first text feature according to the size of the second text feature to obtain the added first text feature, and a dot product operation is performed on the added first text feature and the second text feature to obtain the similarity between the component description information of the component to be tested and the icon description information of the template icon 53a.
[0101] In one embodiment, Figure 6As shown, when the first template icon is not found in the template icon dictionary, or when the target image area is not found in the N image areas, the computer device can obtain a template icon list from the code database, and the template icon list includes the template icon of the third category application component in the application page, and the icon description information of the template icon. The computer device can use a similarity algorithm to calculate the similarity between the component description information of the component to be tested and the icon description information in the template icon list. When there is fourth description information in the template icon list whose similarity with the component description information of the component to be tested is greater than the similarity threshold, the template icon indicated by the fourth description information in the template icon list is determined as the second template icon of the component to be tested, that is, the second template icon that meets the description is obtained from the template icon list. When there is no fourth description information in the template icon list whose similarity with the component description information of the component to be tested is greater than the similarity threshold, it indicates that the component to be tested does not have a template icon, that is, the component to be tested has a specific icon, and the computer device can obtain the location information of the component to be tested according to the component description information of the component to be tested and the positioning method based on the component list. Please refer to the following description for details. When the second template icon is found from the template icon list, the computer device can use image matching technology to compare the page image of the application page with the second template icon to obtain the location information of the component to be tested. That is, the fourth matching degree between the image area in the page image of the application page and each second template icon is calculated, and the second template icon with a fourth matching degree greater than the fourth matching degree threshold is obtained. When the number of second template icons with a fourth matching degree greater than the fourth matching degree threshold is 1, the location information of the second template icon with a fourth matching degree greater than the fourth matching degree threshold can be used as the location information of the component to be tested. When the number of second template icons with a fourth matching degree greater than the fourth matching degree threshold is greater than 1, the second template icon with the greatest similarity between the description information in the second template icon with a fourth matching degree greater than the fourth matching degree threshold and the component description information of the component to be tested can be used as the target template icon, that is, the target template icon is the second template icon with the most consistent description, and the location information of the target template icon is used as the location information of the component to be tested, and the icon description information of the second template icon and the second template icon are updated to the template icon dictionary. It can be seen that when the first template icon is not found in the template icon dictionary, or when the target image area is not found in the N image areas, it indicates that the template icon of the first component to be tested has been updated, or the component to be tested does not have a template icon. The computer device can automatically maintain and update the template icon dictionary, so that the application can automatically be compatible with the new version of the template icon without manual script adjustment, thereby reducing the testing cost.
[0102] In one embodiment, when the second template icon is not found in the template icon list, it indicates that the component to be tested does not have a template icon, that is, the component to be tested has a specific icon, and the computer device can determine the location information of the component to be tested according to the component description information of the component to be tested and the positioning method based on the component list. Specifically, the computer device can determine the second matching degree between the component description information of the component to be tested and the component description information of the first type of application component in the component list through the network positioning model. The component list is obtained by performing component query on the application page, and the first type of application component is the application component displayed in the application page as an icon display mode, that is, the first type of application component is the application component displayed in the application page as an icon display mode and has a specific icon. When there is second description information in the component list, and the second matching degree between the component description information of the component to be tested is greater than the second matching degree threshold, the location information of the first type of application component indicated by the second description information is obtained from the component list; the location information of the first type of application component indicated by the second description information is determined as the location information of the component to be tested. It can be seen that for the components to be tested that have no copy and cannot be located based on the positioning method of template matching, the location information of the components to be tested can be obtained based on the positioning method of the component list, which is conducive to the comprehensive testing of the application components of the application page and improves the test coverage.
[0103] The network positioning model here may be generated based on a text matching algorithm, and the text matching algorithm may include a semantic matching algorithm, a text matching algorithm corresponding to a pre-trained language model, edit distance similarity, and the like.
[0104] Among them, the component description information of the first category application component in the component list may include the component name and copy indication information of the first category application component, and the copy indication information is used to indicate that the first category application component does not have copy. The component list may also include component description information of the second application component, and the component description information of the second category application component may include the component name, copy indication information and copy, that is, the copy indication information of the second category component is used to indicate that the second category application component is a component with a text display mode, that is, the second category application component has copy.
[0105] Among them, the component name can reflect the purpose of the component name, etc. The component name can be set by the R&D personnel, but there are cases where the component name has no real meaning, that is, there are cases where the component names of the first category application components are the same, such as the component names of the user avatar component and the search component are: ''android.view.view''. Based on this, when the above-mentioned second template icon is not queried from the template icon list, it indicates that the component to be tested does not have a template icon, that is, the component to be tested has a specific icon. The computer device can input the component list and the component description information of the component to be tested into the network positioning model. Through the network positioning model, based on the component description information (text indication information) in the component list, the location information of the first category application components is screened out. Through the network positioning model, based on the rough position in the component description information of the component to be tested and the location information in the component list, the location information of the component to be tested is obtained, which is conducive to improving the accuracy of positioning.
[0106] Among them, the network positioning model here can be a large language model generated based on at least one of a text matching algorithm, an image matching algorithm, etc. A large language model is a language model constructed by a deep neural network containing more than tens of billions of parameters. It analyzes a large amount of text data, learns the rules of language, the use of vocabulary, and the construction of sentences, so that it can understand human language and generate accurate and coherent responses. In terms of reasoning ability, when the scale of the large language model is large enough, the large language model itself has a certain reasoning ability. For simple reasoning problems, the large language model has performed well.
[0107] For example, when the display mode of the component to be tested is an icon display mode, the network positioning model can infer the location information of the component to be tested based on the page image of the application page and the template icon dictionary; or, the network positioning model can infer the location information of the component to be tested based on the component list and the component description information of the component to be tested. When the display mode of the component to be tested is a text display mode, the network positioning model can infer the location information of the component to be tested based on the page image of the application page and the component description information of the component to be tested.
[0108] For example, the component description information of the user avatar component is: "the 'user avatar' in the upper left corner of the page", and the component description information of the first-category application component u1 in the component list is: component name: ''android.view.view'' copy: None; the center coordinates (position information) are (97, 614). The network positioning model can use (97, 614) as the location information of the user avatar component because: among all the first-category application components, the center coordinates of the first-category application component u1 are located in the upper left corner of the page, and the copy indication information is None (i.e., no copy), which meets the characteristics of the user avatar.
[0109] For example, Figure 7As shown, the application page 71a includes a user avatar 72a, a user avatar recently used by the agent, and information published by the agent ("Today's News"), etc. The template icon dictionary includes a template icon 73a, and icon description information of the template icon 73a ("settings": "icon name a1"), a template icon 74a, and icon description information of the template icon 74a ("reminder": "icon name a2"). The icon description information of the template icon 73a can also be expressed as: ("setting": "ic_mine_sysetm_setting@3x.png"), and the icon description information of the template icon 74a can also be expressed as: ("remind": "ic_mine_msg_remind@3x.png"). The page description information is used to indicate that the system setting page entry in the application page 71a is tested. The page description information is: ["name":"system setting page entry", "path":[("click", "icon", "'user avatar' in the upper left corner of the top of the page"), ("click", "icon", "setting")], which can also be expressed as: ["name":"system setting page entry", "path":[("touch", "icon", "'user avatar' in the upper left corner of the top of the page"), ("touch", "icon", "setting")]. The page description information is used to indicate that the user avatar component and the setting component are tested to test whether the system setting page can be entered through the user avatar component and the setting component. In the test process for the user avatar component, the process of obtaining the position information of the user component avatar includes: the computer device can determine that the display mode of the user avatar component is the icon display mode (i.e., "icon") based on the corresponding tuple of the user avatar component in the page description information ("click", "icon", "'user avatar' in the upper left corner of the top of the page"). The computer device may select a template matching positioning method to obtain the location information of the user avatar component, that is, based on the component description information of the user avatar component, query the template icon dictionary, that is, calculate the similarity between the component description information of the user avatar component and the icon description information of the template icon 73a and the icon description information of the template icon 74a, such as encoding the component description information of the user avatar component to obtain the fourth text feature, encoding the icon description information of the template icon 73a and the icon description information of the template icon 74a to obtain the fifth text feature corresponding to the template icon 73a and the sixth text feature corresponding to the template icon 74a. Perform a dot product operation on the fourth text feature and the fifth text feature to obtain the first similarity between the component description information of the user avatar component and the icon description information of the template icon 73a; perform a dot product operation on the fourth text feature and the sixth text feature to obtain the second similarity between the component description information of the component to be tested and the icon description information of the template icon 74a.When both the first similarity and the second similarity are less than the similarity threshold, it indicates that the template icon of the user avatar component has not been found in the template icon dictionary, and it is determined that the query for the template icon dictionary has failed. The computer device can obtain the location information of the user avatar component based on the positioning method of the component list. For example, the component description information of the first type of application component u1 included in the component list is as follows: Component name: ''Component name a3'' Text: None; Center coordinates (location information) are (97, 614). Through the network positioning model, based on the location information in the component list, the first type of application component located in the upper left corner of the top of the page is determined, that is, based on the location information of the first type of application component u1, it is determined that the first type of application component u1 is located in the upper left corner of the top of the page, and (97, 614) can be used as the location information of the user avatar component.
[0110] In one embodiment, the computer device can obtain the component acquisition function in the test framework corresponding to the above application page, and the test framework can refer to a component set for obtaining component description information and location information of the first type of application components. For example, the test framework can refer to poco, which is a cross-platform automated testing framework. Based on the principle of application component search, poco obtains component description information and location information of the first type of application components, and is applicable to Android (Android), iOS (an operating system) native and various mainstream game engine applications. Poco can use poco ("OK").click () (component acquisition function) to obtain component description information and location information of the first type of application components. The computer device can use the above component acquisition function to perform component query on the above application page, obtain component description information of the first type of application components in the above application page, and location information of the above first type of application components; add the component description information and location information of the first type of application components to the above component list. By generating a component list, it is helpful to use the component list to locate the location information of the component to be tested.
[0111] In one embodiment, when the display mode of the component to be tested is a text display mode, the computer device can obtain the location information of the component to be tested based on the positioning mode of the text information. Specifically, when the display mode of the component to be tested is a text display mode, the computer device can perform text recognition on the page image of the above-mentioned application page based on a text recognition algorithm to obtain the component description information of the second-category application component in the application page, and the location information of the second-category application component; the above-mentioned second-category application component is an application component whose display mode in the above-mentioned application page is a text display mode. Through the network positioning model, the third matching degree between the component description information of the above-mentioned component to be tested and the component description information of the above-mentioned second-category application component is determined. When there is third description information in the component description information of the above-mentioned second-category application component, and the third matching degree between the component description information of the above-mentioned second-category application component and the component description information of the above-mentioned second-category application component is greater than the third matching degree threshold, the location information of the second-category application component indicated by the above-mentioned third description information is determined as the location information of the above-mentioned component to be tested. When the display mode of the component to be tested is a text type, the location information of the component to be tested is obtained based on the positioning mode of the text information, so as to improve the accuracy of obtaining the component to be tested.
[0112] Among them, the text recognition algorithm may include the text recognition algorithm may refer to optical character recognition (Optical Character Recognition, OCR), which may specifically include an OCR algorithm based on deep learning (Convolutional Recurrent Neural Networks, CRNN), a densely connected end-to-end OCR algorithm (Densenet-OCR), an end-to-end scene text detection algorithm (Efficient and Accurate Scene Text detection, EAST), etc.
[0113] The network positioning model here may be generated based on a text matching algorithm, and the text matching algorithm may include a semantic matching algorithm, a text matching algorithm corresponding to a pre-trained language model, edit distance similarity, and the like.
[0114] In one embodiment, the computer device can obtain the component description information and location data of the second-category application component in the page image through the OCR algorithm, and add the component description information and location of the second-category application component to the component list. When the component description information of the component to be tested can accurately match the component description information of a second-category application component in the component list (that is, it is exactly the same), the location information of the second-category application component can be used as the location information of the component to be tested.
[0115] For example, Figure 8As shown, the application page 81a includes a recently used component 82a, a user avatar recently used by the agent, and information published by the agent ("Today's News"), etc. The page description information can be: {"name":"Recently used page entry", "path":[("click", "icon", "'user avatar' in the upper left corner of the top of the page"), ("click", "text", "Recently used")]}, or can be expressed as: {"name":"Recently used-page entry", "path":[("touch", "icon", "'user avatar' in the upper left corner of the top of the page"), ("touch", "text", "Recently used")]}. The computer device can determine that the display mode of the recently used component 82a is a text display mode (i.e., "text") based on the corresponding tuple ("click", "text", "Recently used") of the recently used component 82a in the page description information. The computer device can select a positioning method based on the text information to obtain the location information of the recently used component 82a, that is, the computer device can perform text recognition on the page image of the application page 81a to obtain a text recognition result. The text recognition result includes ["recently used", (500, 500)], ["I created", (600, 500)]. "Recently used" in ["recently used", (500, 500)] refers to the component description information of the second-category application component z1, and (500, 500) is the location information of the second-category application component z1. "I created" in ["I created", (600, 500)] refers to the component description information of the second-category application component z2, and (600, 500) is the location information of the second-category application component z2. The component description information of the recently used component 82a is: "recently used", and the computer device can determine the third matching degree between the component description information of the recently used component 82a and the component description information of the second-category application component z1 and the component description information of the second-category application component z2. That is, the computer device can encode the component description information of the recently used component 82a to obtain the seventh text feature, encode the component description information of the second-category application component z1 and the component description information of the second-category application component z2 to obtain the eighth text feature corresponding to the second-category application component z1 and the ninth text feature corresponding to the second-category application component z2. The seventh text feature is multiplied by the eighth text feature to obtain the third matching degree between the component description information of the recently used component 82a and the component description information of the second-category application component z1, and the seventh text feature is multiplied by the ninth text feature to obtain the third matching degree between the component description information of the recently used component 82a and the component description information of the second-category application component z2.When the third matching degree between the component description information of the most recently used component 82a and the component description information of the second-category application component z1 is greater than the third matching degree threshold, the location information of the second-category application component z1 can be used as the location information of the most recently used component 82a, that is, (500, 500) can be used as the location information of the most recently used component.
[0116] In one embodiment, for some scenarios, it is not possible to accurately match, such as when the component description information of the component to be tested is: "Create an agent", and the component description information of the second type of application component included in the component list is: "+Create an agent". At this time, the computer device can determine the third matching degree between the component description information of the component to be tested and the component description information of the second type of application component in the component list through the network positioning model. When the third matching degree between "+Create an agent" and "Create an agent" is greater than the third matching threshold, the location information corresponding to "+Create an agent" can be determined as the location information of the component to be tested. The location information of the component to be tested is obtained based on the third matching degree, which is conducive to improving the positioning stability of the component to be tested whose display mode is text display mode.
[0117] It should be noted that the component description information of the second category application component in the component list refers to: the text displayed by the second category application component in the application page. If the second category application component is an intelligent agent creation component, the component description information of the intelligent agent creation component is: "+Create intelligent agent".
[0118] S206: According to the above position information and the above operation mode, a test page corresponding to the above component to be tested is obtained.
[0119] S207. Determine the component test result of the component to be tested in the test page according to the page description information, and determine the page test result of the application page according to the component test result of the component to be tested.
[0120] In one embodiment, when it is detected that an application page in the application to be tested is updated, the updated application page is obtained, and the application page is compared with the updated page to obtain a comparison result. When the comparison result indicates that the position of a first type of application component (i.e., an application component with a specific icon) in the application page is updated, the computer device can replace the position information of the first type of application component in the component list based on the updated position information of the first type of application component, so as to obtain the position information of the first type of application component based on the updated component list. When the first type of application component is tested, there is no need to rewrite the page description information for the first type of application component, thereby improving the reusability of the page description information, that is, the page description information has strong versatility and reduces maintenance costs.
[0121] In one embodiment, when the comparison result indicates that the text of the second-category application component (i.e., the application component displayed in text mode) in the application page is updated, the computer device can update the page description information corresponding to the second-category application component based on the updated text of the second-category application component to implement testing of the second-category application component. That is, through fewer update operations, the updated application component can be tested, reducing the cost of automated testing for the application page, and providing an effective solution for page testing of frequently iterated applications.
[0122] In one embodiment, when the comparison result indicates that the template icon or position of the third-category application component in the application page is updated, the computer device can update the template icon dictionary based on the template icon or position of the third-category application component, and obtain the position information of the third-category application component based on the updated template icon dictionary. That is, the page description information can be reused without modifying the information about the third-category application component in the page description information, which has strong versatility, and after each type of application component is updated, it is not necessary to manually mark and update the application page to train the network model, which reduces maintenance costs and can effectively solve the problem of too low ROI (return on investment) of automated test scripts in the use of applications.
[0123] The ROI here refers to the revenue brought by the tested application page divided by the test cost of the application page. The reason why the ROI of the automated test script in the application is too low is that the assertion method in the automated test script is fixed. Therefore, when the application page is updated, the automated test script cannot be reused and can only be discarded.
[0124] For example, Fig. 9As shown, application page 91b is the updated page of application page 91a, and application page 91a includes setting component 92a, prompt component 93a (i.e., notification component), and recently used component 94a. The display mode of setting component 92a and prompt component 93a is icon display mode, and the display mode of recently used component 94a is text display mode. Comparing application page 91a with application page 91b, it can be seen that the positions of setting component 92a and prompt component 93a in application page 91a are updated. Setting component 92a after the updated position can be marked as setting component 92b, and prompt component 93a after the updated position can be marked as prompt component 93b. The text of recently used component 94a is changed from "Latest Use" to "Used", and recently used component 94a after the updated text can be marked as recently used component 94b. The test path description information including setting component 92a is: {"name":"message notification page entrance", "path":[("touch", "icon", "'user avatar' in the upper left corner of the page"), ("touch", "icon", "setting")]}, ("touch", "icon", "setting") includes the operation mode ("touch"), display mode ("icon"), and description information ("setting") of the setting component. Since setting component 92b updates the location information relative to setting component 92a, setting component 92b can reuse the test path description information including setting component 92a. Similarly, the test path description information including prompt component 93a is: {"name":"message notification page entry", "path":[("touch", "icon", "'user avatar' in the upper left corner of the page"), ("touch", "icon", "remind")]}, ("touch", "icon", "remind") includes the component description information, display method, and operation method of prompt component 93a. Since prompt component 93b has updated the location information relative to prompt component 93a, prompt component 93b can reuse the test path description information including prompt component 93a.The page description information including the recently used component 94a can be: {"name":"Recently used-page entry", "path":[("touch", "icon", "'User avatar' in the upper left corner of the top of the page"), ("touch", "text", "Recently used")]}, ("touch", "text", "Recently used") includes the operation method ("touch"), display method ("text"), and description information ("Recently used") of the recently used component 94a. Since the recently used component 94b has updated the text (i.e., the description information) relative to the recently used component 94a, the page description information including the recently used component 94b can be: {"name":"Recently used-page entry", "path":[("touch", "icon", "'User avatar' in the upper left corner of the top of the page"), ("touch", "text", "Used")]}. In other words, by replacing the component description information "recently used" of the recently used component 94a with "used" in the page description information including the recently used component 94a, the page description information including the recently used component 94b can be obtained. It can be seen that the page description information in the present application has strong reusability and versatility, and low maintenance cost.
[0125] In the present application, a target image area that matches the first template icon is searched from the N image areas of the application page, and the position information of the component to be tested is determined based on the position of the target image area in the application page. According to the position information and operation mode of the component to be tested, the component to be tested is tested, that is, the testing process of the application page does not need to rely on a dedicated recognition model, and therefore, there is no need to manually annotate a large number of page images, which greatly reduces the testing cost of the application page and improves the testing efficiency of the application page.
[0126] See also Fig.10 , is a schematic diagram of the structure of a page testing device provided in an embodiment of the present application. Fig.10 As shown, the page testing device may include:
[0127] The acquisition module 1101 is used to acquire the page description information of the application page; the page description information includes the component description information, display mode and operation mode of the component to be tested in the application page;
[0128] A query module 1102 is used for querying a first template icon that matches the component description information of the component to be tested from a template icon dictionary when the display mode is an icon display mode, wherein the template icon dictionary is obtained from a code database corresponding to the application page;
[0129] The processing module 1103 is used for comparing the page image of the application page with the first template icon when the first template icon is found in the template icon dictionary, and determining the location information of the component to be tested according to the comparison result;
[0130] The testing module 1104 is used to obtain a test page corresponding to the component to be tested according to the location information and the operation mode;
[0131] The determination module 1105 is used to determine the component test result of the component to be tested in the test page according to the page description information, and determine the page test result of the application page according to the component test result of the component to be tested.
[0132] Optionally, the template icon dictionary includes a template icon and icon description information of the template icon;
[0133] Optionally, the query module 1102 is specifically used to determine the similarity between the icon description information of the template icon in the template icon dictionary and the component description information of the component to be tested;
[0134] When the similarity between the first description information and the component description information of the component to be tested in the template icon dictionary is greater than the similarity threshold, the template icon indicated by the first description information is determined as the first template icon that conforms to the component description information of the component to be tested.
[0135] Optionally, the processing module 1103 is specifically used to divide the page image of the application page into regions to obtain N image regions in the page image; N is an integer greater than 1;
[0136] From the N image regions, searching for a target image region that has a matching relationship with the first template icon;
[0137] When the target image region is found from the N image regions, the position information of the component to be tested is generated according to the position of the target image region in the page image.
[0138] Optionally, the processing module 1103 is specifically configured to:
[0139] Determine a first matching degree between the N image regions and the first template icon respectively;
[0140] When, among the N image areas, there is an image area whose first matching degree with the first template icon is greater than the first matching degree threshold, the image area whose matching degree with the first template icon is greater than the matching degree threshold is determined as the target image area having a matching relationship with the first template icon.
[0141] Optionally, the query module 1102 is further configured to:
[0142] When the first template icon is not found in the template icon dictionary, or when the target image area is not found in the N image areas, obtaining a template icon list from the code database;
[0143] According to the component description information of the component to be tested, searching the template icon list for a second template icon of the component to be tested;
[0144] When the second template icon is found in the template icon list, the page image of the application page is compared with the second template icon to obtain the location information of the component to be tested;
[0145] The icon description information of the second template icon and the second template icon are updated into the template icon dictionary.
[0146] Optionally, the query module 1102 is further configured to:
[0147] When the second template icon is not found in the template icon list, determining a second degree of match between the component description information of the component to be tested and the component description information of the first type of application component in the component list; the component list is obtained by performing a component query on the application page, and the first type of application component is an application component displayed in an icon display mode on the application page;
[0148] When the second description information exists in the component list and the second matching degree between the second description information and the component description information of the component to be tested is greater than a second matching degree threshold, obtaining the location information of the first type of application component indicated by the second description information from the component list;
[0149] The location information of the first type of application component indicated by the second description information is determined as the location information of the component to be tested.
[0150] Optionally, the acquisition module 1101 is further used for:
[0151] Get the component acquisition function in the test framework corresponding to the above application page;
[0152] By using the component acquisition function, a component query is performed on the application page to obtain component description information of the first type of application components in the application page and location information of the first type of application components;
[0153] Add the component description information and location information of the above-mentioned first category application components to the above-mentioned component list.
[0154] Optionally, the query module 1102 is further configured to:
[0155] When the display mode of the above-mentioned component to be tested is a text display mode, text recognition is performed on the page image of the above-mentioned application page to obtain component description information of the second type of application components in the above-mentioned application page, and location information of the above-mentioned second type of application components; the above-mentioned second type of application components are application components whose display mode is a text display mode in the above-mentioned application page;
[0156] Determine a third matching degree between the component description information of the component to be tested and the component description information of the second type of application components;
[0157] When there is third description information in the component description information of the above-mentioned second-category application component, and the third matching degree between the third description information and the component description information of the above-mentioned second-category application component is greater than the third matching degree threshold, the location information of the second-category application component indicated by the above-mentioned third description information is determined as the location information of the above-mentioned component to be tested.
[0158] Optionally, the testing module 1104 is specifically used for:
[0159] Generate a test operation instruction for the component to be tested according to the operation mode and position information of the component to be tested;
[0160] By executing the component, the test operation instruction is executed on the component to be tested in the application page to obtain a test page corresponding to the component to be tested.
[0161] Optionally, the determination module 1105 is specifically configured to:
[0162] Determine the logic test result of the component to be tested according to the test page and the page description information;
[0163] Performing display anomaly detection on the page image of the test page to obtain a display anomaly detection result;
[0164] According to the above logic test results and the above display abnormality detection results, the component test results of the above component to be tested are generated.
[0165] Optionally, the determination module 1105 is specifically configured to:
[0166] By asserting the network model, based on the page description information, an expected logical state of the component to be tested is generated; the expected logical state reflects the logical state that the application page is expected to reach after the component to be tested is subjected to the test operation;
[0167] According to the test page, determine the test logic state of the component to be tested;
[0168] The logic test result of the component to be tested is determined according to the expected logic state and the test logic state.
[0169] In the present application, when the display mode of the component to be tested is an icon display mode, the first template icon associated with the component description information of the component to be tested is queried from the template icon dictionary, and the page image of the application page is compared with the first template image through image matching technology to obtain the location information of the component to be tested. According to the location information and operation mode of the component to be tested, the component to be tested is tested. That is, the test process of the application page does not need to rely on a dedicated recognition model, and therefore, there is no need to manually annotate a large number of page images, which greatly reduces the test cost of the application page and improves the test efficiency of the application page.
[0170] See also Fig.11 , is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Fig.11 As shown, the above-mentioned computer device 1000 may refer to a terminal or a server, including: a processor 1001, a network interface 1004 and a memory 1005. In addition, the above-mentioned computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, in some embodiments, the user interface 1003 may include a display screen (DiSPlay), a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or it may be a non-volatile memory (non-volatileMeMory), such as at least one disk storage. The memory 1005 may also be optionally at least one storage device away from the aforementioned processor 1001. As Fig.11 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a computer program.
[0171] exist Fig.11 In the computer device 1000 shown, the network interface 1004 can provide a network communication function; the user interface 1003 is mainly used to provide an input interface; and the processor 1001 can be used to call the computer program stored in the memory 1005 to implement the following steps of the present application:
[0172] Obtaining page description information of the application page; the page description information includes component description information, display mode, and operation mode of the component to be tested in the application page;
[0173] When the display mode is an icon display mode, a first template icon that matches the component description information of the component to be tested is searched from a template icon dictionary, where the template icon dictionary is obtained from a code database corresponding to the application page;
[0174] When the first template icon is found in the template icon dictionary, the page image of the application page is compared with the first template icon, and the location information of the component to be tested is determined according to the comparison result;
[0175] According to the above location information and the above operation mode, a test page corresponding to the above component to be tested is obtained;
[0176] According to the page description information, the component test result of the component to be tested is determined in the test page, and the page test result of the application page is determined according to the component test result of the component to be tested.
[0177] Optionally, the template icon dictionary includes a template icon and icon description information of the template icon;
[0178] The processor 1001 may be used to call the computer program stored in the memory 1005 to implement the following steps of the present application:
[0179] Determine the similarity between the icon description information of the template icon in the template icon dictionary and the component description information of the component to be tested;
[0180] When there is first description information in the template icon dictionary and the similarity between the first description information and the component description information of the component to be tested is greater than a similarity threshold, the template icon indicated by the first description information is determined as the first template icon that conforms to the component description information of the component to be tested.
[0181] Optionally, the processor 1001 may be configured to call a computer program stored in the memory 1005 to implement the following steps of the present application:
[0182] Dividing the page image of the application page into regions to obtain N image regions in the page image; N is an integer greater than 1;
[0183] From the N image regions, searching for a target image region that has a matching relationship with the first template icon;
[0184] When the target image region is found from the N image regions, the position information of the component to be tested is generated according to the position of the target image region in the page image.
[0185] Optionally, the processor 1001 may be configured to call a computer program stored in the memory 1005 to implement the following steps of the present application:
[0186] Determine a first matching degree between the N image regions and the first template icon respectively;
[0187] When, among the N image areas, there is an image area whose first matching degree with the first template icon is greater than the first matching degree threshold, the image area whose matching degree with the first template icon is greater than the matching degree threshold is determined as the target image area having a matching relationship with the first template icon.
[0188] Optionally, the processor 1001 may be configured to call a computer program stored in the memory 1005 to implement the following steps of the present application:
[0189] When the first template icon is not found in the template icon dictionary, or when the target image area is not found in the N image areas, obtaining a template icon list from the code database;
[0190] According to the component description information of the component to be tested, searching the template icon list for a second template icon of the component to be tested;
[0191] When the second template icon is found in the template icon list, the page image of the application page is compared with the second template icon to obtain the location information of the component to be tested;
[0192] The icon description information of the second template icon and the second template icon are updated into the template icon dictionary.
[0193] Optionally, the processor 1001 may be configured to call a computer program stored in the memory 1005 to implement the following steps of the present application:
[0194] When the second template icon is not found in the template icon list, determining a second degree of match between the component description information of the component to be tested and the component description information of the first type of application component in the component list; the component list is obtained by performing a component query on the application page, and the first type of application component is an application component displayed in an icon display mode on the application page;
[0195] When the second description information exists in the component list and the second matching degree between the second description information and the component description information of the component to be tested is greater than a second matching degree threshold, obtaining the location information of the first type of application component indicated by the second description information from the component list;
[0196] The location information of the first type of application component indicated by the second description information is determined as the location information of the component to be tested.
[0197] Optionally, the processor 1001 may be configured to call a computer program stored in the memory 1005 to implement the following steps of the present application:
[0198] Get the component acquisition function in the test framework corresponding to the above application page;
[0199] By using the component acquisition function, a component query is performed on the application page to obtain component description information of the first type of application components in the application page and location information of the first type of application components;
[0200] Add the component description information and location information of the above-mentioned first category application components to the above-mentioned component list.
[0201] Optionally, the processor 1001 may be configured to call a computer program stored in the memory 1005 to implement the following steps of the present application:
[0202] When the display mode of the above-mentioned component to be tested is a text display mode, text recognition is performed on the page image of the above-mentioned application page to obtain component description information of the second type of application components in the above-mentioned application page, and location information of the above-mentioned second type of application components; the above-mentioned second type of application components are application components whose display mode is a text display mode in the above-mentioned application page;
[0203] Determine a third matching degree between the component description information of the component to be tested and the component description information of the second type of application components;
[0204] When there is third description information in the component description information of the above-mentioned second-category application component, and the third matching degree between the third description information and the component description information of the above-mentioned second-category application component is greater than the third matching degree threshold, the location information of the second-category application component indicated by the above-mentioned third description information is determined as the location information of the above-mentioned component to be tested.
[0205] Optionally, the processor 1001 may be configured to call a computer program stored in the memory 1005 to implement the following steps of the present application:
[0206] Generate a test operation instruction for the component to be tested according to the operation mode and position information of the component to be tested;
[0207] By executing the component, the test operation instruction is executed on the component to be tested in the application page to obtain a test page corresponding to the component to be tested.
[0208] Optionally, the processor 1001 may be configured to call a computer program stored in the memory 1005 to implement the following steps of the present application:
[0209] Determine the logic test result of the component to be tested according to the test page and the page description information;
[0210] Performing display anomaly detection on the page image of the test page to obtain a display anomaly detection result;
[0211] According to the above logic test results and the above display abnormality detection results, the component test results of the above component to be tested are generated.
[0212] Optionally, the processor 1001 may be configured to call a computer program stored in the memory 1005 to implement the following steps of the present application:
[0213] By asserting the network model, based on the page description information, an expected logical state of the component to be tested is generated; the expected logical state reflects the logical state of the application page after the test operation is executed on the component to be tested;
[0214] According to the test page, determine the test logic state of the component to be tested;
[0215] The logic test result of the component to be tested is determined according to the expected logic state and the test logic state.
[0216] In the present application, when the display mode of the component to be tested is an icon display mode, the first template icon associated with the component description information of the component to be tested is queried from the template icon dictionary, and the page image of the application page is compared with the first template image through image matching technology to obtain the location information of the component to be tested. According to the location information and operation mode of the component to be tested, the component to be tested is tested. That is, the test process of the application page does not need to rely on a dedicated recognition model, and therefore, there is no need to manually annotate a large number of page images, which greatly reduces the test cost of the application page and improves the test efficiency of the application page.
[0217] It should be understood that the computer device described in the embodiments of the present application can execute the description of the above-mentioned page testing method in the corresponding embodiments above, and can also execute the description of the above-mentioned page testing device in the corresponding embodiments above, which will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated.
[0218] The data collection and processing in this application should be strictly in accordance with the requirements of relevant laws and regulations when applied in practice, and the informed consent or separate consent of the personal information subject should be obtained. Subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.
[0219] In addition, it should be pointed out here that: the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the page testing device mentioned above, and the computer program includes program instructions. When the processor executes the program instructions, it can execute the description of the page testing method in the corresponding embodiment above, so it will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in the present application, please refer to the description of the method embodiment of the present application.
[0220] As an example, the above program instructions may be deployed on a computer device for execution, or deployed on at least two computer devices at one location for execution, or executed on at least two computer devices distributed at at least two locations and interconnected through a communication network. At least two computer devices distributed at at least two locations and interconnected through a communication network may constitute a blockchain network.
[0221] The computer-readable storage medium may be the page test device provided in any of the aforementioned embodiments or the central storage unit of the computer device, such as a hard disk or a memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SMART Media card, SMC), a secure digital (Secure digital, SD) card, a flash memory card (flaSh card), etc. equipped on the computer device. Further, the computer-readable storage medium may also include both the central storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0222] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish between contents in different media, rather than to describe a specific order. In addition, the terms "including" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, device, product, or equipment that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules that are not listed, or may optionally include other step units inherent to these processes, methods, devices, products, or equipment.
[0223] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0224] The data collection and processing in this application should be strictly in accordance with the requirements of relevant laws and regulations when applied in practice, and the informed consent or separate consent of the personal information subject should be obtained. Subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.
[0225] The embodiment of the present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, the description of the page testing method and the decoding method in the above corresponding embodiment is implemented, so it will not be repeated here. In addition, the description of the beneficial effects of the same method will not be repeated. For technical details not disclosed in the embodiment of the computer program product involved in the present application, please refer to the description of the method embodiment of the present application.
[0226] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0227] The method and related apparatus provided by the embodiment of the present application are described with reference to the method flow chart and / or structural diagram provided by the embodiment of the present application. Specifically, each process and / or box in the method flow chart and / or structural diagram, as well as the combination of the processes and / or boxes in the flow chart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable network connection device to generate a machine, so that the instructions executed by the processor of the computer or other programmable network connection device generate instructions for implementing the process in the process. Figure 1 A process or multiple processes and / or structures Figure 1These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable network-connected device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be loaded onto a computer or other programmable network connected device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A flow or multiple flows and / or structures illustrate the steps of the functions specified in one block or multiple blocks.
[0228] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A page testing method, characterized in that: include: Get the page description information of the application page; The page description information includes component description information, display mode and operation mode of the component to be tested in the application page; the component to be tested is any one of the M components to be tested in the test path indicated by the page description information, the test path is used to test the function of the application page, and one component to be tested corresponds to one execution order; M is an integer greater than 1; When the display mode is an icon display mode, a first template icon that matches the component description information of the component to be tested is queried from a template icon dictionary, wherein the template icon dictionary is obtained from a code database corresponding to the application page; the template icon dictionary includes template icons of third-category application components, and the template icons of the same third-category application component in different application pages are the same; When the first template icon is found in the template icon dictionary, the page image of the application page is compared with the first template icon, and the location information of the component to be tested is determined according to the comparison result; Obtaining a test page corresponding to the component to be tested according to the execution order and the location information and the operation mode; According to the page description information, component test results of the M components to be tested are determined in the test pages respectively corresponding to the M components to be tested, and page test results of the application page are determined according to the component test results of the M components to be tested, and the page test results include the test results of the functions in the application page.
2. The method according to claim 1, characterized in that The template icon dictionary includes template icons and icon description information of the template icons; The step of searching the template icon dictionary for a first template icon that matches the component description information of the component to be tested includes: Determine the similarity between the icon description information of the template icon in the template icon dictionary and the component description information of the component to be tested; When there is first description information in the template icon dictionary and the similarity between the first description information and the component description information of the component to be tested is greater than a similarity threshold, the template icon indicated by the first description information is determined as the first template icon that conforms to the component description information of the component to be tested.
3. The method according to claim 1, characterized in that The step of comparing the page image of the application page with the first template icon and determining the location information of the component to be tested according to the comparison result includes: Dividing the page image of the application page into regions to obtain N image regions in the page image; N is an integer greater than 1; Searching for a target image region having a matching relationship with the first template icon from the N image regions; When the target image area is found from the N image areas, the position information of the component to be tested is generated according to the position of the target image area in the page image.
4. The method according to claim 3, characterized in that The step of searching, from the N image regions, a target image region having a matching relationship with the first template icon comprises: Determining first matching degrees between the N image regions and the first template icon respectively; When, among the N image areas, there is an image area whose first matching degree with the first template icon is greater than a first matching degree threshold, the image area whose matching degree with the first template icon is greater than the matching degree threshold is determined as a target image area having a matching relationship with the first template icon.
5. The method according to claim 3, characterized in that The method further comprises: When the first template icon is not found in the template icon dictionary, or when the target image area is not found in the N image areas, acquiring a template icon list from the code database; According to the component description information of the component to be tested, querying the second template icon of the component to be tested from the template icon list; When the second template icon is found in the template icon list, the page image of the application page is compared with the second template icon to obtain the location information of the component to be tested; The icon description information of the second template icon and the second template icon are updated into the template icon dictionary.
6. The method according to claim 5, characterized in that The method further comprises: When the second template icon is not found in the template icon list, determining a second degree of match between the component description information of the component to be tested and the component description information of the first type of application components in the component list; the component list is obtained by performing a component query on the application page, and the first type of application components are application components displayed in an icon display mode on the application page; When the second description information exists in the component list and the second matching degree between the second description information and the component description information of the component to be tested is greater than a second matching degree threshold, obtaining the location information of the first type of application component indicated by the second description information from the component list; The location information of the first type of application component indicated by the second description information is determined as the location information of the component to be tested.
7. The method according to claim 6, characterized in that The method further comprises: Obtain a component acquisition function in the test framework corresponding to the application page; By using the component acquisition function, a component query is performed on the application page to obtain component description information of the first type of application components in the application page and location information of the first type of application components; Add the component description information and location information of the first type of application components to the component list.
8. The method according to claim 1, characterized in that The method further comprises: When the display mode of the component to be tested is a text display mode, text recognition is performed on the page image of the application page to obtain component description information of the second type of application components in the application page and location information of the second type of application components; the second type of application components are application components in the application page that are displayed in a text display mode; Determining a third degree of matching between the component description information of the component to be tested and the component description information of the second type of application components; When there is third description information in the component description information of the second-category application component, and the third matching degree between the third description information and the component description information of the second-category application component is greater than a third matching degree threshold, the location information of the second-category application component indicated by the third description information is determined as the location information of the component to be tested.
9. The method according to claim 1, characterized in that The obtaining, according to the location information and the operation mode, a test page corresponding to the component to be tested includes: Generate a test operation instruction of the component to be tested according to the operation mode and position information of the component to be tested; The test operation instruction is executed on the component to be tested in the application page through the execution component to obtain a test page corresponding to the component to be tested.
10. The method according to claim 1, characterized in that The determining, according to the page description information, component test results of the M components to be tested in the test pages respectively corresponding to the M components to be tested includes: Determining a logic test result of the component to be tested according to the test page and the page description information; Performing display anomaly detection on the page image of the test page to obtain a display anomaly detection result; A component test result of the component to be tested is generated according to the logic test result and the display abnormality detection result.
11. The method according to claim 10, characterized in that The step of determining the logic test result of the component to be tested according to the test page and the page description information includes: By asserting the network model, based on the page description information, an expected logical state of the component to be tested is generated; the expected logical state reflects the logical state that the application page is expected to reach after the test operation is executed on the component to be tested; Determining the test logic state of the component to be tested according to the test page; A logic test result of the component to be tested is determined according to the expected logic state and the test logic state.
12. A page testing device, characterized in that: include: The acquisition module is used to obtain the page description information of the application page; The page description information includes component description information, display mode and operation mode of the component to be tested in the application page; the component to be tested is any one of the M components to be tested in the test path indicated by the page description information, the test path is used to test the function of the application page, and one component to be tested corresponds to one execution order; M is an integer greater than 1; a query module, for querying a first template icon that matches the component description information of the component to be tested from a template icon dictionary when the display mode is an icon display mode, wherein the template icon dictionary is obtained from a code database corresponding to the application page; the template icon dictionary includes template icons of third-category application components, and the template icons of the same third-category application component in different application pages are the same; a processing module, configured to compare the page image of the application page with the first template icon when the first template icon is found in the template icon dictionary, and determine the location information of the component to be tested according to the comparison result; A test module, used to obtain a test page corresponding to the component to be tested according to the execution order, the location information and the operation mode; A determination module is used to determine component test results of the M components to be tested in the test pages respectively corresponding to the M components to be tested according to the page description information, and to determine the page test results of the application page according to the component test results of the M components to be tested, wherein the page test results include the test results of the functions in the application page.
13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
Citation Information
Patent Citations
Page control positioning method and device and storage medium
CN116594916A
Page element positioning method and device, equipment and medium
CN118116001A