Page testing method and related equipment
By using a page testing method based on control image recognition, the system automatically identifies the query page and determines the query conditions, solving the problem of low efficiency in front-end page testing in existing technologies, and realizing efficient automated testing and detection of system-level query scenario functions.
Patent Information
- Application Number
- CN202311446440.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-07-19
- Filing Date
- 2023-10-31
- Publication Date
- 2025-01-24
AI Technical Summary
In existing technologies, automated test cases for front-end pages need to be written manually, resulting in large test case volumes, high time consumption, and low testing efficiency.
By using a page testing method based on control image recognition, and leveraging an interactive database of query input controls and a pre-trained model, the system automatically identifies query pages and determines query conditions, thereby achieving automated page testing.
It improves the efficiency of page testing, achieves compatibility with different web systems, and enables usability testing of query scenario functions at the system level.
Smart Images

Figure CN119357043A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the computer field, and in particular to a page testing method and related equipment. Background Art
[0002] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is also the study of the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making. Research in the field of artificial intelligence includes robotics, natural language processing, computer vision, decision-making and reasoning, human-computer interaction, recommendation and search, basic AI theory, etc.
[0003] With the development of computer software technology, front-end pages are growing exponentially. The logical functions of pages can be tested through automated test cases on the World Wide Web (WEB). However, automated test cases on the WEB need to be written manually, and the volume of automated test cases on the WEB is large. It takes a lot of time to write test cases, and page testing is time-consuming. Summary of the invention
[0004] The present application provides a page testing method and related equipment, which can effectively improve the testing efficiency of the page.
[0005] In a first aspect, a page testing method is provided. The method can be executed by a page testing device, or by a chip in the page testing device.
[0006] The page testing method is used to test a query page, and includes the following steps: based on the first page including controls related to the query scenario, determining that the first page is a query page. The controls related to the query scenario include a query input control and / or a query trigger control, the query input control is used to input query conditions, and the query trigger control is used to trigger a query action. Determine the first query condition based on the prompt information of the query input control in the first page or the non-empty result list of the first page. The prompt information of the query input control is used to describe the input content of the query input control. Use the first query condition to test the first page to obtain a query result. Determine the test result of the first page based on the query result.
[0007] The query page refers to a page for querying a scenario, and the query input control refers to a control for inputting query conditions.
[0008] In this solution, based on the fact that the first page includes controls related to the query scenario, it can be determined that the first page is a query page, and then the first query condition is determined based on the prompt information of the query input control or the non-empty result list of the first page, and then the page test is completed according to the first query condition. This can realize page automated testing and effectively improve the testing efficiency of the page.
[0009] In a possible implementation of the first aspect, the determining that the first page is a query page based on the first page including controls related to the query scenario specifically includes the following steps: determining that the first page is a query page based on the first page including controls related to the query scenario and a result list. The result list is a query result list for outputting query results.
[0010] In a possible implementation of the first aspect, the first page includes a query input control, and the first page is tested using the first query condition to obtain a query result, specifically comprising the following steps: identifying a category of the query input control included in the first page. Based on the category of the query input control, determining an interaction mode of the query input control from a query input control interaction database. Inputting the first query condition into the query input control in the interaction mode of the query input control to obtain a query result.
[0011] In the embodiment of the present application, the interaction mode of the query input control is determined by querying the input control interaction database, and then the first query condition is input into the query input control in the interaction mode of the query input control. In this way, the page testing method of the embodiment of the present application can be applied to different WEB systems, and the page testing method has strong compatibility.
[0012] In a possible implementation of the first aspect, when the first query condition is a target date, the query input control is a date selection control. The first query condition is input into the query input control in an interactive manner of the query input control to obtain the query result, specifically comprising the following steps: based on the interactive manner of the query input control, a drop-down instruction is input into the date selection control to instruct the date selection control to display a date selection area. Based on the interactive manner of the query input control, a boundary recognition process is performed on the date selection area to obtain a boundary of the date selection area. Based on the interactive manner of the query input control, a navigation control in the date selection area is identified based on the boundary. Based on the interactive manner of the query input control, it is determined whether the date selection area includes the target date. When the date selection area does not include the target date, date navigation is performed based on the navigation control until the date selection area includes the target date. Alternatively, when the date selection area includes the target date, a date option extraction process is performed on the date selection area, and the target date is selected from the extracted date options. The query result is obtained based on the target date.
[0013] It can be seen that in this solution, when the first query condition is the target date, the date selection control is operated based on the interactive mode of the query input control so that the date selection control receives the target date information, and then obtains the query result corresponding to the target date.
[0014] In a possible implementation of the first aspect, when the above-mentioned first query condition is a target option, the query input control is a drop-down box control. The above-mentioned inputting the first query condition into the query input control in an interactive manner of the query input control to obtain the query result specifically includes the following steps: based on the interactive manner of the query input control, inputting a drop-down instruction into the drop-down box control to instruct the drop-down box control to display an option selection area. Based on the interactive manner of the query input control, performing boundary recognition processing on the option selection area to obtain the boundary of the option selection area. Based on the interactive manner of the query input control, performing option extraction processing on the option selection area based on the boundary to obtain a drop-down box option. Based on the interactive manner of the query input control, selecting a target option from the extracted drop-down box options. Obtaining the query result based on the target option.
[0015] It can be seen that in this solution, when the first query condition is a target option, based on the interaction mode of the query input control, the drop-down box control is operated so that the drop-down box control receives the target option information, and then obtains the query result corresponding to the target option.
[0016] In a possible implementation of the first aspect, when the first query condition is determined based on the non-empty result list of the first page, the page testing method further includes: sending a query trigger instruction to the query input control and / or query trigger control in the first page to obtain a non-empty result list of the first page.
[0017] In this solution, a query trigger instruction is input into the query input control to obtain a non-empty result list of the first page. For example, a query condition is input into the query input control to send a query trigger instruction to obtain a non-empty result list of the first page. Alternatively, a query trigger instruction is input into the query trigger control to obtain a non-empty result list of the first page. For example, a query trigger control is clicked to input a query trigger instruction to obtain a non-empty result list of the first page.
[0018] In a possible implementation of the first aspect, the above-mentioned determination of the first query condition based on the prompt information of the query input control in the first page or the non-empty result list of the first page specifically includes the following steps: determining that the prompt information of at least one query input control matches at least one header of the non-empty result list. Establishing a corresponding relationship between each query input control and the header. Using at least one control in the query input control as a target control. From the non-empty result list, determining at least one data item in the data column in the header corresponding to each target control as the first query condition.
[0019] In this solution, the prompt information of the query input control is matched with the table header, and then at least one control can be selected from the query input control as the target control, and then at least one data item is determined from the data column corresponding to the table header corresponding to the target control as the first query condition, and the first query condition is determined from the non-empty result list based on the prompt information of the query input control to realize automated testing of the query page.
[0020] In a possible implementation of the first aspect, the above-mentioned determination of the test result of the first page based on the query result specifically includes the following steps: obtaining a search method for the first page, the search method including one or more of an exact search, a fuzzy search, or a range search. Based on the query result and the search method, determining the test result of the first page.
[0021] In this solution, different test result judgment strategies are adopted for different search methods. The test method of the embodiment of the present application can test different search methods and the test is comprehensive.
[0022] In a possible implementation of the first aspect, the above-mentioned determination that the first page is a query page based on the first page including controls related to the query scenario specifically includes the following steps: using a first model to determine that the first page includes controls related to the query scenario, the first model is used for control recognition, and the first model is obtained based on control image training.
[0023] In this solution, the first page is identified using a pre-trained first model to determine whether the first page includes controls related to the query scenario, which can effectively improve the accuracy and speed of identifying the query page.
[0024] In a second aspect, the present application further provides a page testing device, comprising a unit or module for executing the page testing method of the first aspect.
[0025] In this solution, the page testing device can determine that the first page is a query page based on the fact that the first page includes controls related to the query scenario, and then determine the first query condition based on the prompt information of the query input control or the non-empty result list of the first page, and then complete the page test according to the first query condition, thereby realizing automatic page testing and effectively improving the testing efficiency of the page.
[0026] In a third aspect, the present application also provides a computing device cluster, comprising at least one computing device, each computing device comprising a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster performs the page testing method described in the first aspect.
[0027] In a fourth aspect, the present application further provides a computer-readable storage medium, comprising computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the page testing method as described in the first aspect.
[0028] In a fifth aspect, the present application further provides a computer program product comprising instructions, and when the instructions are executed by a computing device cluster, the computing device cluster executes the page testing method as described in the first aspect.
[0029] In a sixth aspect, the present application further provides a chip, comprising a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface to execute the page testing method described in the first aspect.
[0030] Optionally, as an implementation, the chip may further include a memory storing instructions, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute the page testing method described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The following is an introduction to the drawings used in the embodiments of the present application.
[0032] Figure 1A It is a schematic diagram of a system architecture provided by an embodiment of the present application;
[0033] Figure 1B is a schematic diagram of a page element provided in an embodiment of the present application;
[0034] Figure 1C is a schematic diagram of a page provided in an embodiment of the present application;
[0035] Figure 1D is a schematic diagram of a query input control interaction sub-model provided in an embodiment of the present application;
[0036] Figure 1E is a schematic diagram of another query input control interaction sub-model provided in an embodiment of the present application;
[0037] Figure 1F is a schematic diagram of another query input control interaction sub-model provided in an embodiment of the present application;
[0038] Figure 1G is a schematic diagram of another query input control interaction sub-model provided in an embodiment of the present application;
[0039] Figure 1H is a schematic diagram of another query input control interaction sub-model provided in an embodiment of the present application;
[0040] Fig. 1I is a schematic diagram of another query input control interaction sub-model provided in an embodiment of the present application;
[0041] Figure 1J is a schematic diagram of another query input control interaction sub-model provided in an embodiment of the present application;
[0042] Figure 1K It is a flow chart of establishing a query input control interaction sub-model provided by an embodiment of the present application;
[0043] Figure 2 It is a flow chart of a page testing method provided in an embodiment of the present application;
[0044] Figure 3 is a structural schematic diagram of a page testing device provided in an embodiment of the present application;
[0045] Figure 4 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0046] Figure 5 It is a structural diagram of a computer device cluster provided in an embodiment of the present application;
[0047] Figure 6 It is a structural diagram of another computer device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] The technical solution in this application will be described below in conjunction with the accompanying drawings.
[0049] Due to the applications involved in the embodiments of the present application, in order to facilitate understanding, the relevant terms and other related concepts involved in the embodiments of the present application are first introduced below.
[0050] In the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0051] The "at least one" mentioned in the embodiments of the present application refers to one or more, and "multiple" refers to two or more. "At least one of the following" or its similar expression refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, (a and b), (a and c), (b and c), or (a and b and c), where a, b, c can be single or multiple. "And / or" describes the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can be represented by: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are an "or" relationship. The serial numbers of the steps of the embodiments of the present application (such as step S1, step S21, etc.) are only for distinguishing different steps, and do not limit the order of execution between the steps.
[0052] Furthermore, unless otherwise specified, the ordinal numbers such as "first" and "second" used in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the order, timing, priority or importance of multiple objects. For example, the first device and the second device are only for the convenience of description, and do not represent the difference in structure, importance, etc. between the first device and the second device. In some embodiments, the first device and the second device can also be the same device.
[0053] In the above embodiments, the term "when..." can be interpreted as meaning "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modification, equivalent substitution, improvement, etc. made within the concept and principle of the present application shall be included in the protection scope of the present application.
[0054] (1) Page
[0055] A page is a web page, which is a file organized in the HyperText Markup Language (HTML) format on the World Wide Web. When searching for information on the World Wide Web, it appears in the form of an information page, which may include graphics, text, sound, video and other information.
[0056] (2) Page elements
[0057] Page elements refer to the content displayed on the screen, including navigation bars, text, images, animations, videos, graphic logos, and various controls.
[0058] (3) Controls
[0059] Controls refer to the encapsulation of data and methods. Controls include text input boxes (TextBox), button controls (Button), drop-down boxes (DropList), date / time controls (Date / TimePicker), (picture, file) upload controls (Upload), tree controls (TreeView), list boxes (ListBox), rich text boxes (RichTextBox) and other controls.
[0060] When the page belongs to a query scenario, that is, the page is a query page, the page at this time includes a query input control for receiving query content, such as a text input box, a drop-down box, a date / time selection control, etc.
[0061] (4) XML Path Language
[0062] Extensible Markup Language Path Language (XPath) is a language used to determine the location of a part in an Extensible Markup Language (XML) document, that is, a query language. XPath is based on the tree structure of XML and provides the ability to find nodes in the data structure tree.
[0063] With the development of computer software technology, the number of front-end pages has increased exponentially. The logical functions of the page can be tested through WEB automated test cases. However, WEB automated test cases are manually written, the volume of WEB automated test cases is large, the test case writing takes a lot of time, and page testing is time-consuming.
[0064] Therefore, the present application proposes a page testing method, which can realize automatic testing of query pages and effectively improve page testing efficiency.
[0065] The page testing method in the embodiment of the present application may be executed by a page testing device, or may be executed by a chip in the page testing device.
[0066] The following is an introduction to the system architecture of the page testing method according to an embodiment of the present application.
[0067] See attached Figure 1A , the embodiment of the present application provides a system architecture 100. As shown in the system architecture 100, the data acquisition device 160 is used to collect training data of the target model. In this embodiment, when the target model is a control recognition model, the training data is a control image in the page. The data acquisition device 160 stores the training data in the database 130.
[0068] The training device 120 can obtain the target model 101 based on the training data maintained in the database 130. The specific process of obtaining the target model 101 can refer to the specific description of the training process of the control recognition model below, which will not be repeated here. For example, in an embodiment of the present application, after completing the control recognition model training, the target model 101 can obtain the ability to recognize the specific type of control based on the control image. The training device 120 can be a server or a cloud service device, etc., and can also be a mobile phone terminal, a tablet computer, a laptop computer, AR / VR, a vehicle-mounted terminal, a monitoring device, a vehicle-mounted automatic driving system, an unmanned vending machine and other equipment.
[0069] It should be noted that, in actual applications, the training data maintained in the database 130 may not all come from the data acquisition device 160, but may also be received from other devices. It should also be noted that the training device 120 may not perform model training entirely based on the training data maintained by the database 130, but may also obtain training data from the cloud or other places for model training. The above description should not be used as a limitation on the embodiments of the present application.
[0070] The target model 101 obtained after the training device 120 is processed can be applied to a system or device with the same hardware configuration as the training device 120, such as Figure 1A The terminal device 110 shown in the figure can recognize and process the control image based on the target model 101 to obtain the corresponding control type. The terminal device 110 can be a terminal, such as a mobile terminal, a tablet computer, a laptop computer, AR / VR, a vehicle terminal, a monitoring device, a vehicle automatic driving system, an unmanned vending machine, etc., and can also be a server or a cloud. The training device 120 and the terminal device 110 can be the same device.
[0071] In the attached Figure 1AIn the embodiment, the terminal device 110 is configured with an I / O interface 112 for data interaction with an external device. The user can input data to the I / O interface 112 through the client device 140. In this embodiment, the input data can be a control image, which can be input by the user or from the database 130.
[0072] Optionally, the preprocessing module 113 is used to preprocess the input data received by the I / O interface 112. In the embodiment of the present application, the preprocessing module 113 is used to preprocess the input data received by the I / O interface 112, and the preprocessed data enters the calculation module 111. In the embodiment of the present application, the input data may be a control image, and the preprocessing module 113 may be used to preprocess the control image such as denoising or enhancement.
[0073] When the terminal device 110 preprocesses input data, or when the computing module 111 of the terminal device 110 performs calculations and other related processing, the terminal device 110 can call data, codes, etc. in the data storage system 150 for corresponding processing, and can also store data, instructions, etc. obtained from the corresponding processing in the data storage system 150.
[0074] Finally, illustratively, when the target model 101 is a control identification model, the I / O interface 112 returns the model processing result of the input data, ie, the control type, to the client device 140 to provide it to the user. At this time, the client device 140 may be a display.
[0075] In the attached Figure 1A In the case shown in , the user can manually input data, which can be operated through the interface provided by the I / O interface 112. In another case, the client device 140 can automatically send input data to the I / O interface 112. If the client device 140 needs to obtain the user's authorization to automatically send the input data, the user can set the corresponding permissions in the client device 140. The user can view the output results of the terminal device 110 on the client device 140, and the specific presentation form can be display, sound, action and other specific methods. The client device 140 can also be used as a data collection terminal to collect data such as Figure 1A The input data of the input I / O interface 112 and the output result of the output I / O interface 112 are taken as new sample data and stored in the database 130. Of course, it is also possible to collect data without going through the client device 140, but directly by the I / O interface 112. Figure 1A The input data of the input I / O interface 112 and the output result of the output I / O interface 112 are stored in the database 130 as new sample data.
[0076] It is worth noting that Figure 1AThis is only a schematic diagram of a system architecture provided by an embodiment of the present application. Figure 1A The positional relationship between the devices, components, modules, etc. shown in the figure does not constitute any limitation. Figure 1A In the embodiment, the data storage system 150 is an external memory relative to the terminal device 110. In other cases, the data storage system 150 may also be placed in the terminal device 110.
[0077] The following is an introduction to the training process of the control recognition model.
[0078] In the embodiment of the present application, the training process of the control recognition model specifically includes the following steps:
[0079] 1) Build a training set.
[0080] Taking the control recognition model corresponding to the first WEB system as an example, the pages of the first WEB system are crawled, and a training set is constructed by image cutting and manual annotation.
[0081] For example, by traversing each page of the first WEB system, screenshots are collected of all pages of the first WEB system. Image algorithms such as expansion, erosion, edge detection, and contour extraction are used to perform combination arrangement and parameter tuning to cut out various elements in the page. The various elements after cutting are deduplicated to obtain effective element images, and reference is made to the image processing algorithm. Figure 1B , Figure 1B It is a schematic diagram of a page element provided in an embodiment of the present application.
[0082] 2) Classify the training set.
[0083] By manually classifying the training set, multiple element categories are obtained. For example, the element categories include but are not limited to buttons (such as Figure 1B ), date input box (also called date selection control), drop-down box, drop-down condition input box, ordinary input box, logo, and ordinary text.
[0084] 3) Use the classified training set to train the neural network model.
[0085] The control recognition model is obtained by adjusting the parameters of the initial neural network model. For example, the open source model ResNet18 is selected for image training, and iterative training is performed until the control recognition accuracy reaches 99.5%.
[0086] By using the above steps 1) to 3), a control recognition model for identifying the control type of the first WEB system can be trained. In addition, when the training set in step 1) includes page elements of multiple WEB systems, the trained control recognition model can be used to identify the control types of multiple WEB systems, and has strong generalization ability.
[0087] The control type in the page can be determined through the control recognition model, and the page can be automatically identified as a query scene page according to the control type of the page. For example, when the page includes a query input control and a query trigger control, the page can be determined to be a query scene page, that is, a query page.
[0088] The query input control is a control used to input query conditions. The query input control includes at least one of the following: date input box, drop-down box, drop-down condition input box, common input box, etc. The query trigger control is a control used to trigger a query, for example Figure 1B In the example, the query trigger control may be a "search" button or a "find" button. For example, the query input control may directly trigger the query action without being triggered by the query trigger control. For example, after the query input control receives the input content, it automatically triggers the result query.
[0089] For example, reference Figure 1C , Figure 1C is a schematic diagram of a page provided in an embodiment of the present application; determined by a control recognition model Figure 1C The page includes query input controls such as the customer name input box 102 and query trigger controls such as the "search" button 103, which can determine Figure 1C The page shown is the query page.
[0090] The following is an introduction to the query input control interaction database.
[0091] The display marks of various types of controls in different WEB systems are the same or different. The embodiment of the present application models various query input controls and encapsulates the general interactive operations of each query input control to obtain a query input control interactive database. The query input control interactive database can be used to operate the same type of query input controls in different WEB systems to shield the differences between different WEB system pages.
[0092] Exemplarily, various query input controls in the first WEB system can be modeled to obtain an initial query input control interaction database, wherein the initial query input control interaction database includes initial query input control interaction sub-models corresponding to various query input controls. Then, various query input controls in other WEB systems such as the second WEB system are used for generalization training to obtain a final query input control interaction database. Similarly, the query input control interaction database includes query input control interaction sub-models corresponding to various query input controls. For example, the styles of navigation controls in date selection controls in different WEB systems are different. Exemplarily, the year and month navigation controls can be in the shape of a triangle or a finger. Through generalization training, the query input control interaction sub-model corresponding to the date selection control can recognize navigation controls of different styles.
[0093] refer to Figures 1D to 1K , respectively illustrate the query input control interaction sub-models corresponding to different query input controls. Among them, Figure 1D It indicates that the query input control is a drop-down box control (such as Figure 1D The query input control interaction sub-model (such as Figure 1D To the right of the middle vertical line), at this time, the general interactive operations of the query input control interaction sub-model include drop-down, boundary recognition, option extraction, target selection and reset. Drop-down refers to pulling down the option selection area of the drop-down box control to display. Boundary recognition refers to identifying the boundaries of the option selection area. Option extraction refers to extracting various options in the option selection area. Target selection refers to selecting a target option from various options. Resetting refers to deleting the selected drop-down box option and reselecting the drop-down box option. In the embodiment of the present application, the drop-down box control takes the selection of real-name authentication status as an example, and the real-name authentication status includes not real-name authenticated and real-name authentication under review.
[0094] Figure 1E It indicates that the query input control is a conditional input box control (such as Figure 1E The query input control interaction sub-model (such as Figure 1E The left side of the middle vertical line). At this time, the common interactive operations of the query input control interaction sub-model include condition selection, input, and reset. Condition selection refers to selecting the target condition through the drop-down box control. For specific methods of operating the drop-down box control, please refer to Figure 1D Input means inputting the corresponding content under the target condition. In the embodiment of the present application, the input condition of the conditional input box control is exemplified by the site name, site account (Identity document, ID) and site code. Reset means deleting the input content so as to re-enter the content.
[0095] Figure 1F It indicates that the query input control is an input box control (such as Figure 1F The query input control interaction sub-model (such as Figure 1F The left side of the vertical line in the middle), at this time, the general interactive operations of the query input control interaction sub-model include input and reset. In the embodiment of the present application, the input box control takes the input of a mobile phone number as an example. At this time, input refers to inputting a mobile phone number. Reset refers to deleting the input mobile phone number so that the mobile phone number can be re-entered.
[0096] Figure 1G It indicates that the query input control is a range input control (such as Figure 1G The query input control interaction sub-model (such as Figure 1G The left side of the vertical line in the middle), at this time, the general interaction operation of the query input control interaction sub-model includes an association combination control, which is used to establish an association relationship between the input controls corresponding to the range start point and the range end point. Among them, the range input control inputs the range start point and the range end point by calling the input box control. For specific methods of operating the input box control, please refer to Figure 1F In the embodiment of the present application, the range input box control takes the input of a score as an example.
[0097] Figure 1H It indicates that the query input control is a value range input box control (such as Figure 1H The query input control interaction sub-model (such as Figure 1H The left side of the vertical line in the middle), at this time, the general interactive operations of the query input control interactive sub-model include determining the numerical start and end values, inputting and resetting. Determining the numerical start and end values refers to determining the start and end values based on the data of the query input control interactive sub-model. Inputting refers to inputting the start and end values, which can be achieved by calling the input box control. For specific methods of operating the input box control, please refer to Figure 1F In the embodiment of the present application, the value range input box control takes the input of the total number of used discount coupons as an example. Resetting means deleting the input value so as to re-enter the value.
[0098] Fig. 1I It indicates that the query input control is a date selection control (such as Fig. 1I The query input control interaction sub-model (such as Fig. 1I(left side of the middle vertical line), at this time, the general interactive operations of the query input control interaction sub-model include pull-down, year-month navigation, date selection and reset, among which year-month navigation includes boundary recognition, navigation recognition and current year-month judgment; date selection includes option extraction and target selection. Pull-down refers to the pull-down display of the date selection area of the date selection control. Boundary recognition refers to identifying the boundary of the date selection area. Navigation recognition refers to identifying the navigation control in the date selection area based on the above boundary. Current year-month judgment refers to the judgment and processing of the current year and month in the date selection area and the year and month of the target date. Option extraction refers to extracting the date options in the date selection area. Target selection refers to selecting the day corresponding to the target date from various date options. Reset refers to deleting the selected date so that the date can be reselected.
[0099] Figure 1J It indicates that the query input control is a date range input box control (such as Figure 1J The query input control interaction sub-model (such as Figure 1J The left side of the middle vertical line), at this time, the common interactive operations of the query input control interactive sub-model include date start and end value determination, year and month navigation, date selection and reset. Among them, date start and end value determination refers to determining the start date and end date based on the data input into the query input control interactive sub-model. For the specific operations of year and month navigation and date selection, please refer to Fig. 1I , no further details are given. Based on the starting date and the ending date, the date input is realized by calling the date selection control. In the embodiment of the present application, the date range input box control takes the input of the registration time period as an example. Resetting means deleting the selected date so as to reselect the date.
[0100] The following takes the date selection control as an example to explain in detail the process of establishing the query input control interaction sub-model corresponding to the date selection control:
[0101] refer to Figure 1K , Figure 1K This is a flow chart of establishing a query input control interaction sub-model provided by an embodiment of the present application, which specifically includes the following steps:
[0102] 1. Extract the top container.
[0103] The top-level container of the date selection control is identified through an image comparison algorithm, and the Document Object Model (DOM) path of the top-level container is obtained.
[0104] Specifically, the two pages before and after the date selection control is clicked are compared to determine the area of the page that has changed. The DOM path of the top-level container is obtained based on the location information of the changed area. The top-level container can be regarded as the boundary of the date selection area of the date selection control.
[0105] 2. Extract the current year, month and navigation controls.
[0106] The year and month controls are extracted through the XPath information of the top-level container, and the navigation controls are extracted through image search.
[0107] Specifically, starting from the XPath information of the top-level container, find the control containing the year / month. Then, find the navigation control through the image-finding algorithm, such as Figure 1K The single triangle and double triangle in the figure are used for month navigation and the double triangle is used for year navigation.
[0108] 3. Extraction date.
[0109] The date control is extracted through the XPath information of the top-level container. Similarly, starting from the XPath information of the top-level container, each date control can be determined, such as Figure 1K “1”, “2”, … “31” in the middle.
[0110] 4. Unified interaction.
[0111] Convert the various controls determined in steps 1 to 3 into corresponding XPath information (i.e., control location information) to facilitate subsequent interactive operations. Encapsulate various operation functions based on the XPath information of the above various controls and the operation sequence of the date selection control to obtain the corresponding query input control interactive sub-model. Figure 1K It can be seen that the above operation sequence is pull-down, boundary recognition, navigation recognition (i.e., recognition of navigation controls), current year and month judgment, option extraction, and target selection. The above current year and month judgment operation includes: when the current year and month is the year and month corresponding to the target date, then enter the option extraction operation. If the current year and month is not the year and month corresponding to the target date, then perform the year and month navigation operation based on the navigation control until the current year and month is the year and month corresponding to the target date.
[0112] In addition, refer to Figure 1K The above operation sequence may also include reset. The implementation idea of the reset function is: use the image-finding algorithm to determine the reset control, then determine the XPath information corresponding to the reset control, and encapsulate the reset operation function based on the XPath information. Figure 1K For example, the currently selected date is 2023.05.12.21:01. By clicking the reset control, the currently selected date can be deleted and a new date can be selected.
[0113] The above page testing method is described in detail below.
[0114] The execution subject of the page testing method hereinafter takes a page testing device as an example.
[0115] refer to Figure 2 , Figure 2 2 is a flow chart of a page testing method provided by an embodiment of the present application. The page testing method 200 includes the following steps:
[0116] 201. A page testing device determines that a first page is a query page based on the fact that the first page includes controls related to a query scenario.
[0117] Specifically, the control related to the query scenario includes a query input control and / or a query trigger control, the query input control is used to input query conditions, and the query trigger control is used to trigger a query action. When it is determined that the first page includes a control related to the query scenario, the page testing device determines that the first page is a query page.
[0118] 202. The page testing device determines a first query condition based on prompt information of a query input control in a first page or a non-empty result list in the first page.
[0119] Specifically, the prompt information of the query input control is used to describe the input content of the query input control. When the first page is a query page, the page testing device can determine the first query condition based on the prompt information of the query input control in the first page, or the page testing device can determine the first query condition based on the non-empty result list of the first page.
[0120] 203. The page testing device tests the first page using the first query condition to obtain a query result.
[0121] Specifically, the page testing device tests the first page to obtain a query result corresponding to the first query condition.
[0122] 204. The page testing device determines a test result of the first page based on the query result.
[0123] Specifically, the page testing device can determine the test result of the query page according to the query result of the first query condition.
[0124] In an embodiment of the present application, the first page is determined to be a query page based on the fact that the first page includes controls related to the query scenario, and then the first query condition is determined based on the prompt information of the query input control or the non-empty result list of the first page, and then the test of the first page is completed according to the first query condition. This can realize page automated testing, effectively improve page testing efficiency, and achieve availability care of system-level query scenario functions.
[0125] In a possible embodiment, the first page includes page elements such as a navigation bar, text, images, animations, videos, graphic logos, and various controls. Based on the fact that the first page includes controls related to the query scenario, determining that the first page is a query page specifically includes the following steps:
[0126] A first model is used to determine that the first page includes controls related to the query scenario. The first model is used to perform control recognition. The first model is obtained by training based on control images.
[0127] Specifically, the page testing device determines whether the first page has image features related to the query scenario through image recognition technology, so as to automatically start the test process of the query page through image recognition.
[0128] Specifically, the training process of the first model, i.e., the control recognition model, can refer to the relevant records above and will not be repeated here. The controls related to the query scenario include query input controls and / or query trigger controls. Among them, the query input controls are various controls that can be used to enter query conditions, such as ordinary input boxes (such as Figure 1C Input boxes corresponding to "Customer Name", "Customer ID", "Department Code", and "Project Name") in the Figure 1C The drop-down box corresponding to the "Department Name" in Figure 1C The query trigger control is used to trigger the query, such as Figure 1C 103.
[0129] In the embodiment of the present application, the page testing device can extract element features in the first page through the control recognition model to automatically identify the query scenario. When the control recognition model recognizes that the first page includes controls related to the query scenario, the first page can be determined to be a query page.
[0130] In an embodiment of the present application, a pre-trained first model is used to perform recognition processing on the first page to determine whether the first page includes controls related to the query scenario, which can effectively improve the accuracy and speed of identifying the query page.
[0131] In a possible embodiment, the above step 201 specifically includes the following steps:
[0132] Based on the fact that the first page includes controls and a result list related to the query scenario, the page testing device determines that the first page is a query page.
[0133] The above result list is a query result list, which is used to output query results. Figure 1C The result list 104 is shown in FIG.
[0134] Exemplarily, when the result list text can be extracted from the first page and mapped into a two-dimensional table based on the position information and tag information of the elements in the first page (such as table headers, table rows and table elements), it can be determined that the first page includes a result list.
[0135] Further illustratively, the embodiment of the present application uses the selenium open source WEB testing framework, and adds a JavaScript program with specific functions to the testing framework to extract the elements under the table from the first page and perform table mapping. Specifically, all non-empty text elements under the / / table element are extracted from the first page through the JavaScript program, and mapped to a two-dimensional table according to the row and column coordinates of the elements. The first line of the two-dimensional table is the header of the result list, that is, the field name (such as Figure 1C The bold headers of the result list 104 in the two-dimensional table, i.e., customer ID, department code, etc.), each row above the second row of the two-dimensional table corresponds to a complete record, i.e., the value of each field. Compared with the visual extraction algorithm, the method of the embodiment of the present application has the characteristics of higher completeness and accuracy of text extraction (some columns are visually blocked), and lower computing resource consumption for text extraction (only a specific JavaScript program needs to be executed).
[0136] In a possible embodiment, the page testing device can also determine whether the first page is a query page by performing front-end text recognition on the first page, and when it is detected that there is text related to the query scenario in the first page, it can be determined that the first page is a query page. Exemplarily, the text related to the query scenario is "query", "retrieval", "search", etc. Alternatively, the page testing device can determine whether the first page is a query page through back-end script code analysis.
[0137] In a possible embodiment, in the above step 202, the page testing device determines the first query condition based on the non-empty result list of the first page, specifically including the following steps:
[0138] S21. The page testing device determines that prompt information of at least one query input control matches at least one header of a non-empty result list.
[0139] Exemplarily, the page testing device can determine the matching score between the prompt information of each query input control in the first page and the header of the non-empty result list. The matching score represents the degree of similarity between the header and the prompt information. Whether the header matches the query input control is determined based on the matching score.
[0140] refer to Figure 1CIn the result list 104, there are five table headers, namely, customer ID, department code, department name, project name, and time, and there are seven query input controls, namely, account name input control (prompt information is account name), customer name input box (prompt information is customer name), customer ID input box (prompt information is customer ID), department name drop-down box (prompt information is department name), department code input box (prompt information is department code), project name input box (prompt information is project name), and time range input box (prompt information is time). Therefore, the matching scores between the prompt information of the seven query input controls and the five table headers can be calculated respectively.
[0141] Exemplarily, in a query scenario, the prompt information of the query input control and the header of the result list are usually noun combination structures. The prompt information can be segmented using a word segmentation algorithm, and the matching score between the prompt information and the header can be calculated using a longest common subsequence algorithm.
[0142] As another example, the word vector corresponding to each prompt information and the word vector corresponding to each header can be calculated first, and then the word vector similarity is calculated based on the word vector of the prompt information and the word vector of the header, and the word vector similarity between the two word vectors is used as the matching score between the prompt information and the header.
[0143] The page testing device determines that each query input control matches the table header with the highest matching score. For example, among the five table headers of customer ID, department code, department name, project name and time, the matching score between the customer ID and the seven query input controls is the highest, and the customer ID input box is determined to match the table header of the customer ID.
[0144] S22. The page testing device establishes a corresponding relationship between each query input control and a table header.
[0145] Specifically, a corresponding relationship is established between each table header and the query input control with the highest matching score. Figure 1C In the table, for the Customer ID header, the prompt information with the highest matching score should be the Customer ID, so the Customer ID input box is matched with the Customer ID header. Similarly, for the Time header, the prompt information with the highest matching score should be the Time, so the Time Range input box is matched with the Time header.
[0146] Exemplarily, the result list is associated with the query input control through a word segmentation algorithm and a longest common subsequence algorithm, and the table header with the highest score is matched with the query input control, which has high accuracy and low computing resource consumption in the query scenario.
[0147] S23: The page testing device uses at least one control in the query input controls as a target control.
[0148] Specifically, when determining the first query condition, one or two or more controls in the query input controls of the first page can be used as target controls. For example, the time range input box can be used as the target control, or the department name drop-down box and the project name input box can be used as the target control.
[0149] S24. The page testing device determines at least one data item from the data column in the header corresponding to each target control in the non-empty result list as the first query condition.
[0150] Specifically, the page testing device determines at least one data item from the data column corresponding to the table header corresponding to the target control as the first query condition. Figure 1C When the target control is a time range input box, you can randomly select a time from 2022 / 1 / 1 and 2023 / 12 / 1 as the first query condition and enter it into the above time range input box control.
[0151] In an embodiment of the present application, the prompt information of the query input control is matched with the table header, and then at least one control can be selected from the query input control as the target control, and then at least one data item is determined from the data column corresponding to the table header corresponding to the target control as the first query condition, and the first query condition is determined from the non-empty result list based on the prompt information of the query input control to realize automated testing of the query page.
[0152] When there are more than two target controls, different combinations of first query conditions can be obtained from the corresponding two or more data columns. Figure 1C When the target control is the department name drop-down box and the project name input box, at least one data item can be determined as the first query condition from: Department 1, Department 2 and Project 1; for example, Department 1 or Department 2 can be used as the first query condition; Project 1 can be used as the first query condition; Department 1 and Project 1 can be used as the first query condition; or Department 2 and Project 1 can be used as the first query condition.
[0153] In a possible implementation manner, when determining the first query condition based on the non-empty result list of the first page, the page testing method further includes:
[0154] The page testing device sends a query trigger instruction to the query input control and / or the query trigger control in the first page to obtain a non-empty result list of the first page.
[0155] In the embodiment of the present application, the page testing device inputs a query trigger instruction into the query input control to obtain a non-empty result list of the first page. For example, the query condition is input into the query input control, that is, the query trigger instruction is sent to obtain a non-empty result list of the first page. At this time, the non-empty result list of the first page is the result list corresponding to the above query condition. The above query condition can be a condition input randomly, such as randomly selecting an option in a drop-down box or a radio button to input the query condition.
[0156] Alternatively, the page testing device inputs a query trigger instruction into the query trigger control to obtain a non-empty result list of the first page. For example, after entering the first page, the query trigger control is clicked to input the query trigger instruction to obtain a non-empty result list of the first page. At this time, the non-empty result list of the first page is a list corresponding to all the data in the result database corresponding to the first page.
[0157] As another example, when the first page is triggered to be entered, the query trigger instruction is triggered to be sent, so that when the first page is entered, a non-empty result list is displayed on the first page. At this time, the non-empty result list of the first page is a list corresponding to all the data in the result database (a database storing all data) corresponding to the first page.
[0158] In a possible embodiment, in the above step 202, the page testing device determines the first query condition based on the prompt information of the query input control in the first page. Specifically, the page testing device determines what types of conditions need to be input based on the prompt information of the query input control. For example, for the customer ID input box, the condition type to be input is the customer ID. For the time range input box, the condition type to be input is time.
[0159] Exemplarily, for a query input control that is a selection input control such as a drop-down box control or a radio button control, selectable input options can be obtained through prompt information of these controls, and the page testing device can select an option from these input options randomly or according to certain rules as the first query condition.
[0160] In a possible embodiment, the above step 203 specifically includes the following steps:
[0161] S31. The page testing device identifies the category of the query input control included in the first page.
[0162] Specifically, the page testing device first identifies the category of the query input control included in the first page.
[0163] S32. The page testing device determines the interaction mode of the query input control from the query input control interaction database based on the category of the query input control.
[0164] S33. The page testing device inputs the first query condition into the query input control in an interactive manner of the query input control to obtain a query result.
[0165] Specifically, the query input controls into which the first query condition is to be input are first identified, and then the first query condition is input into the query input control in an interactive manner corresponding to the control, so as to obtain the query result corresponding to the first query condition.
[0166] In the embodiment of the present application, the interaction mode of the query input control is determined by querying the input control interaction database, and then the first query condition is input into the query input control in the interaction mode of the query input control. In this way, the page testing method of the embodiment of the present application can be applied to different WEB systems, and the page testing method has strong compatibility.
[0167] In a possible embodiment, when the first query condition is a target date, the query input control is a date selection control. Fig. 1I The above step S33 specifically includes the following steps:
[0168] S331. The page testing device inputs a pull-down instruction to the date selection control based on the interactive mode of the query input control to instruct the date selection control to display a date selection area.
[0169] Specifically, the page testing device first inputs a pull-down instruction to the date selection control based on the interactive mode of the query input control to instruct the date selection control to display the date selection area, that is, to pull down the date selection area.
[0170] S332: The page testing device performs boundary recognition processing on the date selection area based on the interactive mode of the query input control to obtain the boundary of the date selection area.
[0171] S333. The page testing device identifies the navigation control in the date selection area based on the boundary based on the interactive mode of the query input control.
[0172] Specifically, the navigation control includes a year navigation control and a month navigation control. Fig. 1I , single triangle is used for month navigation, double triangle is used for year navigation.
[0173] S334. The page testing device determines whether the target date is included in the date selection area based on the interactive mode of the query input control; when the target date is not included in the date selection area, the query input control interactive model performs date navigation based on the navigation control until the target date is included in the date selection area. Alternatively, when the target date is included in the date selection area, the page testing device extracts date options from the date selection area based on the interactive mode of the query input control, and selects the target date from the extracted date options.
[0174] For example, reference Fig. 1I , the page test device first determines whether the currently displayed year and month are the year and month corresponding to the target date based on the interactive mode of the query input control. When the currently displayed year and month are the year and month corresponding to the target date, it indicates that the current date selection area includes the target date. The page test device extracts date options from the date selection area based on the interactive mode of the query input control, and selects the target date from the extracted date options. When the currently displayed year and month are not the year and month corresponding to the target date, it indicates that the current date selection area does not include the target date, and it is necessary to operate the navigation control for date navigation until the currently displayed year and month are the year and month corresponding to the target date. The page test device then extracts date options from the date selection area based on the interactive mode of the query input control, and selects the target date from the extracted date options.
[0175] S335. The page testing device obtains query results based on the target date.
[0176] In an embodiment of the present application, when the first query condition is a target date, the date selection control is operated based on the interactive mode of the query input control so that the date selection control receives the target date information, and then obtains the query result corresponding to the target date.
[0177] In another possible embodiment, when the first query condition is a target option, the query input control is a drop-down box control. Figure 1D The above step S33 specifically includes the following steps:
[0178] Step S336: The page testing device inputs a pull-down instruction to the drop-down box control based on the interaction mode of the query input control to instruct the drop-down box control to display an option selection area.
[0179] Step S337: The page testing device performs boundary recognition processing on the option selection area based on the interactive mode of the query input control to obtain the boundary of the option selection area.
[0180] Step S338: The page testing device performs option extraction processing on the option selection area based on the interaction mode of the query input control and the boundary to obtain the drop-down box options.
[0181] Step S339: The page testing device selects a target option from the extracted drop-down box options based on the interactive mode of the query input control.
[0182] Step S3310: The page testing device obtains query results based on the target options.
[0183] In an embodiment of the present application, when the first query condition is a target option, the drop-down box control is operated based on the interaction mode of the query input control so that the drop-down box control receives the target option information, and then obtains the query result corresponding to the target option.
[0184] In a possible embodiment, when determining the first query condition based on the non-empty result list of the first page, the page testing device compares the query result obtained in step S33 with the data in the non-empty result list to determine the test result of the first page.
[0185] In a possible embodiment, when the first query condition is determined based on the prompt information, the page testing device compares the query result obtained in step S33 with the data in the result database of the first page to determine the test result. For example, when the first query condition is a certain customer ID, when the test result is determined according to the result database to be all data columns corresponding to the customer ID, it can be determined that the test result passes the test.
[0186] In a possible implementation manner, the above step 204 specifically includes the following steps:
[0187] S41. The page testing device obtains a search method for the first page, where the search method includes one or more of precise search, fuzzy search, or range search.
[0188] Specifically, according to the prompt information of the query input control and the control type, the query is automatically divided into precise query, fuzzy query and range query.
[0189] S42: The page testing device determines the test result of the first page based on the query result and the search method.
[0190] Specifically, the page testing device can automatically determine the query result of step 203 according to the characteristics of the three different query types. In addition, the result comparison can also be performed in combination with the two-dimensional table obtained by the above processing.
[0191] For example, precise query corresponds to the query of account name, customer ID, department code, department name and project name, fuzzy query corresponds to the query of customer name, and range query corresponds to the query of time range.
[0192] For example, when the first query condition is a certain user name (such as Zhang San), and the query mode is an exact query, if the query results at this time are all data corresponding to the above user name, the page testing device can determine that the first page is in a normal state. Further, the page testing device can also combine the above two-dimensional table to compare each row of data in the query result row by row to determine whether the data in the query result is the same as the corresponding data in the two-dimensional table. If the comparison determines that the data is correct, the page testing device can determine that the query function of the first page is in a normal state. Otherwise, the page testing device can determine that the first page is in an abnormal state. If the query results are not all the above user names or there is no data, the page testing device can determine that the query function of the first page is in an abnormal state.
[0193] For another example, when the first query condition is a user name (such as Zhang San), and the query mode is fuzzy query, if the query results are all data including the above user name, such as data corresponding to user Zhang San, data corresponding to user Zhang San 1, and data corresponding to user Zhang San 2, then it can be determined that the query function of the first page is normal. When the query result is empty or not all data corresponding to the above user name, it can be determined that the query function of the first page is abnormal.
[0194] In the embodiment of the present application, different test result judgment strategies are adopted for different search methods. The test method of the embodiment of the present application can test different search methods and the test is comprehensive.
[0195] In a possible embodiment, the page testing method 200 further includes:
[0196] The page testing device outputs a test result of the first page.
[0197] Specifically, the page testing device can output the test result of the first page to the user through text, voice, display screen, etc., so that the user knows the test result of the first page.
[0198] By utilizing the embodiments of the present application, one only needs to write script code to call the control recognition model and query the input control interaction database for page testing. This allows one to complete autonomous testing of query scenarios of a WEB system and automatic reporting of query function anomalies through a few hundred lines of test script code, greatly improving the testing efficiency of system-level WEB pages and effectively improving the basic quality of the WEB system.
[0199] The above step numbers are only used to distinguish different steps and do not limit the order in which the steps are executed.
[0200] The method of the embodiment of the present application is described in detail above, and the device provided by the embodiment of the present application is introduced below.
[0201] Figure 3 A schematic diagram of a possible device structure provided in an embodiment of the present application. Figure 3 The page test device shown can be used to implement the functions of the above-mentioned page test method embodiment, and thus can also achieve the beneficial effects of the above-mentioned page test method embodiment. In the embodiment of the present application, the model training device can be an electronic device, or a module (such as a chip) applied to an electronic device.
[0202] like Figure 3 As shown, the page testing device 300 includes a determination module 301 and a testing module 302. The page testing device 300 is used to implement the above Figure 2 Alternatively, the page testing device 300 may include a device for implementing the above Figure 2 A module for any function or operation in the page testing method embodiment shown in the figure may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
[0203] When the page testing device 300 is used to implement Figure 2 When the functions in the method embodiment shown are performed, the determination module 301 is used to determine that the first page is a query page based on the fact that the first page includes controls related to the query scenario. The above-mentioned controls related to the query scenario include query input controls and / or query trigger controls, the above-mentioned query input controls are used to input query conditions, and the above-mentioned query trigger controls are used to trigger query actions. The determination module 301 is also used to determine the first query condition based on the prompt information of the query input control in the first page or the non-empty result list of the first page. The prompt information of the above-mentioned query input control is used to describe the input content of the query input control. The testing module 302 is used to test the first page using the first query condition to obtain a query result. The determination module 301 is also used to determine the test result of the first page based on the query result.
[0204] In this solution, the page testing device 300 can determine that the first page is a query page based on the fact that the first page includes controls related to the query scenario, and then determine the first query condition based on the prompt information of the query input control or the non-empty result list of the first page, and then complete the page test according to the first query condition, thereby realizing automatic page testing and effectively improving the testing efficiency of the page.
[0205] In a possible embodiment, the page testing device 300 further includes:
[0206] The output module 303 is used to output the test result of the first page.
[0207] In a possible implementation manner, the determination module 301 is specifically configured to:
[0208] The first page is determined to be a query page based on the fact that the first page includes controls and a result list related to the query scenario. The result list is a query result list for outputting query results.
[0209] In a possible implementation manner, the test module 302 is specifically used to:
[0210] A category of a query input control included on the first page is identified.
[0211] Based on the category of the query input control, the interaction mode of the query input control is determined from a query input control interaction database.
[0212] Input the first query condition into the query input control in an interactive manner of the query input control to obtain the query result In a possible implementation, when the first query condition is a target date, the query input control is a date selection control. In inputting the first query condition into the query input control in an interactive manner of the query input control to obtain the query result, the test module 302 is specifically used to:
[0213] Based on the interaction mode of the query input control, a drop-down instruction is input to the date selection control to instruct the date selection control to display a date selection area.
[0214] Based on the interactive mode of the query input control, the boundary recognition processing is performed on the date selection area to obtain the boundary of the date selection area.
[0215] Based on the interaction mode of the query input control, the navigation control in the date selection area is identified based on the boundaries.
[0216] Based on the interaction mode of the query input control, it is determined whether the date selection area includes the target date. When the target date is not included in the date selection area, date navigation is performed based on the navigation control until the target date is included in the date selection area. Alternatively, when the target date is included in the date selection area, date option extraction processing is performed on the date selection area, and the target date is selected from the extracted date options.
[0217] Get query results based on a target date.
[0218] In a possible implementation, when the first query condition is a target option, the query input control is a drop-down box control. The test module 302 inputs the first query condition into the query input control in an interactive manner of the query input control to obtain the query result, specifically for:
[0219] Based on the interaction mode of the query input control, a drop-down instruction is input to the drop-down box control to instruct the drop-down box control to display an option selection area.
[0220] Based on the interactive mode of the query input control, a boundary recognition process is performed on the option selection area to obtain the boundary of the option selection area.
[0221] Based on the interactive mode of the query input control, the option selection area is processed for option extraction based on the boundary to obtain the drop-down box options.
[0222] Based on the interactive mode of the query input control, select the target option from the extracted drop-down box options.
[0223] Get query results based on target options.
[0224] In a possible implementation manner, when the determination module 301 determines the first query condition based on the non-empty result list of the first page, the page testing device further includes:
[0225] The sending module is used to send a query trigger instruction to the query input control and / or the query trigger control in the first page to obtain a non-empty result list of the first page.
[0226] In a possible implementation manner, the determination module 301 is specifically configured to:
[0227] It is determined that the prompt information of at least one query input control matches at least one header of the non-empty result list.
[0228] Establish a corresponding relationship between each query input control and the table header.
[0229] Make at least one control in the query input control the target control.
[0230] From the non-empty result list, at least one data item is determined from the data column in the table header corresponding to each target control as the first query condition.
[0231] In a possible implementation manner, the determination module 301 is specifically used to determine the test result of the first page based on the query result:
[0232] A search method for the first page is obtained, where the search method includes one or more of an exact search, a fuzzy search, or a range search.
[0233] Based on the query results and the search method, the test results of the first page are determined.
[0234] In a possible implementation manner, the determination module 301 is specifically configured to:
[0235] A first model is used to determine that the first page includes controls related to the query scenario. The first model is used to perform control recognition. The first model is obtained by training based on control images.
[0236] Among them, the determination module, the test module, the output module and the sending module can all be implemented by software, or can be implemented by hardware. Exemplarily, the implementation of the determination module is introduced below by taking the determination module as an example. Similarly, the implementation of the test module, the output module and the sending module can refer to the implementation of the determination module.
[0237] As an example of a software functional unit, a module can be determined to include code running on a computing instance. Among them, the computing instance can include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance can be one or more. For example, the module can be determined to include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code can be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code can be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with close geographical locations. Among them, usually a region can include multiple AZs.
[0238] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0239] As an example of a hardware functional unit, the module can include at least one computing device, such as a server, etc. Alternatively, the module can also be implemented using an application-specific integrated circuit (ASIC) or a device implemented using a programmable logic device (PLD). The PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0240] The multiple computing devices included in the determination module can be distributed in the same region or in different regions. The multiple computing devices included in the determination module can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the determination module can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0241] It should be noted that, in other embodiments, the determination module can be used to execute any step in the page testing method, the test module can be used to execute any step in the page testing method, the output module can be used to execute any step in the page testing method, and the sending module can be used to execute any step in the page testing method. The steps that the determination module, the test module, the output module, and the sending module are responsible for implementing can be specified as needed. The full functions of the page testing device are realized by respectively implementing different steps in the page testing method through the determination module, the test module, the output module, and the sending module.
[0242] The present application also provides a computing device 400. Figure 4 As shown, computing device 400 includes: bus 403, processor 401, memory 404 and communication interface 402. Processor 401, memory 404 and communication interface 402 communicate through bus 403. Computing device 400 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in computing device 400.
[0243] The bus 403 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The bus 403 is represented by only one line, but it does not mean that there is only one bus or one type of bus. The bus 403 may include a path for transmitting information between various components of the computing device 400 (for example, the memory 404, the processor 401, and the communication interface 402).
[0244] The processor 401 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0245] The memory 404 may include a volatile memory, such as a random access memory (RAM). The processor 401 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0246] The memory 404 stores executable program codes, and the processor 401 executes the executable program codes to respectively implement the functions of the aforementioned determination module, test module, output module, and sending module, thereby implementing the page test method. That is, the memory 404 stores instructions for executing the page test method.
[0247] The communication interface 402 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 400 and other devices or a communication network.
[0248] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.
[0249] like Figure 5 As shown, the computing device cluster includes at least one computing device 400. The memory 404 in one or more computing devices 400 in the computing device cluster may store the same instructions for executing the page testing method.
[0250] In some possible implementations, the memory 404 of one or more computing devices 400 in the computing device cluster may also store partial instructions for executing the page test method. In other words, the combination of one or more computing devices 400 may jointly execute instructions for executing the page test method.
[0251] It should be noted that the memory 404 in different computing devices 400 in the computing device cluster can store different instructions, which are respectively used to execute part of the functions of the page testing device. That is, the instructions stored in the memory 404 in different computing devices 400 can implement the functions of one or more modules among the determination module, the test module, the output module and the sending module.
[0252] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Figure 6 A possible implementation is shown. Figure 6 As shown, two computing devices 400A and 400B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 404 in the computing device 400A stores instructions for executing the functions of the determination module. At the same time, the memory 404 in the computing device 400B stores instructions for executing the functions of the test module and the output module.
[0253] Figure 6 The connection method between the computing device clusters shown may be based on the consideration that the page testing method provided in the present application requires a large amount of data storage, and therefore the functions implemented by the testing module and the output module are considered to be executed by the computing device 400B.
[0254] It should be understood that Figure 6 The functions of the computing device 400A shown in FIG. 4 may also be completed by multiple computing devices 400. Similarly, the functions of the computing device 400B may also be completed by multiple computing devices 400.
[0255] The embodiment of the present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the page testing method.
[0256] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the page test method.
[0257] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.
Claims
1. A page testing method, characterized in that: For testing a query page, the method includes: Determining that the first page is a query page based on the first page including controls related to the query scenario, wherein the controls related to the query scenario include a query input control and / or a query trigger control, wherein the query input control is used to input a query condition, and the query trigger control is used to trigger a query action; determining a first query condition based on prompt information of a query input control in the first page or a non-empty result list of the first page, wherein the prompt information of the query input control is used to describe input content of the query input control; Using the first query condition to test the first page, to obtain a query result; A test result of the first page is determined based on the query result.
2. The method according to claim 1, characterized in that The step of determining that the first page is a query page based on the first page including a control related to the query scenario specifically includes: Based on the fact that the first page includes controls and a result list related to the query scenario, it is determined that the first page is a query page.
3. The method according to claim 1 or 2, characterized in that: The first page includes the query input control, and the first query condition is used to test the first page to obtain a query result, including: Identifying a category of the query input control included in the first page; Based on the category of the query input control, determining the interaction mode of the query input control from a query input control interaction database; The first query condition is input into the query input control in the interactive manner of the query input control to obtain the query result.
4. The method according to claim 3, characterized in that: The first query condition is a target date, the query input control is a date selection control, and the first query condition is input into the query input control in the interactive manner of the query input control to obtain the query result, including: Based on the interaction mode of the query input control, input a pull-down instruction to the date selection control to instruct the date selection control to display a date selection area; Based on the interaction mode of the query input control, performing boundary recognition processing on the date selection area to obtain the boundary of the date selection area; Based on the interaction mode of the query input control, identifying a navigation control in the date selection area based on the boundary; Based on the interaction mode of the query input control, determining whether the date selection area includes the target date; When the target date is not included in the date selection area, date navigation is performed based on the navigation control until the target date is included in the date selection area; or, when the target date is included in the date selection area, date option extraction is performed on the date selection area, and the target date is selected from the extracted date options; The query result is obtained based on the target date.
5. The method according to claim 3, characterized in that: The first query condition is a target option, the query input control is a drop-down box control, and the first query condition is input into the query input control in the interactive manner of the query input control to obtain the query result, including: Based on the interaction mode of the query input control, input a drop-down instruction to the drop-down box control to instruct the drop-down box control to display an option selection area; Based on the interaction mode of the query input control, performing boundary recognition processing on the option selection area to obtain the boundary of the option selection area; Based on the interaction mode of the query input control, the option selection area is subjected to option extraction processing based on the boundary to obtain drop-down box options; Based on the interaction mode of the query input control, selecting the target option from the extracted drop-down box options; The query result is obtained based on the target option.
6. The method according to any one of claims 1 to 5, characterized in that: When determining the first query condition based on the non-empty result list of the first page, the method further includes: Send a query trigger instruction to the query input control and / or the query trigger control in the first page to obtain the non-empty result list of the first page.
7. The method according to any one of claims 1 to 6, characterized in that: The determining the first query condition based on the prompt information of the query input control on the first page or the non-empty result list on the first page specifically includes: Determining that prompt information of at least one of the query input controls matches at least one header of the non-empty result list; Establishing a corresponding relationship between each of the query input controls and the table header; Taking at least one of the query input controls as a target control; From the non-empty result list, at least one data item is determined from the data column in the table header corresponding to each of the target controls as the first query condition.
8. The method according to any one of claims 1 to 7, characterized in that: The determining the test result of the first page based on the query result specifically includes: Acquire a search method for the first page, where the search method includes one or more of an exact search, a fuzzy search, or a range search; Based on the query result and the search method, a test result of the first page is determined.
9. The method according to any one of claims 1 to 8, characterized in that: The determining that the first page is a query page based on the first page including a control related to the query scenario includes: A first model is used to determine that the first page includes the control related to the query scenario, the first model is used to perform control recognition, and the first model is obtained by training based on control images.
10. A page testing device, characterized in that: include: a determination module, configured to determine that the first page is a query page based on the first page including controls related to the query scenario, wherein the controls related to the query scenario include a query input control and / or a query trigger control, wherein the query input control is used to input a query condition, and the query trigger control is used to trigger a query action; The determining module is further used to determine the first query condition based on prompt information of the query input control in the first page or a non-empty result list of the first page, wherein the prompt information of the query input control is used to describe the input content of the query input control; A testing module, used to test the first page using the first query condition to obtain a query result; The determination module is further configured to determine a test result of the first page based on the query result.
11. The device according to claim 10, characterized in that The determining module is specifically used to determine that the first page is a query page based on the first page including a control related to the query scenario: Based on the fact that the first page includes controls and a result list related to the query scenario, it is determined that the first page is a query page.
12. The device according to claim 10 or 11, characterized in that The first page includes the query input control, and the test module is specifically used for: Identifying a category of the query input control included in the first page; Based on the category of the query input control, determining the interaction mode of the query input control from a query input control interaction database; The first query condition is input into the query input control in the interactive manner of the query input control to obtain the query result.
13. The device according to claim 12, characterized in that The first query condition is a target date, the query input control is a date selection control, and the test module inputs the first query condition into the query input control in the interactive manner of the query input control to obtain the query result, specifically for: Based on the interaction mode of the query input control, input a pull-down instruction to the date selection control to instruct the date selection control to display a date selection area; Based on the interaction mode of the query input control, performing boundary recognition processing on the date selection area to obtain the boundary of the date selection area; Based on the interaction mode of the query input control, identifying a navigation control in the date selection area based on the boundary; Based on the interaction mode of the query input control, determining whether the date selection area includes the target date; When the target date is not included in the date selection area, date navigation is performed based on the navigation control until the target date is included in the date selection area; or, when the target date is included in the date selection area, date option extraction is performed on the date selection area, and the target date is selected from the extracted date options; The query result is obtained based on the target date.
14. The device according to claim 12, characterized in that The first query condition is a target option, the query input control is a drop-down box control, and the test module inputs the first query condition into the query input control in the interactive manner of the query input control to obtain the query result, specifically for: Based on the interaction mode of the query input control, input a drop-down instruction to the drop-down box control to instruct the drop-down box control to display an option selection area; Based on the interaction mode of the query input control, performing boundary recognition processing on the option selection area to obtain the boundary of the option selection area; Based on the interaction mode of the query input control, the option selection area is subjected to option extraction processing based on the boundary to obtain drop-down box options; Based on the interaction mode of the query input control, selecting the target option from the extracted drop-down box options; The query result is obtained based on the target option.
15. The device according to any one of claims 10 to 14, characterized in that When determining the first query condition based on the non-empty result list of the first page, the device further includes: A sending module is used to send a query trigger instruction to the query input control and / or the query trigger control in the first page to obtain the non-empty result list of the first page.
16. The device according to any one of claims 10 to 15, characterized in that In determining the first query condition based on the prompt information of the query input control in the first page or the non-empty result list of the first page, the determination module is specifically used to: Determining that prompt information of at least one of the query input controls matches at least one header of the non-empty result list; Establishing a corresponding relationship between each of the query input controls and the table header; Taking at least one of the query input controls as a target control; From the non-empty result list, at least one data item is determined from the data column in the table header corresponding to each of the target controls as the first query condition.
17. The device according to any one of claims 10 to 16, characterized in that In determining the test result of the first page based on the query result, the determination module is specifically used to: Acquire a search method for the first page, where the search method includes one or more of an exact search, a fuzzy search, or a range search; Based on the query result and the search method, a test result of the first page is determined.
18. The device according to any one of claims 10 to 17, characterized in that The determining module is specifically used to determine that the first page is a query page based on the first page including a control related to the query scenario: A first model is used to determine that the first page includes the control related to the query scenario, the first model is used to perform control recognition, and the first model is obtained by training based on control images.
19. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the page testing method according to any one of claims 1 to 9.
20. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the page testing method according to any one of claims 1 to 9.
21. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the page testing method according to any one of claims 1 to 9.