Patrol method and device for front-end page

Through a headless browser access to the pre -set page list, the access results of the front -end page are automatically determined, and the problem of low artificial inspection efficiency in the existing technologies has been solved, and automatic and accurate automatic front -end pages are realized.

CN119377505APending Publication Date: 2025-01-28BEIJING JINGDONG TUOXIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310915425.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-25
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The stability of existing web front-end pages mainly depends on manual inspection, resulting in high labor intensity, high cost and low efficiency.

Method used

By obtaining the pre -set page list, use a headless browser to access the front page, determine the page access results, and generate the page inspection results according to the results.

Benefits of technology

The automatic inspection of the front -end page is realized, the labor intensity and labor costs are reduced, and the inspection efficiency and accuracy are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377505A_ABST
    Figure CN119377505A_ABST
Patent Text Reader

Abstract

The invention discloses a front-end page patrol method and device. According to one specific embodiment, the method comprises the steps that a preset page list is obtained, and the page list comprises page information of a front-end page to be patrolled; accessing a front-end page corresponding to the page list through a headless browser, and determining a page access result; and according to the page access result, determining a page patrol result of the front-end page corresponding to the page list. The page patrol result of the front-end page is determined on the basis of the headless browser for the page access result of the front-end page, the labor intensity and the labor cost in the page patrol process are reduced, and the efficiency and the accuracy of the page patrol process are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of front-end technology, specifically to page patrol technology, and more particularly to a front-end page patrol method, device, computer-readable medium and electronic device. Background Art

[0002] As the traffic entrance of Internet products, the web front-end page has the functional attribute of directly facing users, and its stability (accessibility) is extremely important. The stability of existing web front-end pages is mainly determined by testers in daily manual inspections. For the front-end pages of a large number of business lines, the testing department needs to arrange many personnel to conduct regular inspections to ensure that the core function pages can be accessed normally. Summary of the invention

[0003] The embodiments of the present application provide a front-end page inspection method, device, computer-readable medium and electronic device.

[0004] In a first aspect, an embodiment of the present application provides a front-end page patrol method, comprising: obtaining a pre-set page list, wherein the page list includes page information of a front-end page to be patrolled; accessing the front-end page corresponding to the page list through a headless browser to determine a page access result; and determining a page patrol result of the front-end page corresponding to the page list based on the page access result.

[0005] In some examples, the above-mentioned page list also includes page elements in the front-end page to be inspected, and the above-mentioned access to the front-end page corresponding to the page list through a headless browser to determine the page access result includes: accessing the front-end page corresponding to the page list through a headless browser to determine the page level access result; for the target front-end page successfully accessed in the page level access result, crawling the page elements corresponding to the target front-end page included in the page list to determine the element level access result; determining the page access result based on the page level access result and the element level access result.

[0006] In some examples, the above-mentioned accessing the front-end page corresponding to the page list through a headless browser to determine the page level access result includes: accessing the front-end page corresponding to the page list through a headless browser, and determining the page level access result according to a preset page loading waiting time.

[0007] In some examples, the above-mentioned determination of the page patrol result of the front-end page corresponding to the page list based on the page access result includes: in response to determining that the page access result represents the existence of at least one of an unsuccessfully accessed front-end page and an unsuccessfully captured page element, generating a page patrol result based on at least one of the unsuccessfully accessed front-end page and the unsuccessfully captured page element.

[0008] In some examples, the above method also includes: editing at least one of the following items according to the received editing operation: page information in the page list, and page elements in the front-end page represented by the page information.

[0009] In some examples, the above-mentioned accessing the front-end page corresponding to the page list through a headless browser to determine the page access result includes: accessing the front-end page corresponding to the page list through the headless browser with reference to a preset scheduled task to determine the page access result, wherein the scheduled task is used to indicate the time when the headless browser accesses the front-end page corresponding to the page list.

[0010] In some examples, the above method also includes: determining a scheduled task based on the received setting operation.

[0011] In some examples, the above method also includes: sending the page inspection result to a pre-specified target object via a preset communication method.

[0012] In the second aspect, an embodiment of the present application provides a front-end page inspection device, comprising: an acquisition unit, configured to obtain a pre-set page list, wherein the page list includes page information of the front-end page to be inspected; a first determination unit, configured to access the front-end page corresponding to the page list through a headless browser, and determine the page access result; a second determination unit, configured to determine the page inspection result of the front-end page corresponding to the page list based on the page access result.

[0013] In some examples, the above-mentioned page list also includes page elements in the front-end page to be inspected, and the above-mentioned first determination unit is further configured to: access the front-end page corresponding to the page list through a headless browser to determine the page-level access result; for the target front-end page successfully accessed in the page-level access result, crawl the page elements corresponding to the target front-end page included in the page list to determine the element-level access result; determine the page access result based on the page-level access result and the element-level access result.

[0014] In some examples, the first determination unit is further configured to: access a front-end page corresponding to the page list through a headless browser, and determine a page level access result according to a preset page loading waiting time.

[0015] In some examples, the second determination unit is further configured to: in response to determining that the page access result represents the existence of at least one of an unsuccessfully accessed front-end page and an unsuccessfully captured page element, generate a page inspection result based on at least one of an unsuccessfully accessed front-end page and an unsuccessfully captured page element.

[0016] In some examples, the apparatus further includes: an editing unit configured to edit at least one of the following items according to the received editing operation: page information in the page list, and page elements in the front-end page represented by the page information.

[0017] In some examples, the above-mentioned first determination unit is further configured to: access the front-end page corresponding to the page list through a headless browser, with reference to a preset scheduled task, and determine the page access result, wherein the scheduled task is used to indicate the time when the headless browser accesses the front-end page corresponding to the page list.

[0018] In some examples, the above-mentioned apparatus further includes: a setting unit configured to determine a scheduled task according to a received setting operation.

[0019] In some examples, the above-mentioned device also includes: a communication unit configured to send the page inspection result to a pre-specified target object through a preset communication method.

[0020] In a third aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner of the first aspect is implemented.

[0021] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation manner of the first aspect.

[0022] The front-end page inspection method and device provided in the embodiment of the present application obtain a preset page list, wherein the page list includes page information of the front-end page to be inspected; through a headless browser, the front-end page corresponding to the page list is accessed to determine the page access result; based on the page access result, the page inspection result of the front-end page corresponding to the page list is determined, thereby providing an automatic inspection method for the front-end page, and determining the page inspection result of the front-end page based on the page access result of the headless browser for the front-end page, thereby reducing the labor intensity and labor cost of the page inspection process and improving the efficiency and accuracy of the page inspection process. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0024] Figure 1 is an exemplary system architecture diagram in which an embodiment of the present application may be applied;

[0025] Figure 2is a flow chart of an embodiment of a front-end page inspection method according to the present application;

[0026] Figure 3 is a schematic diagram of an application scenario of the front-end page inspection method according to this embodiment;

[0027] Figure 4 is a flow chart of another embodiment of the front-end page inspection method according to the present application;

[0028] Figure 5 It is a structural diagram of an embodiment of a patrol device for a front-end page according to the present application;

[0029] Figure 6 It is a structural diagram of a computer system suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION

[0030] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0031] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0032] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.

[0033] Figure 1 An exemplary architecture 100 is shown to which the front-end page inspection method and apparatus of the present application can be applied.

[0034] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The communication connection between the terminal devices 101, 102, 103 constitutes a topological network, and the network 104 is used to provide a medium for the communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0035] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Terminal devices 101, 102, 103 can be hardware devices or software that support network connection for data interaction and data processing. When terminal devices 101, 102, 103 are hardware, they can be various electronic devices that support network connection, information acquisition, interaction, display, processing and other functions, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers and desktop computers, etc. When terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules for providing distributed services, for example, or it can be implemented as a single software or software module. No specific limitation is made here.

[0036] The server 105 may be a server that provides various services, for example, a background processing server that receives a page list sent by the terminal devices 101, 102, and 103 and determines a page inspection result of the front-end page based on the page access result of the headless browser for the front-end page corresponding to the page list. As an example, the server 105 may be a cloud server.

[0037] It should be noted that the server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, software or software modules used to provide distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.

[0038] It should also be noted that the front-end page inspection method provided in the embodiment of the present application can be executed by a server, or by a terminal device, or by a server and a terminal device in cooperation with each other. Accordingly, the various parts (such as various units) included in the front-end page inspection device can be all set in the server, or all set in the terminal device, or can be set in the server and the terminal device respectively.

[0039] It should be understood that Figure 1 The number of terminal devices, networks, and servers in the system is only illustrative. Depending on the implementation requirements, there may be any number of terminal devices, networks, and servers. When the electronic device on which the front-end page inspection method is running does not need to transmit data with other electronic devices, the system architecture may only include the electronic device (such as a server or terminal device) on which the front-end page inspection method is running.

[0040] Continue to refer Figure 2, a process 200 of an embodiment of a front-end page inspection method is shown, comprising the following steps:

[0041] Step 201, obtaining a preset page list.

[0042] In this embodiment, the execution subject of the front-end page inspection method (for example Figure 1 The terminal device or server in the system can obtain the preset page list remotely or locally through a wired network connection mode or a wireless network connection mode. The page list includes the page information of the front-end page to be inspected.

[0043] The page information may be information that can uniquely identify the front-end page to be inspected, for example, the address of the page, URL (Uniform Resource Locator) and other information.

[0044] As an example, the execution subject has a page list configuration function, and can receive a user's page list configuration instruction to generate a page list according to the page list configuration instruction; the execution subject also has a page list editing function, and can receive a user's page list editing instruction to edit the page information in the page list according to the page list editing instruction. The page list editing instruction is, for example, an editing instruction such as adding page information, deleting page information, and modifying page information. The page list can be managed through a database to facilitate editing operations based on the page list editing instruction.

[0045] Step 202: Access the front-end page corresponding to the page list through a headless browser to determine the page access result.

[0046] In this embodiment, the above-mentioned execution subject can access the front-end page corresponding to the page list through a headless browser to determine the page access result.

[0047] A headless browser is a browser without an interface. It has a complete browser kernel, including a JavaScript parsing engine, a rendering engine, etc. The biggest difference from a normal browser is that the running interface of a headless browser cannot be seen during execution, but the screenshot function of the GUI (Graphical User Interface) test framework can still be used to capture the page being executed. In this implementation, various headless browsers can be used, such as the headless browser Puppeteer.

[0048] For each page information in the page list, the above-mentioned execution entity can access the front-end page corresponding to the page information through a headless browser to determine the sub-page access result of whether the front-end page is successfully accessed; then, combined with the sub-page access results corresponding to each page information in the page list, determine the final page access result.

[0049] As an example, when the loading process of the front-end page represented by the page information throws an exception, such as the status code is 404 (inaccessible) or the status code is 500 (server error), the access result of the sub-page corresponding to the representation page information is access failure; otherwise, the access result of the sub-page corresponding to the representation page information is access success.

[0050] Specifically, first, run puppeteer.launch() to start the headless browser and receive the browser object browser it returns; then, run browser.newPage() to create a new page and receive the page object page it returns; finally, run page.goto to access the front-end page corresponding to the page list.

[0051] In actual page inspection situations, the page list may include a large number of page information. In order to improve the efficiency of page inspection, the above-mentioned execution body can start multiple threads and access the front-end pages corresponding to the page list in parallel through a headless browser.

[0052] In some optional implementations of this example, the page list also includes page elements in the front-end page to be inspected. For each page information in the page list, the user can configure the page elements to be captured in the front-end page represented by the page information according to the page inspection requirements. The page elements can be identified by the ID (Identity Document) attribute of the HTML (HyperText Mark-up Language) node or the class (Cascading Style Sheet) name.

[0053] In this implementation, the execution subject may perform step 202 as follows:

[0054] First, use a headless browser to access the front-end page corresponding to the page list to determine the page-level access results.

[0055] As an example, for each page information in the page list, the above-mentioned execution entity can access the front-end page corresponding to the page information through a headless browser to determine the sub-page level access result of whether the front-end page is successfully accessed; then, combined with the sub-page level access result corresponding to each page information in the page list, determine the final page level access result.

[0056] As an example, when the loading process of the front-end page represented by the page information throws an exception, such as the status code is 404 (inaccessible) or the status code is 500 (server error), the sub-page level access result corresponding to the representation page information is access failure; otherwise, the sub-page level access result corresponding to the representation page information is access success.

[0057] Second, for the target front-end page successfully accessed in the page-level access result, the page elements corresponding to the target front-end page included in the page list are captured to determine the element-level access result.

[0058] In this implementation, for the target front-end page successfully accessed during the page access process, the execution subject further captures the page elements corresponding to the target front-end page included in the page list to determine whether the element-level access result of the page elements is successfully captured.

[0059] As an example, when the object returned by the page element crawling operation is null, it means that the crawling has failed; otherwise, it means that the crawling has succeeded.

[0060] Third, the page access result is determined according to the page level access result and the element level access result.

[0061] In this implementation, the execution subject may determine the page access result by combining the page level access result and the element level access result.

[0062] In this implementation, in addition to page-level inspection, page element-level inspection can also be performed, further improving the flexibility and accuracy of the page inspection process.

[0063] In some optional implementations of this embodiment, the above-mentioned execution entity can perform the above-mentioned first step in the following manner: access the front-end page corresponding to the page list through a headless browser, and determine the page level access result according to the preset page loading waiting time.

[0064] The page loading wait time represents the maximum waiting time in the page loading process. In response to determining that the page loading wait time has been reached and the front-end page has not been successfully loaded, it is considered that the access has failed. As an example, the page loading wait time can be specified through page.waitForTimeout(), and the unit of the page loading wait time is milliseconds.

[0065] In this implementation, the user can flexibly set the page loading waiting time according to actual needs to determine the page level access result, thereby improving the flexibility and operability of the page inspection process.

[0066] In some optional implementations of this embodiment, the execution subject may perform step 202 as follows: by using a headless browser, referring to a preset timed task, accessing a front-end page corresponding to the page list, and determining a page access result. The timed task is used to indicate the time when the headless browser accesses the front-end page corresponding to the page list.

[0067] As an example, after installing the NodeJS server program express (a lightweight NodeJS server software), start the express service and run setTimeout(handler,1000*10) to start a timed task. The first parameter is the callback function when the timer is triggered, and the second parameter is the trigger frequency in milliseconds. For example, set it to execute once every 10 minutes. The specific frequency can be configured according to actual needs.

[0068] In this implementation, the user can flexibly set the scheduled task according to actual needs to determine the page patrol frequency, thereby improving the flexibility and operability of the page patrol process.

[0069] Step 203: Determine the page inspection result of the front-end page corresponding to the page list according to the page access result.

[0070] In this embodiment, the execution subject may determine the page inspection result of the front-end page corresponding to the page list according to the page access result.

[0071] As an example, the execution subject may directly use the page access result as the page inspection result of the front-end page corresponding to the page list. As another example, the execution subject may filter out the page information and the information representing the access result from the page access result to simplify the page access result and obtain the page inspection result.

[0072] In some optional implementations of this embodiment, the execution subject may also perform step 203 as follows:

[0073] In response to determining that the page access result indicates that there is at least one of an unsuccessfully accessed front-end page and an unsuccessfully captured page element, a page inspection result is generated based on at least one of the unsuccessfully accessed front-end page and the unsuccessfully captured page element.

[0074] For the page inspection process, the successfully accessed front-end pages and the successfully captured page elements can be ignored, and only the unsuccessfully accessed front-end pages and the unsuccessfully captured page elements can be focused on. Therefore, the unsuccessfully accessed front-end pages and / or unsuccessfully captured page elements can be filtered out from the page access results to generate the page inspection results.

[0075] In this implementation, unsuccessfully accessed front-end pages and / or unsuccessfully captured page elements that need to be paid attention to in the page inspection process are screened out from the page access results to generate page inspection results, thereby improving the accuracy and simplicity of the page inspection results.

[0076] Continue to see Figure 3 , Figure 3 FIG. 3 is a schematic diagram 300 of an application scenario of the front-end page inspection method according to this embodiment. Figure 3 In the application scenario, the person in charge 301 of the shopping application sends a page list configuration operation to the terminal device 302 to set the page list, wherein the page list includes the page information of the front-end page to be inspected in the shopping application. The server 303 communicates with the terminal device 302, firstly obtains the configuration list; then, through the headless browser, accesses the front-end page corresponding to the page list to determine the page access result; finally, according to the page access result, determines the page inspection result of the front-end page corresponding to the page list.

[0077] The method provided by the above-mentioned embodiment of the present application obtains a pre-set page list, wherein the page list includes page information of the front-end page to be inspected; through a headless browser, the front-end page corresponding to the page list is accessed to determine the page access result; based on the page access result, the page inspection result of the front-end page corresponding to the page list is determined, thereby providing an automatic inspection method for the front-end page, and determining the page inspection result of the front-end page based on the page access result of the headless browser for the front-end page, thereby reducing the labor intensity and labor cost of the page inspection process and improving the efficiency and accuracy of the page inspection process.

[0078] In some optional implementations of this embodiment, the above-mentioned execution subject may also perform the following operations: according to the received editing operation, edit at least one of the following: page information in the page list, page elements in the front-end page represented by the page information.

[0079] As an example, the above execution entity provides an editing function for page information in a page list and / or page elements in a front-end page represented by the page information. The editing function supports operations such as adding, deleting, and modifying page information and page elements.

[0080] In this implementation, the user can flexibly edit the page information in the page list and / or the page elements in the front-end page represented by the page information according to actual needs, further improving the flexibility and operability of the page inspection process.

[0081] In some optional implementations of this embodiment, the above-mentioned execution subject may also perform the following operations: sending the page inspection result to a pre-specified target object through a preset communication method.

[0082] The preset communication method includes, but is not limited to, email, SMS, instant messaging, etc., and the target object is, for example, a maintenance person of the application to which the front-end page belongs.

[0083] In this implementation, the page inspection results are sent to a pre-specified target object in a timely manner through a preset communication method, which helps to improve the processing efficiency of access failure pages and capture failure elements in the page inspection results.

[0084] Continue to refer Figure 4 , shows a schematic process 400 of an embodiment of a front-end page inspection method according to the present application, including the following steps:

[0085] Step 401, obtaining a preset page list.

[0086] The page list includes page information of the front-end page to be inspected and page elements in the front-end page to be inspected.

[0087] Step 402, access the front-end page corresponding to the page list through a headless browser, and determine the page level access result according to a preset page loading waiting time.

[0088] Step 403 , for the target front-end page successfully accessed in the page level access result, the page elements corresponding to the target front-end page included in the page list are captured to determine the element level access result.

[0089] Step 404: Determine the page access result according to the page level access result and the element level access result.

[0090] Step 405, in response to determining that the page access result indicates that there is at least one of an unsuccessfully accessed front-end page and an unsuccessfully captured page element, generate a page inspection result based on at least one of the unsuccessfully accessed front-end page and the unsuccessfully captured page element.

[0091] It can be seen from this embodiment that Figure 2 Compared with the corresponding embodiments, the process 400 of the front-end page patrol method in this embodiment specifically describes the process of determining the page-level access result, the process of determining the element-level access result and the process of determining the page patrol result, further improving the flexibility and accuracy of the page patrol process.

[0092] In order to further illustrate the front-end page inspection method in this application, the following specific examples are given:

[0093] 1. Install the NodeJS server program express (a lightweight NodeJS server software). Specifically, you can install it through the NodeJS dependency package management tool NPM.

[0094] 2. Start the express service and run setTimeout(handler,1000*10) to start a scheduled task. The first parameter in setTimeout() is the callback function when the timer is triggered, and the second parameter is the trigger frequency in milliseconds. The trigger frequency can be configured according to actual needs, for example, set the page inspection process to be executed every 10 minutes.

[0095] 3. Pre-configure a list of URLs of the Web front-end pages to be inspected. Each URL in the URL list can be configured with the page elements that need to be captured. The page elements can be identified by the id attribute of the HTML node or the class (cascading style sheet) name.

[0096] 4. Every time the timer is triggered (for example, every 10 minutes), the pre-configured URL list is traversed and automatically accessed. The access process specifically includes the following steps:

[0097] 4.1. Run puppeteer.launch() to start the headless browser and receive the browser object browser returned by it.

[0098] 4.2. Run browser.newPage() to create a new page and receive the page object page it returns.

[0099] 4.3、Run page.goto(url,{waitUntil:'networkidle0'}) to access the page. The first parameter "url" is the pre-configured URL of the page to be inspected, and the second parameter is a configuration item. Among them, waitUntil:'networkidle0' means that the page will stop waiting when there is no network connection (at least 500 milliseconds later), at which time all the content on the page should have been loaded. You can also use page.waitForTimeout(60*1000) to specify the page loading waiting time, and the unit of page loading waiting time is milliseconds.

[0100] 4.4. When an exception is thrown when loading a page, such as a status code of 404 (unable to access) or a status code of 500 (server error), it is necessary to connect to the business message system for an alarm. The specific alarm method can be determined based on the actual situation.

[0101] 4.5. When the page is successfully accessed, you can further fetch the pre-configured page elements in the URL list. For example, if the class (cascading style sheet) name is configured, you can run page.$('.style name') to get a page element object element.

[0102] 4.6. When the object returned from the page element crawling process is null, it means that the crawling failed, indicating that the displayed content of the page does not meet expectations. At this time, it is necessary to connect to the business message system for alarm and run page.screenshot({path:'error.png'}) to take a screenshot of the page. The parameter path is the path and file name for saving the screenshot.

[0103] Continue to refer Figure 5 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a front-end page inspection device, which is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0104] like Figure 5 As shown, the front-end page inspection device includes: an acquisition unit 501, configured to obtain a preset page list, wherein the page list includes page information of the front-end page to be inspected; a first determination unit 502, configured to access the front-end page corresponding to the page list through a headless browser to determine the page access result; a second determination unit 503, configured to determine the page inspection result of the front-end page corresponding to the page list based on the page access result.

[0105] In some optional implementations of this embodiment, the above-mentioned page list also includes page elements in the front-end page to be inspected, and the above-mentioned first determination unit 502 is further configured to: access the front-end page corresponding to the page list through a headless browser, and determine the page-level access result; for the target front-end page successfully accessed in the page-level access result, crawl the page elements corresponding to the target front-end page included in the page list, and determine the element-level access result; determine the page access result based on the page-level access result and the element-level access result.

[0106] In some optional implementations of this embodiment, the above-mentioned first determination unit 502 is further configured to: access the front-end page corresponding to the page list through a headless browser, and determine the page level access result according to a preset page loading waiting time.

[0107] In some optional implementations of this embodiment, the above-mentioned second determination unit 503 is further configured to: in response to determining that the page access result represents the existence of at least one of an unsuccessfully accessed front-end page and an unsuccessfully captured page element, generate a page patrol result based on at least one of an unsuccessfully accessed front-end page and an unsuccessfully captured page element.

[0108] In some optional implementations of this embodiment, the above-mentioned device also includes: an editing unit (not shown in the figure), which is configured to edit at least one of the following items according to the received editing operation: page information in the page list, and page elements in the front-end page represented by the page information.

[0109] In some optional implementations of this embodiment, the above-mentioned first determination unit 502 is further configured to: through a headless browser, refer to a preset scheduled task, access the front-end page corresponding to the page list, and determine the page access result, wherein the scheduled task is used to indicate the time when the headless browser accesses the front-end page corresponding to the page list.

[0110] In some optional implementations of this embodiment, the above-mentioned device further includes: a setting unit (not shown in the figure), which is configured to determine the scheduled task according to the received setting operation.

[0111] In some optional implementations of this embodiment, the above-mentioned device further includes: a communication unit (not shown in the figure), which is configured to send the page inspection result to a pre-specified target object through a preset communication method.

[0112] In this embodiment, an acquisition unit in a front-end page inspection device acquires a preset page list, wherein the page list includes page information of the front-end page to be inspected; a first determination unit accesses the front-end page corresponding to the page list through a headless browser to determine the page access result; a second determination unit determines the page inspection result of the front-end page corresponding to the page list based on the page access result, thereby providing an automatic inspection device for the front-end page, which determines the page inspection result of the front-end page based on the page access result of the headless browser for the front-end page, reduces the labor intensity and labor cost of the page inspection process, and improves the efficiency and accuracy of the page inspection process.

[0113] Reference below Figure 6 , which shows a device suitable for implementing the embodiments of the present application (eg Figure 1 Schematic diagram of the structure of a computer system 600 of the devices 101, 102, 103, 105 shown. Figure 6 The device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0114] like Figure 6As shown, the computer system 600 includes a processor (e.g., CPU, central processing unit) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the system 600 are also stored in the RAM 603. The processor 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0115] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0116] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 609, and / or installed from a removable medium 611. When the computer program is executed by the processor 601, the above-mentioned functions defined in the method of the present application are executed.

[0117] It should be noted that the computer-readable medium of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0118] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the client computer, partially on the client computer, as a separate software package, partially on the client computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the client computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0119] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the device, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0120] The units involved in the embodiments described in the present application may be implemented by software or by hardware. The described units may also be set in a processor, for example, may be described as: a processor comprising an acquisition unit, a first determination unit, and a second determination unit. Among them, the names of these units do not constitute a limitation on the unit itself under certain circumstances. For example, the first determination unit may also be described as "a unit that determines the page access result by accessing the front-end page corresponding to the page list through a headless browser."

[0121] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the device, the computer device: obtains a preset page list, wherein the page list includes page information of the front-end page to be inspected; accesses the front-end page corresponding to the page list through a headless browser to determine the page access result; and determines the page inspection result of the front-end page corresponding to the page list according to the page access result.

[0122] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.

Claims

1. A front-end page inspection method, comprising: Obtaining a preset page list, wherein the page list includes page information of the front-end page to be inspected; Access the front-end page corresponding to the page list through a headless browser to determine the page access result; According to the page access result, the page inspection result of the front-end page corresponding to the page list is determined.

2. The method according to claim 1, wherein: The page list also includes page elements in the front-end page to be inspected, and The step of accessing the front-end page corresponding to the page list through the headless browser to determine the page access result includes: Access the front-end page corresponding to the page list through the headless browser to determine the page level access result; For the target front-end page successfully accessed in the page level access result, crawling the page element corresponding to the target front-end page included in the page list, and determining the element level access result; The page access result is determined according to the page level access result and the element level access result.

3. The method according to claim 2, wherein: The step of accessing the front-end page corresponding to the page list through the headless browser to determine the page level access result includes: The headless browser is used to access the front-end page corresponding to the page list, and the page level access result is determined according to a preset page loading waiting time.

4. The method according to claim 2, wherein: Determining the page inspection result of the front-end page corresponding to the page list according to the page access result includes: In response to determining that the page access result indicates the existence of at least one of an unsuccessfully accessed front-end page and an unsuccessfully captured page element, the page inspection result is generated according to at least one of the unsuccessfully accessed front-end page and the unsuccessfully captured page element.

5. The method according to claim 2, wherein: Also includes: According to the received editing operation, edit at least one of the following: the page information in the page list, and the page elements in the front-end page represented by the page information.

6. The method according to claim 1, wherein: The step of accessing the front-end page corresponding to the page list through the headless browser to determine the page access result includes: Through the headless browser, refer to the preset scheduled task, access the front-end page corresponding to the page list to determine the page access result, wherein the scheduled task is used to indicate the time when the headless browser accesses the front-end page corresponding to the page list.

7. The method according to claim 6, wherein: Also includes: The scheduled task is determined according to the received setting operation.

8. The method according to any one of claims 1 to 7, wherein: Also includes: The page inspection result is sent to a pre-specified target object through a preset communication method.

9. A front-end page inspection device, comprising: An acquisition unit is configured to acquire a preset page list, wherein the page list includes page information of a front-end page to be inspected; A first determining unit is configured to access a front-end page corresponding to the page list through a headless browser to determine a page access result; The second determining unit is configured to determine the page inspection result of the front-end page corresponding to the page list according to the page access result.

10. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

11. An electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.