Evaluation method, device, equipment and readable storage medium for testing network pages
By traversing and testing the subpages of the network page, obtaining and recording their attribute information and coordinates of the elements being operated, the problem of inaccurate evaluation of page coverage in the prior art is solved, and automatic and accurate page coverage calculation and visualization are realized.
Patent Information
- Application Number
- CN202210213494.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-04
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2042-03-04
AI Technical Summary
Existing automated testing technologies are difficult to accurately evaluate the coverage of network pages, and rely on manual naming and the inability to verify the correctness of statistical results.
By traversing all subpages of the user interface to be tested, the attribute information of each subpage, including title, distinction items and screenshots, and testing them based on the distinction items, recording the coordinate position and distinction items of the elements to be operated, determining and supplementing the missing parts in the page list, and calculating the page coverage.
It realizes automatic calculation of page coverage, statistics of high-frequency test pages and visualization of results, so as to automatically, quantifiable and accurate page coverage, reduce labor costs, and improve work efficiency.
Smart Images

Figure CN114610609B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and in particular to an evaluation method, device, equipment and readable storage medium for testing a web page. Background Art
[0002] At present, automated testing technology is widely used in various web testing fields because of its advantages such as saving manpower, time or hardware resource costs and improving testing efficiency. Automated testing technology refers to a process of converting human-driven test behaviors into machine execution. With the increasing application of automated testing technology and the increasing number of automated test cases, in order to evaluate a large number of automated cases and the effectiveness of their operation, it is urgent to analyze whether the test fully covers the existing pages and how to count the high-frequency test pages of existing automated cases. Existing automated cases often record the case name or folder name of the automated case and combine it with the number of runs to obtain the page coverage of the system to be tested by the existing automated cases. However, counting the coverage of the page by the automated case only by the case name or folder name not only depends on the accuracy of manual naming, but also cannot verify the correctness of the statistical results. Summary of the invention
[0003] The purpose of the present invention is to provide a method, device, equipment and readable storage medium for testing web page evaluation to improve the above problems. In order to achieve the above purpose, the technical solution adopted by the present invention is as follows:
[0004] In a first aspect, the present application provides a method for evaluating a test web page, comprising:
[0005] Traverse all sub-pages of the user interface to be tested;
[0006] Respectively obtain the attribute information of all the sub-pages in the traversal process, and save the obtained attribute information to the list of the user interface to be tested, wherein the attribute information includes the title, the first distinguishing item and the screenshot of each sub-page, and the first distinguishing item is the distinguishing point set information of the attributes of two sub-pages;
[0007] Performing a test according to the first distinguishing item, recording the coordinate position of the operated element in each of the sub-pages and the second distinguishing item, wherein the second distinguishing item is distinguishing point set information of the attributes of the two sub-pages after the test;
[0008] Determine whether the second distinguishing item is in the list of the user interface to be tested. If so, record the coordinate position of the operated element and the page screenshot in the list; if not, supplement the missing part of the page in the list.
[0009] Preferably, the test is performed according to the first distinguishing item, and before that, the method further includes:
[0010] Obtaining a page list of the user interface to be tested;
[0011] Add a count item N to the page list, and set the initial value of the count item N to zero;
[0012] The test is performed according to the operated element in the page list.
[0013] Preferably, recording the coordinate position of the operated element and the page screenshot in the list includes:
[0014] Obtain the horizontal and vertical pixel positions of the operation point of the operated element in the browser, the horizontal and vertical pixel sizes of the entire page, and the horizontal and vertical pixel sizes of the page screenshot in the page list;
[0015] The horizontal and vertical pixel values of the mark point position are calculated according to the horizontal and vertical pixel positions of the operation point of the operated element, the horizontal and vertical pixel sizes of the entire page, and the horizontal and vertical pixel sizes of the page screenshot in the page list.
[0016] Preferably, recording the coordinate position of the operated element in each of the sub-pages and the second difference item includes:
[0017] Obtaining a link to the operated element in the subpage;
[0018] Get the title content in the subpage;
[0019] Obtaining the name of the navigation bar submenu of the most recent navigation bar operation in the subpage, and using the navigation bar submenu name as the second distinguishing item of the operation;
[0020] The links of all operated elements in the subpage, the title content in the subpage and the second distinguishing item are recorded.
[0021] Preferably, supplementing the missing parts of the pages in the list further comprises:
[0022] Filtering the sub-pages in the page list, the pages whose operation times are greater than a preset threshold, to obtain a first page;
[0023] Filtering the sub-pages in the page list, the pages whose operation times are less than a preset threshold and not zero, to obtain a second page;
[0024] Filtering the pages in the page list whose operation times are zero to obtain the third page;
[0025] The page coverage of the test is calculated based on the first page, the second page and the third page.
[0026] Preferably, supplementing the missing parts of the pages in the list further comprises:
[0027] The page coverage of the test is calculated based on the number of times all the sub-pages are operated and the total number of times all the pages in the list are operated.
[0028] In a second aspect, the present application also provides a device for testing network page evaluation, including an access module, an acquisition module, a test module and a judgment module, wherein:
[0029] Access module: used to traverse all sub-pages of the user interface to be tested;
[0030] Acquisition module: used to respectively acquire the attribute information of all the sub-pages in the traversal process, and save the acquired attribute information into the list of the user interface to be tested, wherein the attribute information includes the title, the first distinguishing item and the screenshot of each sub-page, wherein the first distinguishing item is the distinguishing point set information of the attributes of two sub-pages;
[0031] Testing module: used for testing according to the first distinguishing item, recording the coordinate position of the operated element in each sub-page and the second distinguishing item, wherein the second distinguishing item is the distinguishing point set information of the attributes of the two sub-pages after the test;
[0032] The judgment module is used to judge whether the second distinguishing item is in the list of the user interface to be tested. If so, the coordinate position of the operated element and the page screenshot in the list are recorded; if not, the missing part of the page in the list is supplemented.
[0033] Preferably, the test module further includes a first acquisition unit, an adding unit and a test unit, wherein:
[0034] A first acquisition unit: used to acquire a page list of the user interface to be tested;
[0035] Adding unit: used for adding a count item N in the page list, and setting the initial value of the count item N to zero;
[0036] Testing unit: used for testing according to the operated elements in the page list.
[0037] Preferably, the judgment module includes a second acquisition unit and a first calculation unit, wherein:
[0038] The second acquisition unit is used to acquire the horizontal and vertical pixel positions of the operation point of the operated element in the browser, the horizontal and vertical pixel sizes of the entire page, and the horizontal and vertical pixel sizes of the page screenshot in the page list;
[0039] A first calculation unit: used for calculating the horizontal pixel value of the mark point position according to the horizontal and vertical pixel positions of the operation point of the operated element, the horizontal and vertical pixel sizes of the entire page, and the horizontal and vertical pixel sizes of the page screenshot in the page list;
[0040] Preferably, the test module includes a third acquisition unit, a fourth acquisition unit, a fifth acquisition unit and a recording unit, wherein:
[0041] A third acquisition unit: used for acquiring a link of the operated element in the subpage;
[0042] The fourth acquisition unit is used to acquire the title content in the subpage;
[0043] A fifth obtaining unit: used for obtaining a name of a navigation bar submenu of a most recent navigation bar operation in the subpage, and using the name of the navigation bar submenu as the second distinguishing item;
[0044] Recording unit: used for recording the links of all operated elements in the sub-page, the title content in the sub-page and the second distinguishing item.
[0045] Preferably, the judgment module further comprises a first screening unit, a second screening unit, a third screening unit and a third calculation unit, wherein:
[0046] A first screening unit: used for screening the pages in the page list whose number of operations is greater than a preset threshold, to obtain a first page;
[0047] A second screening unit: used for screening the pages whose number of operations in the sub-pages in the page list is less than a preset threshold and not zero, to obtain a second page;
[0048] A third screening unit: used for screening pages in the page list whose operation times are zero to obtain a third page;
[0049] A third calculation unit is configured to calculate the page coverage of the test according to the first page, the second page and the third page.
[0050] Preferably, the judging module further includes a fourth calculating unit:
[0051] The fourth calculation unit is used to calculate the page coverage of the test according to the number of times all the sub-pages are operated and the total number of times all the pages in the list are operated.
[0052] In a third aspect, the present application also provides a device for testing web page evaluation, including:
[0053] Memory for storing computer programs;
[0054] A processor is configured to implement the steps of the test web page evaluation method when executing the computer program.
[0055] In a fourth aspect, the present application further provides a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned test network page evaluation method are implemented.
[0056] The beneficial effects of the present invention are as follows: the present invention provides a test network page evaluation method, which can automatically calculate the page coverage, count the high-frequency test pages, and visualize the page coverage results after the test is completed, so as to automatically, quantifiably and accurately count the page coverage. On the basis of effectively and accurately evaluating the automated coverage, it can greatly reduce labor costs and improve work efficiency.
[0057] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or be understood by implementing the embodiments of the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0059] Figure 1 It is a schematic diagram of the flow of the test network page evaluation method described in an embodiment of the present invention;
[0060] Figure 2 It is a schematic diagram of the structure of the test network page evaluation device described in an embodiment of the present invention;
[0061] Figure 3 It is a schematic diagram of the structure of the test network page evaluation device described in an embodiment of the present invention.
[0062] In the figure: 701, access module; 702, acquisition module; 7021, first acquisition unit; 7022, adding unit; 7023, test unit; 703, test module; 7031, third acquisition unit; 7032, fourth acquisition unit; 7033, fifth acquisition unit; 7034, recording unit; 704, judgment module; 7041, second acquisition unit; 7042, first calculation unit; 705, first screening unit; 706, second screening unit; 707, third screening unit; 708, third calculation unit; 709, fourth calculation unit; 800, device for testing network pages; 801, processor; 802, memory; 803, multimedia component; 804, input / output (I / O) interface; 805, communication component. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0064] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0065] Embodiment 1:
[0066] This embodiment provides a method for testing web page evaluation.
[0067] See also Figure 1 , the figure shows that the method includes step S100, step S200, step S300 and step S400.
[0068] S100: Traverse all sub-pages of the user interface to be tested.
[0069] It can be understood that in this step, first, exploratory testing is performed: the URL of the web page to be tested and the login account are input, and all sub-pages of the web page to be tested are opened with a browser through manual operation or tool traversal.
[0070] S200. Obtain attribute information of all sub-pages during the traversal process respectively, and save the obtained attribute information into the list of the user interface to be tested. The attribute information includes the title, the first distinguishing item and the screenshot of each sub-page. The first distinguishing item is the distinguishing point set information of the attributes of the two sub-pages.
[0071] It is understandable that in this step, each time a subpage is entered, a person or tool needs to record the page title and page distinguishing items of the subpage, and save a screenshot of the page displayed in the browser. The page distinguishing items are used to distinguish different subpages. Specifically, the most suitable form can be selected according to the characteristics of the web page to be tested, which can be in the form of links, titles, and navigation bar submenu names. The page title generally comes from an artificial name, or a navigation bar menu name. After the current subpage is recorded, the current subpage can be closed, the next subpage is entered, and the page title and page distinguishing items of the next subpage are repeatedly recorded, and a screenshot of the page displayed in the browser is saved; when all subpages of the web page to be tested are recorded, the exploratory test outputs the page list of the web page to be tested, which includes the page titles, page distinguishing items, and screenshot addresses of all subpages, generally in the form of a table.
[0072] It should be noted that before conducting automated testing, you also need to:
[0073] Get the page list of the user interface to be tested;
[0074] Add a count item N to the page list, and set the initial value of the count item N to zero to record the number of times each sub-page is operated;
[0075] Tests are performed based on the elements being manipulated in the page manifest.
[0076] S300 , testing is performed according to the first distinguishing item, and the coordinate position of the operated element in each sub-page and the second distinguishing item are recorded. The second distinguishing item is distinguishing point set information of the attributes of the two sub-pages after the test.
[0077] It can be understood that in this step, the link of the operated element in the subpage is obtained;
[0078] Get the title content in the subpage;
[0079] Get the name of the navigation bar submenu of the most recent navigation bar operation in the subpage, and use the navigation bar submenu name as the second distinguishing item of this operation;
[0080] Record the links of all operated elements in the subpage, the title content in the subpage and the second difference item.
[0081] Specifically, for systems where the page URL changes as the page switches, the URL can be used to distinguish different pages, such as "20.8.67.87:8080 / testResult / config" is different from "20.8.67.87:8080 / testResult / selectPic", which can distinguish different pages. By extending the application, the regular expression and URL link can also be combined to be used when there are variables in the URL link of the same page.
[0082] For systems where page URLs cannot be distinguished, but the title naming in the page HTML is relatively standardized and different pages have different titles, you can obtain the title content in the page HTML as a page distinguishing item to distinguish different pages;
[0083] For systems where the page URL remains unchanged and the title in the page HTML cannot be distinguished, you can use the submenu name of the system navigation bar as a page distinguishing item to distinguish different pages, such as "Home", "Account Information", "Application Results", etc.
[0084] The page title is generally artificially named or the name of the navigation bar menu, such as "Personal Information Maintenance", "Card Opening Result Query", etc.
[0085] After the current sub-page is recorded, you can close the current sub-page, enter the next sub-page and repeat recording the page title and page difference items of the next sub-page, and save the screenshot of the page displayed in the browser;
[0086] When all sub-pages of the web system under test are recorded, the exploratory test outputs a page list of the web system under test, which includes the page titles, page distinguishing items and screenshot addresses of all sub-pages, usually in a table format;
[0087] S400, determining whether the second distinguishing item is in the list of the user interface to be tested, if so, recording the coordinate position of the operated element and the page screenshot in the list; if not, supplementing the missing part of the page in the list.
[0088] It is understandable that in this step, the coordinate position of the operated element and the page screenshot in the list are recorded, including:
[0089] Get the horizontal and vertical pixel positions of the operation point of the operated element in the browser, the horizontal and vertical pixel sizes of the entire page, and the horizontal and vertical pixel sizes of the page screenshot in the page list;
[0090] The horizontal and vertical pixel values of the mark point position are calculated according to the horizontal and vertical pixel positions of the operation point of the operated element, the horizontal and vertical pixel sizes of the entire page, and the horizontal and vertical pixel sizes of the page screenshot in the page list.
[0091] Furthermore, an automated test case is executed: when the automated tool executes each operation step, it automatically records the coordinate position of the operated element in the step and the page difference item of the page to which the step belongs; wherein, the coordinate position of the operated element in the step refers to the coordinate position of the operated element in the page displayed by the browser, and it is necessary to record the horizontal and vertical pixel positions of the operation point of the operated element in the browser and the horizontal and vertical pixel sizes of the entire page; the page difference items need to be recorded in the same form as in the system page list.
[0092] If it exists, the number of times the page is operated in the page list is N plus one; and the mark point position is calculated based on the recorded coordinate position of the operated element and the page screenshot in the page list, and the position of the point to be marked is marked with an icon in the page screenshot. The mark point position is calculated as follows: input the horizontal and vertical pixel position of the operation point of the operated element in the browser, the horizontal and vertical pixel size of the entire page, and the horizontal and vertical pixel size of the page screenshot in the page list, and calculate (the recorded horizontal pixel position of the operation point / the overall horizontal pixel size of the page) * the horizontal pixel size of the page screenshot in the page list as the horizontal pixel value of the mark point position; (the recorded vertical pixel position of the operation point / the overall vertical pixel size of the page) * the vertical pixel size of the page screenshot in the page list as the vertical pixel value of the mark point position; additionally, the same page screenshot is allowed to be marked with icons multiple times.
[0093] If it does not exist, the tool automatically records the step in the log. After the test is completed, it is manually verified whether the page where the step is located belongs to the page missing from the page list of the system under test. If so, it is manually determined whether the page list needs to be supplemented.
[0094] It should be noted that the missing parts of the pages in the supplementary list will also include:
[0095] Filtering the sub-pages in the page list, the pages whose operation times are greater than a preset threshold, to obtain a first page;
[0096] Filtering the sub-pages in the page list, the pages whose operation times are less than a preset threshold and not zero, to obtain a second page;
[0097] Filter the pages whose operation times are zero in the page list to obtain the third page;
[0098] The page coverage of the test is calculated based on the first page, the second page and the third page. The corresponding calculation method is: calculate the (first page + second page) / (first page + second page + third page) to get the page coverage of the test; calculate the (first page) / (first page + second page) to get the proportion of pages that are operated more times in this test;
[0099] It should be further explained that the page coverage of the test is calculated based on the number of times all sub-pages are operated and the total number of times all pages in the list are operated.
[0100] After all automated test cases are executed, the tool checks one by one whether the page difference items recorded in the above steps exist in the page list of the system;
[0101] Furthermore, after the tool has checked all automated operation steps, input the system page list and the page screenshots marked with icons, and the tool will automatically generate the page coverage results:
[0102] Filter high-frequency pages: By setting a threshold T, filter out pages in the page list with a number of operations N greater than the threshold T as high-frequency pages; wherein the threshold T can be a fixed value set manually or the average value of the number of page operations N. It should be noted that high frequency refers to sub-pages with a relatively large number of operations, which need to be paid special attention to.
[0103] Calculate page coverage: Calculate "number of pages with page operation number N>0 / total number of pages" to get the page coverage of this automated test;
[0104] Display operation coverage distribution map: Display page screenshots with icon marks to visualize the operation coverage distribution within the page;
[0105] Comprehensive coverage results can effectively evaluate the high-frequency page distribution, page coverage, and page operation coverage distribution characteristics of the tested automation case scripts;
[0106] Additionally, the page list of the system under test does not necessarily have to include all possible sub-pages, and some pages can also be manually selected as the page list according to requirements;
[0107] Additionally, it should be noted that there is only one page list for a system under test, that is, for the same system under test, multiple executions of the automated test coverage calculation in this method only rely on the same page list of the system under test. If the page list of the system under test already exists, there is no need to regenerate the page list of the system under test.
[0108] Embodiment 2:
[0109] like Figure 2As shown, this embodiment provides a device for testing network page evaluation, see Figure 2 The device includes an access module 701, an acquisition module 702, a test module 703 and a judgment module 704, wherein:
[0110] Access module 701: used to traverse all sub-pages of the user interface to be tested;
[0111] Acquisition module 702: used to respectively acquire the attribute information of all sub-pages in the traversal process, and save the acquired attribute information to the list of the user interface to be tested, wherein the attribute information includes the title, the first distinguishing item and the screenshot of each sub-page, wherein the first distinguishing item is the distinguishing point set information of the attributes of two sub-pages;
[0112] Testing module 703: used to perform a test according to the first difference item, record the coordinate position of the operated element in each sub-page and the second difference item, where the second difference item is the difference point set information of the attributes of the two sub-pages after the test;
[0113] The judgment module 704 is used to judge whether the second distinguishing item is in the list of the user interface to be tested. If so, the coordinate position of the operated element and the page screenshot in the list are recorded; if not, the missing part of the page in the list is supplemented.
[0114] Preferably, the test module 703 further includes a first acquisition unit 7021, an adding unit 7022 and a test unit 7023, wherein:
[0115] The first acquisition unit 7021 is used to acquire a page list of the user interface to be tested;
[0116] Adding unit 7022: used for adding a count item N in the page list, and setting the initial value of the count item N to zero;
[0117] Testing unit 7023: used to perform testing according to the operated elements in the page list.
[0118] Preferably, the judgment module 704 includes a second acquisition unit 7041 and a first calculation unit 7042, wherein:
[0119] The second acquisition unit 7041 is used to acquire the horizontal and vertical pixel positions of the operation point of the operated element in the browser, the horizontal and vertical pixel sizes of the entire page, and the horizontal and vertical pixel sizes of the page screenshot in the page list;
[0120] The first calculation unit 7042 is used to calculate the horizontal and vertical pixel values of the mark point position according to the horizontal and vertical pixel positions of the operation point of the operated element, the horizontal and vertical pixel sizes of the entire page, and the horizontal and vertical pixel sizes of the page screenshot in the page list.
[0121] Preferably, the test module 703 includes a third acquisition unit 7031, a fourth acquisition unit 7032, a fifth acquisition unit 7033 and a recording unit 7034, wherein:
[0122] The third acquisition unit 7031 is used to acquire the link of the operated element in the subpage;
[0123] The fourth acquisition unit 7032 is used to acquire the title content in the subpage;
[0124] The fifth acquisition unit 7033 is used to acquire the name of the navigation bar submenu of the most recent navigation bar operation in the subpage, and use the navigation bar submenu name as the second distinguishing item;
[0125] Recording unit 7034: used to record the links of all operated elements in the sub-page, the title content in the sub-page and the second difference item.
[0126] Preferably, the judgment module 704 further includes a first screening unit 705, a second screening unit 706, a third screening unit 707, a third calculation unit 708 and a fourth calculation unit 709, wherein:
[0127] The first screening unit 705 is used to screen the pages in the page list whose number of operations is greater than a preset threshold, and obtain the first page;
[0128] The second screening unit 706 is used to screen the sub-pages in the page list whose operation times are less than a preset threshold and not zero, to obtain a second page;
[0129] The third screening unit 707 is used to screen the pages in the page list whose operation times are zero, and obtain the third page;
[0130] The third calculation unit 708 is used to calculate the page coverage of the test according to the first page, the second page and the third page.
[0131] The judging module 704 further includes a fourth calculating unit 709:
[0132] The fourth calculation unit 709 is used to calculate the page coverage of the test according to the number of times all sub-pages are operated and the total number of times all pages in the list are operated.
[0133] It should be noted that, regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.
[0134] Embodiment 3:
[0135] Corresponding to the above method embodiment, this embodiment further provides a device for testing web page evaluation. The device for testing web page evaluation described below and the method for testing web page evaluation described above can refer to each other.
[0136] Figure 3 FIG. 8 is a block diagram of a device 800 for testing web page evaluation according to an exemplary embodiment. Figure 3 As shown, the device 800 for testing web page evaluation may include: a processor 801 and a memory 802. The device 800 for testing web page evaluation may also include one or more of a multimedia component 803, an I / O interface 804, and a communication component 805.
[0137] The processor 801 is used to control the overall operation of the device 800 for testing web page evaluation to complete all or part of the steps in the above-mentioned method for testing web page evaluation. The memory 802 is used to store various types of data to support the operation of the device 800 for testing web page evaluation, and these data may include, for example, instructions for any application or method operating on the device 800 for testing web page evaluation, and application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk. The multimedia component 803 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 802 or sent via the communication component 805. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 804 provides an interface between the processor 801 and other interface modules, and the above-mentioned other interface modules can be keyboards, mice, buttons, etc. These buttons can be virtual buttons or physical buttons. The communication component 805 is used for wired or wireless communication between the device 800 for the test network page evaluation and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 805 can include: Wi-Fi module, Bluetooth module, NFC module.
[0138] In an exemplary embodiment, the device 800 for testing network page evaluation can be implemented by one or more application specific integrated circuits (Application Specific Integrated Circuit, referred to as ASIC), digital signal processors (Digital Signal Processor, referred to as DSP), digital signal processing devices (Digital Signal Processing Device, referred to as DSPD), programmable logic devices (Programmable Logic Device, referred to as PLD), field programmable gate arrays (Field Programmable Gate Array, referred to as FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned test network page evaluation method.
[0139] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned test network page evaluation method are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 802 including program instructions, and the above-mentioned program instructions can be executed by the processor 801 of the device 800 for testing network page evaluation to complete the above-mentioned test network page evaluation method.
[0140] Embodiment 4:
[0141] Corresponding to the above method embodiment, this embodiment further provides a readable storage medium. The readable storage medium described below and the method for testing web page evaluation described above can refer to each other.
[0142] A readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for testing network page evaluation in the above method embodiment are implemented.
[0143] The readable storage medium may specifically be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or other readable storage medium that can store program codes.
[0144] In summary, the present invention can be used to effectively evaluate the page coverage of most web pages. After the test is completed, the page coverage can be automatically calculated, the high-frequency test pages can be counted, and the page coverage results can be visualized, so as to automatically, quantifiably and accurately count the page coverage. On the basis of effectively and accurately evaluating the automated coverage, it can greatly reduce labor costs and improve work efficiency. It is particularly suitable for stable web page systems in which different pages are responsible for independent businesses.
[0145] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for evaluating a test web page, It is characterized in that include: Traverse all sub-pages of the user interface to be tested; Respectively obtain the attribute information of all the sub-pages in the traversal process, and save the obtained attribute information to the list of the user interface to be tested, wherein the attribute information includes the title, the first distinguishing item and the screenshot of each sub-page, and the first distinguishing item is the distinguishing point set information of the attributes of two sub-pages; Performing a test according to the first distinguishing item, recording the coordinate position of the operated element in each of the sub-pages and the second distinguishing item, wherein the second distinguishing item is distinguishing point set information of the attributes of the two sub-pages after the test; Determine whether the second distinguishing item is in the list of the user interface to be tested, and if so, record the coordinate position of the operated element and the page screenshot in the list; If not, then fill in the missing parts of the pages in the said list; The testing according to the first distinguishing item may also include: Obtaining a page list of the user interface to be tested; Add a count item N to the page list, and set the initial value of the count item N to zero; The said supplementary part of the missing pages in the said list further comprises: Filtering the sub-pages in the page list, the pages whose operation times are greater than a preset threshold, to obtain a first page; Filtering the sub-pages in the page list, the pages whose operation times are less than a preset threshold and not zero, to obtain a second page; Filtering the pages in the page list whose operation times are zero to obtain the third page; The page coverage of the test is calculated based on the first page, the second page and the third page.
2. The method for evaluating a test web page according to claim 1, Features , the recording of the coordinate position of the operated element and the page screenshot in the list includes: Obtain the horizontal and vertical pixel positions of the operation point of the operated element in the browser, the horizontal and vertical pixel sizes of the entire page, and the horizontal and vertical pixel sizes of the page screenshot in the page list; The horizontal and vertical pixel values of the mark point position are calculated according to the horizontal and vertical pixel positions of the operation point of the operated element, the horizontal and vertical pixel sizes of the entire page, and the horizontal and vertical pixel sizes of the page screenshot in the page list.
3. The method for evaluating a test web page according to claim 1, Features , the record of the coordinate position of the operated element in each of the sub-pages and the second difference item includes: Obtaining a link to the operated element in the subpage; Get the title content in the subpage; Obtaining the name of the navigation bar submenu of the most recent navigation bar operation in the subpage, and using the navigation bar submenu name as the second distinguishing item of the operation; The links of all operated elements in the subpage, the title content in the subpage and the second distinguishing item are recorded.
4. The method for evaluating a test web page according to claim 1, Features , said supplementing the missing parts of the pages in said list, and then also including: The page coverage of the test is calculated based on the number of times all the sub-pages are operated and the total number of times all the pages in the list are operated.
5. A device for testing web page evaluation, It is characterized in that include: Access module: used to traverse all sub-pages of the user interface to be tested; Acquisition module: used to respectively acquire the attribute information of all the sub-pages in the traversal process, and save the acquired attribute information into the list of the user interface to be tested, wherein the attribute information includes the title, the first distinguishing item and the screenshot of each sub-page, wherein the first distinguishing item is the distinguishing point set information of the attributes of two sub-pages; Testing module: used for testing according to the first distinguishing item, recording the coordinate position of the operated element in each sub-page and the second distinguishing item, wherein the second distinguishing item is the distinguishing point set information of the attributes of the two sub-pages after the test; A judgment module: used to judge whether the second distinguishing item is in the list of the user interface to be tested, and if so, record the coordinate position of the operated element and the page screenshot in the list; if not, supplement the missing part of the page in the list; The test module also includes: A first acquisition unit: used to acquire a page list of the user interface to be tested; Adding unit: used for adding a count item N in the page list, and setting the initial value of the count item N to zero; The judging module further comprises: A first screening unit: used for screening the pages in the page list whose number of operations is greater than a preset threshold, to obtain a first page; A second screening unit: used for screening the pages whose number of operations in the sub-pages in the page list is less than a preset threshold and not zero, to obtain a second page; A third screening unit: used for screening pages in the page list whose operation times are zero to obtain a third page; A third calculation unit is configured to calculate the page coverage of the test according to the first page, the second page and the third page.
6. The apparatus for testing web page evaluation according to claim 5, It is characterized in that The judging module comprises: The second acquisition unit is used to acquire the horizontal and vertical pixel positions of the operation point of the operated element in the browser, the horizontal and vertical pixel sizes of the entire page, and the horizontal and vertical pixel sizes of the page screenshot in the page list; The first calculation unit is used to calculate the horizontal and vertical pixel values of the mark point position according to the horizontal and vertical pixel positions of the operation point of the operated element, the horizontal and vertical pixel sizes of the entire page, and the horizontal and vertical pixel sizes of the page screenshot in the page list.
7. The apparatus for testing web page evaluation according to claim 5, It is characterized in that The test module includes: A third acquisition unit: used for acquiring a link of the operated element in the subpage; The fourth acquisition unit is used to acquire the title content in the subpage; A fifth obtaining unit: used for obtaining a name of a navigation bar submenu of a most recent navigation bar operation in the subpage, and using the name of the navigation bar submenu as the second distinguishing item; Recording unit: used for recording the links of all operated elements in the sub-page, the title content in the sub-page and the second distinguishing item.
8. The apparatus for testing web page evaluation according to claim 5, It is characterized in that The judging module further comprises: The fourth calculation unit is used to calculate the page coverage of the test according to the number of times all the sub-pages are operated and the total number of times all the pages in the list are operated.
9. A device for testing the evaluation of web pages, It is characterized in that include: Memory for storing computer programs; A processor, configured to implement the steps of the method for testing web page evaluation according to any one of claims 1 to 4 when executing the computer program.
10. A readable storage medium, Features: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the test web page evaluation method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
User interface (UI) testing method and device, server and storage medium
CN107506300A
Application program traversing method, device, electronic equipment and storage medium
CN112597012A