Page testing method and device, storage medium, and computer equipment
By separating the server from the client, the verification page configuration data and display data are configured to solve the problem that the page display errors are difficult to accurately locate in the existing technology, achieve fast and accurate testing, and improve the test efficiency.
Patent Information
- Application Number
- CN202111499736.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2041-12-09
AI Technical Summary
The existing page testing technology is difficult to quickly and accurately locate the problem of page display errors, resulting in inefficient testing.
By obtaining the page configuration data sent by the server, check the data according to the preset configuration data, and send the passing data to the client, so that the client display the target page, and then obtain the display data of the client. Check the data display data on the target page.
The separation test of clients and servers is achieved, quickly and accurately locate testing problems, improve test efficiency, and reduce the workload and test cost of testers.
Smart Images

Figure CN114138664B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a page testing method and device, a storage medium, and a computer device. Background Art
[0002] With the continuous development of Internet technology, the display pages provided by various software and websites are becoming more and more diverse. For testers, the workload of page testing is also increasing. The page display process is as follows: after the client sends a page display request to the server, the server first obtains the configuration data of the page from the configuration platform, and then sends the configuration data of the page to the client. The client renders the page and displays it according to the obtained configuration data.
[0003] In the current testing technology, an automated testing tool is installed on the client to drive the client to send a page display request to the server, and after the page is displayed according to the obtained configuration data, the displayed page is checked for consistency with the preset standard page to implement the testing of the displayed page. This testing method makes it difficult to accurately locate the problem of page display errors when the displayed page is verified to be inconsistent with the standard page, which is not conducive to the tester's troubleshooting and has low testing efficiency. Summary of the invention
[0004] In view of this, the present application provides a page testing method and apparatus, a storage medium, and a computer device, which help to quickly and accurately locate problems during page testing and improve testing efficiency.
[0005] According to one aspect of the present application, a page testing method is provided, comprising:
[0006] Obtaining page configuration data sent by the server, and verifying the page configuration data according to preset configuration data;
[0007] Sending the page configuration data to the client, so that the client displays the target page according to the page configuration data;
[0008] The target page display data of the client is obtained, and the target page display data is verified according to the preset page display data corresponding to the page configuration data.
[0009] Optionally, the preset configuration data includes all modules corresponding to the target page and a configuration template corresponding to each module; the page configuration data includes target configuration parameters corresponding to the target configuration module; and verifying the page configuration data according to the preset configuration data specifically includes:
[0010] Acquire, from the configuration platform corresponding to the target page, the current effective configuration corresponding to the target page, wherein the current effective configuration includes the current effective module corresponding to the target page;
[0011] Performing compliance verification on the target configuration parameters according to the configuration template corresponding to the currently effective module;
[0012] A target empty module is determined according to the full module and the currently effective module, and an empty check is performed on the target configuration parameters according to the target empty module.
[0013] Optionally, the configuration template includes the full-style configuration parameters corresponding to the current effective module, and when the target configuration parameters match any one of the full-style configuration parameters corresponding to the current effective module, the target configuration parameters pass the compliance check; or, the configuration template includes the configuration parameter format corresponding to the current effective module, and when the target configuration parameters match the configuration parameter format corresponding to the current effective module, the target configuration parameters pass the compliance check;
[0014] When the target configuration parameters do not include the configuration parameters of the target empty judgment module, the target configuration parameters pass the empty judgment check.
[0015] Optionally, sending the page configuration data to the client specifically includes:
[0016] According to at least one preset test pattern corresponding to the target page, target configuration parameters of the target configuration module in the page configuration data are respectively changed to obtain at least one set of changed page configuration data, so that each set of changed target configuration parameters matches the preset configuration parameters corresponding to each preset test pattern, wherein the preset test pattern includes the pattern of at least one target configuration module corresponding to the target page;
[0017] At least one set of the changed page configuration data is sent to the client, respectively, so that the client displays the target page according to the received changed page configuration data.
[0018] Optionally, the acquiring target page display data of the client and verifying the target page display data according to preset page display data corresponding to the page configuration data specifically includes:
[0019] Acquire at least one target page display image of the client and a preset page display image corresponding to the at least one preset test pattern, wherein the target page display data includes the target page display image, and the preset page display data includes the preset page display image;
[0020] Based on the preset page display image, a similarity check is performed on each of the target page display images.
[0021] Optionally, before respectively changing the target configuration parameters of the target configuration module in the page configuration data according to at least one preset test pattern corresponding to the target page, the method further includes:
[0022] Determine multiple pages to be tested, a full module corresponding to each page to be tested, and a style to be tested corresponding to each full module;
[0023] The at least one preset test pattern is determined according to the currently effective module corresponding to the target page and the to-be-tested patterns corresponding to the full modules.
[0024] Optionally, before obtaining the page configuration data sent by the server, the method further includes:
[0025] Obtaining the number of preset test patterns corresponding to each of a plurality of pages to be tested, wherein the pages to be tested include the target page;
[0026] An automated testing program is constructed based on the page to be tested and the preset number of test patterns, wherein the automated testing program runs in the client, and is used to trigger an action of generating a display instruction for any page to be tested, so that the client sends a display instruction for any page to be tested to the server, and the display instruction is used to trigger the server to send page configuration data corresponding to any page to be tested. The automated testing program is also used to record the number of times any page to be tested is displayed, and determine whether to trigger an action of generating a display instruction for the next page to be tested based on the number of displays and the preset number of test patterns.
[0027] According to another aspect of the present application, a page testing device is provided, comprising:
[0028] A first verification module, used to obtain page configuration data sent by the server, and verify the page configuration data according to preset configuration data;
[0029] A data sending module, used for sending the page configuration data to the client, so that the client displays the target page according to the page configuration data;
[0030] The second verification module is used to obtain the target page display data of the client, and verify the target page display data according to the preset page display data corresponding to the page configuration data.
[0031] Optionally, the preset configuration data includes all modules corresponding to the target page and a configuration template corresponding to each module; the page configuration data includes target configuration parameters corresponding to the target configuration module; the first verification module is specifically used to:
[0032] Acquire, from the configuration platform corresponding to the target page, the current effective configuration corresponding to the target page, wherein the current effective configuration includes the current effective module corresponding to the target page;
[0033] Performing compliance verification on the target configuration parameters according to the configuration template corresponding to the currently effective module;
[0034] A target empty module is determined according to the full module and the currently effective module, and an empty check is performed on the target configuration parameters according to the target empty module.
[0035] Optionally, the configuration template includes the full-style configuration parameters corresponding to the current effective module, and when the target configuration parameters match any one of the full-style configuration parameters corresponding to the current effective module, the target configuration parameters pass the compliance check; or, the configuration template includes the configuration parameter format corresponding to the current effective module, and when the target configuration parameters match the configuration parameter format corresponding to the current effective module, the target configuration parameters pass the compliance check;
[0036] When the target configuration parameters do not include the configuration parameters of the target empty judgment module, the target configuration parameters pass the empty judgment check.
[0037] Optionally, the data sending module is specifically used to:
[0038] According to at least one preset test pattern corresponding to the target page, target configuration parameters of the target configuration module in the page configuration data are respectively changed to obtain at least one set of changed page configuration data, so that each set of changed target configuration parameters matches the preset configuration parameters corresponding to each preset test pattern, wherein the preset test pattern includes the pattern of at least one target configuration module corresponding to the target page;
[0039] At least one set of the changed page configuration data is sent to the client, respectively, so that the client displays the target page according to the received changed page configuration data.
[0040] Optionally, the second verification module is specifically used to:
[0041] Acquire at least one target page display image of the client and a preset page display image corresponding to the at least one preset test pattern, wherein the target page display data includes the target page display image, and the preset page display data includes the preset page display image;
[0042] Based on the preset page display image, a similarity check is performed on each of the target page display images.
[0043] Optionally, the device further comprises:
[0044] A pre-configuration module is used to determine multiple pages to be tested, full modules corresponding to each page to be tested, and styles to be tested corresponding to each full module before changing the target configuration parameters of the target configuration module in the page configuration data respectively according to at least one preset test style corresponding to the target page; and determine the at least one preset test style according to the current effective module corresponding to the target page and the styles to be tested corresponding to the full modules.
[0045] Optionally, the device further comprises:
[0046] A tool construction module is used to obtain the number of preset test patterns corresponding to each of a plurality of pages to be tested before obtaining the page configuration data sent by the server, wherein the pages to be tested include the target page; and to construct an automated testing program based on the pages to be tested and the preset number of test patterns, wherein the automated testing program runs in the client, and the automated testing program is used to trigger the action of generating a display instruction for any page to be tested, so that the client sends a display instruction for any page to be tested to the server, and the display instruction is used to trigger the server to send the page configuration data corresponding to any page to be tested, and the automated testing program is also used to record the number of times any page to be tested is displayed, and determine whether to trigger the action of generating a display instruction for the next page to be tested based on the number of displays and the preset number of test patterns.
[0047] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned page testing method is implemented.
[0048] According to another aspect of the present application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned page testing method when executing the program.
[0049] By means of the above technical scheme, the present application provides a page testing method and device, storage medium, and computer equipment, wherein the testing system obtains the page configuration data of the target page sent by the server, and verifies the page configuration data to implement the testing of the server, and further, sends the page configuration data to the client, thereby obtaining the target page display data generated by the client according to the page configuration data, and verifies the target page display data to implement the testing of the client. Compared with the testing method of the prior art, the embodiment of the present application helps to quickly and accurately locate test problems, improve test efficiency, reduce the workload of testers, and reduce test costs by performing separate tests on the client and the server.
[0050] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0052] Figure 1 A schematic diagram of a process flow of a page testing method provided in an embodiment of the present application is shown;
[0053] Figure 2 A schematic diagram showing a flow chart of another page testing method provided in an embodiment of the present application is shown;
[0054] Figure 3 A schematic diagram showing a flow chart of another page testing method provided in an embodiment of the present application is shown;
[0055] Figure 4 A schematic structural diagram of a page testing device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0056] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0057] In this embodiment, a page testing method is provided, such as Figure 1 As shown, the method includes:
[0058] Step 101, obtaining page configuration data sent by the server, and verifying the page configuration data according to preset configuration data;
[0059] Step 102, sending the page configuration data to the client, so that the client displays the target page according to the page configuration data;
[0060] Step 103: acquiring target page display data of the client, and verifying the target page display data according to preset page display data corresponding to the page configuration data.
[0061] The embodiment of the present application can be applied to a test system, and the test system can be set in a physical device independent of the client and the server, or in a physical device corresponding to the client or the server, which is not limited here. The embodiment of the present application is described by taking the physical device where the test system is located as an example, which is independent of the client and the server. During the test process, the client sends a display instruction for the target page to the server to request to obtain the page configuration data of the target page. When the server sends the page configuration data to the client, the test system can intercept the page configuration data, thereby verifying the intercepted page configuration data, and forwarding it to the client when the verification passes, or the server can send the page configuration data to the client and the test system at the same time, and the test system verifies the received page configuration data. In a specific application scenario, the test system can verify the page configuration data according to the pre-recorded preset configuration data, and specifically can verify the data format, configuration parameters and other contents of the page configuration data to implement the test of the server.
[0062] Furthermore, the test system can send the intercepted page configuration data to the client. After the client obtains the page configuration data, it can render and display the target page locally. Then the test system obtains the target page display data of the client and verifies the target page display data, wherein the target page display data can be a target page display image, such as a screenshot of the display screen of the target page, and the target page display data can also be the display element information corresponding to each position in the target page. After the test system obtains the target page display data, it can verify the actual target page display data of the client according to the preset page display data corresponding to the pre-recorded page configuration data. Here, the target page display data is consistent with the type of the preset page display data. For example, if the preset page display data is an image, the target page display data is also an image. The test system implements the test of the client by verifying the target page display data. The front and back ends (client and server) are tested separately. When a problem is found, it can be clearly determined whether it is a problem on the server or the front end without manual judgment.
[0063] By applying the technical solution of this embodiment, the test system obtains the page configuration data of the target page sent by the server, and verifies the page configuration data to implement the test of the server. Further, the page configuration data is sent to the client, thereby obtaining the target page display data generated by the client according to the page configuration data, and the target page display data is verified to implement the test of the client. Compared with the test method of the prior art, the embodiment of the present application helps to quickly and accurately locate test problems, improve test efficiency, reduce the workload of testers, and reduce test costs by separating the client and the server.
[0064] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another page testing method is provided, such as Figure 2 As shown, the method includes:
[0065] Step 201, obtaining page configuration data sent by the server, and obtaining the current effective configuration corresponding to the target page from the configuration platform corresponding to the target page, wherein the current effective configuration includes the current effective module corresponding to the target page;
[0066] In actual application scenarios, more and more pages are no longer satisfied with a single style and layout, but have adopted configuration-type pages, that is, the client style is modularized and templated, and the fields that need to be changed by configuration are extracted and placed on the configuration platform. After the client requests data from the server, the server first queries the configuration platform, obtains the configuration data that is effective in the current time, and sends it to the client. The client renders the page according to the obtained configuration. The configuration can be changed at any time, and the page style and layout will change with the change of configuration.
[0067] In this step 201, for configuration pages (or other types of pages that need to obtain page configuration data from a third-party platform), since the configuration of the target page can be changed in real time by the configuration platform, the server obtains the page configuration data of the target page from the configuration platform corresponding to the target page after receiving the display instruction. The test system intercepts the page configuration data sent by the server, and at the same time, obtains the current effective configuration of the page from the configuration platform corresponding to the target page, where the current effective configuration may include the current effective module. By querying the effective configuration of the current configuration platform, the data verification basis within the current time is obtained, so that the verification rules can also be changed with the change of configuration, reducing the misjudgment caused by fixed judgment.
[0068] Step 202: perform compliance check on the target configuration parameters according to the configuration template corresponding to the currently effective module; determine the target empty module according to the full module and the currently effective module, and perform empty check on the target configuration parameters according to the target empty module;
[0069] Optionally, the preset configuration data includes the full modules corresponding to the target page and the configuration template corresponding to each module; the page configuration data includes the target configuration parameters corresponding to the target configuration module; the configuration template includes the full style configuration parameters corresponding to the current effective module, and when the target configuration parameters match any one of the full style configuration parameters corresponding to the current effective module, the target configuration parameters pass the compliance check; or, the configuration template includes the configuration parameter format corresponding to the current effective module, and when the target configuration parameters match the configuration parameter format corresponding to the current effective module, the target configuration parameters pass the compliance check; when the target configuration parameters do not include the configuration parameters of the target empty judgment module, the target configuration parameters pass the empty judgment check.
[0070] In step 202, the test system implements testing on the server based on the page configuration data obtained from the server and the current effective configuration obtained from the configuration platform. Figure 3 A flow chart of a server-side testing method provided by an embodiment of the present application is shown. The test system can include the full module corresponding to the target page and the configuration template corresponding to each module according to the pre-stored preset configuration data. The full module specifically refers to the sum of all modules that can be displayed on the target page under different circumstances. Each module can correspond to a variety of display styles. The configuration template corresponding to each module can include the configuration parameter format corresponding to the module (for example, the field length of the parameter, the field type, etc.), and can also include the full style configuration parameters corresponding to the module (for example, the configuration parameters corresponding to each style). In the specific verification process, the test system can verify whether the page configuration data contains the parameters corresponding to the current effective module, and whether the target configuration parameters corresponding to the current effective module are consistent with the corresponding configuration template, such as whether the format is consistent, or whether the target configuration parameters are in the corresponding full style configuration parameters. If the parameters of the current effective module are included, and the parameters therein are consistent with the configuration template, it is considered to pass the compliance verification. In addition, the test system can also determine the target empty judgment module based on the full module and the currently effective module. For example, the full module includes modules A, B, and C, and the currently effective modules are modules A and B, then the target empty judgment module is module C. Further, check whether the target configuration parameters in the page configuration data include the parameters corresponding to the target empty judgment module. For example, if the target configuration parameters do not include the parameters corresponding to module C, it is considered that the empty judgment check has passed.
[0071] Step 203, according to at least one preset test pattern corresponding to the target page, respectively change the target configuration parameters of the target configuration module in the page configuration data to obtain at least one set of changed page configuration data, so that each set of changed target configuration parameters respectively matches the preset configuration parameters corresponding to each preset test pattern, wherein the preset test pattern includes the pattern of at least one target configuration module corresponding to the target page;
[0072] In step 203, the page configuration data obtained from the server is a configuration parameter corresponding to the display style of a target page. In order to implement the test of more page display styles, the test system can also change the target configuration parameters in the page configuration data according to at least one preset test style corresponding to the predetermined target page to obtain the changed page configuration data. One preset test style can obtain a set of changed page configuration data. Among them, the target configuration parameters in the page configuration data match the preset test style, and the preset test style includes the style of each target configuration module in the target page. For example, the target configuration module corresponding to the target page includes module A, and module A has 2 display styles, namely style 1 and style 2. Then, the parameters in the page configuration data can be modified and replaced according to the configuration parameters of module A corresponding to style 1 and style 2. Through module data management and replacement, the parameters in the target configuration module fed back by the server can be selectively replaced in the automated test, so as to test the ability of the front end to display multiple styles.
[0073] In an embodiment of the present application, optionally, before step 203, it may also include: determining multiple pages to be tested, a full module corresponding to each page to be tested, and a style to be tested corresponding to each full module; determining at least one preset test style based on the current effective module corresponding to the target page and the style to be tested corresponding to each full module.
[0074] In this embodiment, before the test is performed, the test system can manage different pages to be tested in advance, specifically, determine the pages to be tested (including the target page), the full modules corresponding to each page to be tested, the styles to be tested corresponding to each full module, and the configuration parameters corresponding to each style. Therefore, after the test system obtains the current effective module corresponding to the target page, it can query the styles to be tested corresponding to the target page and the current effective module in the pre-stored data, and combine the styles to be tested corresponding to different current effective modules to obtain at least one preset test style. For example, the current effective modules include modules A and B, module A corresponds to style 1 and style 2, and module B corresponds to style 3, then it can be determined that the first preset test style is module A style 1 and module B style 3, and the second preset test style is module A style 2 and module B style 3.
[0075] Step 204, sending at least one set of the changed page configuration data to the client, so that the client displays the target page according to the received changed page configuration data;
[0076] Step 205: Obtain at least one target page display image of the client and a preset page display image corresponding to the at least one preset test pattern, wherein the target page display data includes the target page display image, and the preset page display data includes the preset page display image; based on the preset page display image, perform a similarity check on each of the target page display images.
[0077] In step 204 and step 205, after the test system changes the page configuration data, it sends the changed page configuration data to the client, so that the client renders and displays the target page according to the data. Then, the test system obtains the target page display image corresponding to each set of changed page configuration data in the client. The acquisition can be done in batches, or the client can save the data uniformly and the test system can obtain the data at one time. After the test system obtains the target page display image, it uses the pre-stored preset page display images corresponding to each preset test style to perform client verification. If the target page display image is consistent with the preset page display image, or the similarity is higher than a preset threshold, such as higher than 95%, it can be considered that the similarity verification has passed. This allows for separate testing of the client.
[0078] In addition, in order to reduce the testing workload of testers, the embodiment of the present application further provides an automated testing tool, including an automated testing program. Optionally, before step 201, the following may also be included:
[0079] S1, obtaining the number of preset test patterns corresponding to each of a plurality of pages to be tested, wherein the pages to be tested include the target page;
[0080] S2, constructing an automated testing program based on the page to be tested and the preset number of test patterns, wherein the automated testing program runs in the client, and is used to trigger an action of generating a display instruction for any page to be tested, so that the client sends a display instruction for any page to be tested to the server, and the display instruction is used to trigger the server to send page configuration data corresponding to any page to be tested, and the automated testing program is also used to record the number of times any page to be tested is displayed, and determine whether to trigger an action of generating a display instruction for the next page to be tested based on the number of displays and the preset number of test patterns.
[0081] In the above embodiment, the number of preset test patterns corresponding to each page to be tested is obtained, and an automated test program is constructed based on each page to be tested and its corresponding number of preset test patterns. The automated test program runs in the client. When the program runs on the client, it can simulate the triggering operation of the display instruction of any page to be tested. For example, by clicking a button on the screen, the display instruction of the page can be generated, and then the program can drive the UI to automatically generate a click action on the button. The display instruction is used to trigger the server to feedback the page configuration data of the corresponding page to be tested. In addition, since the test system can change the page configuration data fed back by the server and obtain multiple groups of changed page configuration data, in order to improve the ability of the automated test program and further reduce the workload of the tester, when the program runs on the client, it can also record the number of displays of the requested page to be tested. When the number of displays reaches the number of preset test patterns corresponding to the page to be tested, the test operation of the next page to be tested is executed, that is, the triggering operation of the display instruction of the next page to be tested is simulated. In this way, the automated test of each page to be tested is realized. Combining front-end multi-style data replacement with UI automation can complete the regression of all related module styles at one time during an automated page test execution, thereby improving test efficiency.
[0082] It should be noted that each page to be tested can correspond to multiple effective module combinations (that is, the current effective module corresponding to each page to be tested is one of the multiple effective module combinations), and each effective module combination corresponds to at least one preset test pattern. The number of preset test patterns corresponding to each page to be tested specifically includes the number of preset test patterns corresponding to the effective module combination contained in each page to be tested.
[0083] Further, as Figure 1 The specific implementation of the method, the embodiment of the present application provides a page testing device, such as Figure 4 As shown, the device comprises:
[0084] A first verification module, used to obtain page configuration data sent by the server, and verify the page configuration data according to preset configuration data;
[0085] A data sending module, used for sending the page configuration data to the client, so that the client displays the target page according to the page configuration data;
[0086] The second verification module is used to obtain the target page display data of the client, and verify the target page display data according to the preset page display data corresponding to the page configuration data.
[0087] Optionally, the preset configuration data includes all modules corresponding to the target page and a configuration template corresponding to each module; the page configuration data includes target configuration parameters corresponding to the target configuration module; the first verification module is specifically used to:
[0088] Acquire, from the configuration platform corresponding to the target page, the current effective configuration corresponding to the target page, wherein the current effective configuration includes the current effective module corresponding to the target page;
[0089] Performing compliance verification on the target configuration parameters according to the configuration template corresponding to the currently effective module;
[0090] A target empty module is determined according to the full module and the currently effective module, and an empty check is performed on the target configuration parameters according to the target empty module.
[0091] Optionally, the configuration template includes the full-style configuration parameters corresponding to the current effective module, and when the target configuration parameters match any one of the full-style configuration parameters corresponding to the current effective module, the target configuration parameters pass the compliance check; or, the configuration template includes the configuration parameter format corresponding to the current effective module, and when the target configuration parameters match the configuration parameter format corresponding to the current effective module, the target configuration parameters pass the compliance check;
[0092] When the target configuration parameters do not include the configuration parameters of the target empty judgment module, the target configuration parameters pass the empty judgment check.
[0093] Optionally, the data sending module is specifically used to:
[0094] According to at least one preset test pattern corresponding to the target page, target configuration parameters of the target configuration module in the page configuration data are respectively changed to obtain at least one set of changed page configuration data, so that each set of changed target configuration parameters matches the preset configuration parameters corresponding to each preset test pattern, wherein the preset test pattern includes the pattern of at least one target configuration module corresponding to the target page;
[0095] At least one set of the changed page configuration data is sent to the client, respectively, so that the client displays the target page according to the received changed page configuration data.
[0096] Optionally, the second verification module is specifically used to:
[0097] Acquire at least one target page display image of the client and a preset page display image corresponding to the at least one preset test pattern, wherein the target page display data includes the target page display image, and the preset page display data includes the preset page display image;
[0098] Based on the preset page display image, a similarity check is performed on each of the target page display images.
[0099] Optionally, the device further comprises:
[0100] A pre-configuration module is used to determine multiple pages to be tested, full modules corresponding to each page to be tested, and styles to be tested corresponding to each full module before changing the target configuration parameters of the target configuration module in the page configuration data respectively according to at least one preset test style corresponding to the target page; and determine the at least one preset test style according to the current effective module corresponding to the target page and the styles to be tested corresponding to the full modules.
[0101] Optionally, the device further comprises:
[0102] A tool construction module is used to obtain the number of preset test patterns corresponding to each of a plurality of pages to be tested before obtaining the page configuration data sent by the server, wherein the pages to be tested include the target page; and to construct an automated testing program based on the pages to be tested and the preset number of test patterns, wherein the automated testing program runs in the client, and the automated testing program is used to trigger the action of generating a display instruction for any page to be tested, so that the client sends a display instruction for any page to be tested to the server, and the display instruction is used to trigger the server to send the page configuration data corresponding to any page to be tested, and the automated testing program is also used to record the number of times any page to be tested is displayed, and determine whether to trigger the action of generating a display instruction for the next page to be tested based on the number of displays and the preset number of test patterns.
[0103] It should be noted that for other corresponding descriptions of the functional units involved in the page testing device provided in the embodiment of the present application, reference can be made to Figure 1 to Figure 2 The corresponding description in the method will not be repeated here.
[0104] Based on the above Figure 1 to Figure 2 The method shown in the embodiment of the present application accordingly provides a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned Figure 1 to Figure 2 Page test method shown.
[0105] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.
[0106] Based on the above Figure 1 to Figure 2 The method shown, and Figure 4 In order to achieve the above-mentioned purpose, the embodiment of the present application further provides a computer device, which can be a personal computer, a server, a network device, etc. The computer device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 to Figure 2 Page test method shown.
[0107] Optionally, the computer device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a Bluetooth interface, a WI-FI interface), etc.
[0108] Those skilled in the art will appreciate that the computer device structure provided in this embodiment does not limit the computer device, and may include more or fewer components, or a combination of certain components, or different component arrangements.
[0109] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages and saves the hardware and software resources of the computer device, and supports the operation of information processing programs and other software and / or programs. The network communication module is used to realize communication between the components inside the storage medium, and communication with other hardware and software in the physical device.
[0110] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, or by hardware to implement a test system to obtain the page configuration data of the target page sent by the server, and to verify the page configuration data, to implement the test of the server, and further, to send the page configuration data to the client, thereby obtaining the target page display data generated by the client according to the page configuration data, and to verify the target page display data, to implement the test of the client. Compared with the test method of the prior art, the embodiment of the present application helps to quickly and accurately locate test problems, improve test efficiency, reduce the workload of testers, and reduce test costs by performing separate tests on the client and the server.
[0111] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.
[0112] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.
Claims
1. A page testing method, characterized in that: include: Acquire page configuration data sent by the server, wherein the page configuration data includes target configuration parameters of the target configuration module; Verifying the page configuration data according to preset configuration data, wherein the preset configuration data includes a configuration template of a full module corresponding to a target page; wherein, obtaining a current effective configuration of the target page, determining that the target configuration parameters pass the compliance check when the configuration template corresponding to the current effective module in the current effective configuration matches the target configuration parameters, and determining a target empty judgment module according to the full module and the current effective module, and determining that the target configuration parameters pass the empty judgment check when the target configuration parameters do not include configuration parameters of the target empty judgment module; Sending the page configuration data to the client, so that the client displays the target page according to the page configuration data; The target page display data of the client is obtained, and the target page display data is verified according to the preset page display data corresponding to the page configuration data.
2. The method according to claim 1, characterized in that The step of obtaining the currently effective configuration of the target page includes: The currently effective configuration corresponding to the target page is obtained from the configuration platform corresponding to the target page, wherein the currently effective configuration includes the currently effective module corresponding to the target page.
3. The method according to claim 2, characterized in that The configuration template includes the full-style configuration parameters corresponding to the current effective module. When the target configuration parameters match any one of the full-style configuration parameters corresponding to the current effective module, the target configuration parameters pass the compliance check; or, the configuration template includes the configuration parameter format corresponding to the current effective module. When the target configuration parameters match the configuration parameter format corresponding to the current effective module, the target configuration parameters pass the compliance check.
4. The method according to claim 1, characterized in that: The sending of the page configuration data to the client specifically includes: According to at least one preset test pattern corresponding to the target page, target configuration parameters of the target configuration module in the page configuration data are respectively changed to obtain at least one set of changed page configuration data, so that each set of changed target configuration parameters matches the preset configuration parameters corresponding to each preset test pattern, wherein the preset test pattern includes the pattern of at least one target configuration module corresponding to the target page; At least one set of the changed page configuration data is sent to the client, respectively, so that the client displays the target page according to the received changed page configuration data.
5. The method according to claim 4, characterized in that The acquiring the target page display data of the client, and verifying the target page display data according to the preset page display data corresponding to the page configuration data, specifically includes: Acquire at least one target page display image of the client and a preset page display image corresponding to the at least one preset test pattern, wherein the target page display data includes the target page display image, and the preset page display data includes the preset page display image; Based on the preset page display image, a similarity check is performed on each of the target page display images.
6. The method according to claim 4, characterized in that Before respectively changing the target configuration parameters of the target configuration module in the page configuration data according to at least one preset test pattern corresponding to the target page, the method further includes: Determine multiple pages to be tested, a full module corresponding to each page to be tested, and a style to be tested corresponding to each full module; The at least one preset test pattern is determined according to the currently effective module corresponding to the target page and the to-be-tested patterns corresponding to the full modules.
7. The method according to any one of claims 4 to 6, characterized in that Before obtaining the page configuration data sent by the server, the method further includes: Obtaining the number of preset test patterns corresponding to each of a plurality of pages to be tested, wherein the pages to be tested include the target page; An automated testing program is constructed based on the page to be tested and the preset number of test patterns, wherein the automated testing program runs in the client, and is used to trigger an action of generating a display instruction for any page to be tested, so that the client sends a display instruction for any page to be tested to the server, and the display instruction is used to trigger the server to send page configuration data corresponding to any page to be tested. The automated testing program is also used to record the number of times any page to be tested is displayed, and determine whether to trigger an action of generating a display instruction for the next page to be tested based on the number of displays and the preset number of test patterns.
8. A page testing device, characterized in that: include: A first verification module, used to obtain page configuration data sent by the server, wherein the page configuration data includes target configuration parameters of a target configuration module; Verifying the page configuration data according to preset configuration data, wherein the preset configuration data includes a configuration template of a full module corresponding to a target page; wherein, obtaining a current effective configuration of the target page, determining that the target configuration parameters pass the compliance check when the configuration template corresponding to the current effective module in the current effective configuration matches the target configuration parameters, and determining a target empty judgment module according to the full module and the current effective module, and determining that the target configuration parameters pass the empty judgment check when the target configuration parameters do not include configuration parameters of the target empty judgment module; A data sending module, used for sending the page configuration data to the client, so that the client displays the target page according to the page configuration data; The second verification module is used to obtain the target page display data of the client, and verify the target page display data according to the preset page display data corresponding to the page configuration data.
9. The device according to claim 8, characterized in that The first verification module is specifically used for: The currently effective configuration corresponding to the target page is obtained from the configuration platform corresponding to the target page, wherein the currently effective configuration includes the currently effective module corresponding to the target page.
10. The device according to claim 9, characterized in that The configuration template includes the full-style configuration parameters corresponding to the current effective module. When the target configuration parameters match any one of the full-style configuration parameters corresponding to the current effective module, the target configuration parameters pass the compliance check; or, the configuration template includes the configuration parameter format corresponding to the current effective module. When the target configuration parameters match the configuration parameter format corresponding to the current effective module, the target configuration parameters pass the compliance check.
11. The device according to claim 8, characterized in that The data sending module is specifically used for: According to at least one preset test pattern corresponding to the target page, target configuration parameters of the target configuration module in the page configuration data are respectively changed to obtain at least one set of changed page configuration data, so that each set of changed target configuration parameters matches the preset configuration parameters corresponding to each preset test pattern, wherein the preset test pattern includes the pattern of at least one target configuration module corresponding to the target page; At least one set of the changed page configuration data is sent to the client, respectively, so that the client displays the target page according to the received changed page configuration data.
12. The device according to claim 10, characterized in that The second verification module is specifically used for: Acquire at least one target page display image of the client and a preset page display image corresponding to the at least one preset test pattern, wherein the target page display data includes the target page display image, and the preset page display data includes the preset page display image; Based on the preset page display image, a similarity check is performed on each of the target page display images.
13. The device according to claim 10, characterized in that The device also includes: A pre-configuration module is used to determine multiple pages to be tested, full modules corresponding to each page to be tested, and styles to be tested corresponding to each full module before changing the target configuration parameters of the target configuration module in the page configuration data according to at least one preset test style corresponding to the target page; and determine the at least one preset test style according to the current effective module corresponding to the target page and the styles to be tested corresponding to the full modules.
14. The device according to any one of claims 10 to 13, characterized in that The device also includes: A tool construction module is used to obtain the number of preset test patterns corresponding to each of a plurality of pages to be tested before obtaining the page configuration data sent by the server, wherein the pages to be tested include the target page; and to construct an automated testing program based on the pages to be tested and the preset number of test patterns, wherein the automated testing program runs in the client, and the automated testing program is used to trigger the action of generating a display instruction for any page to be tested, so that the client sends a display instruction for any page to be tested to the server, and the display instruction is used to trigger the server to send the page configuration data corresponding to any page to be tested, and the automated testing program is also used to record the number of times any page to be tested is displayed, and determine whether to trigger the action of generating a display instruction for the next page to be tested based on the number of displays and the preset number of test patterns.
15. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
16. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Automatic testing method and device for user interface
CN113704110A