CN117667665B - White screen detection method, device, equipment and storage medium - Google Patents
White screen detection method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN117667665B CN117667665B CN202311254236.3A CN202311254236A CN117667665B CN 117667665 B CN117667665 B CN 117667665B CN 202311254236 A CN202311254236 A CN 202311254236A CN 117667665 B CN117667665 B CN 117667665B
- Authority
- CN
- China
- Prior art keywords
- preset
- white screen
- judging
- screen detection
- result
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 207
- 238000005070 sampling Methods 0.000 claims abstract description 128
- 238000000034 method Methods 0.000 claims abstract description 39
- 238000004590 computer program Methods 0.000 claims description 14
- 238000012937 correction Methods 0.000 claims description 10
- 230000005856 abnormality Effects 0.000 claims description 9
- 230000002159 abnormal effect Effects 0.000 claims description 6
- 230000000694 effects Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 5
- 238000011161 development Methods 0.000 description 4
- 238000009877 rendering Methods 0.000 description 4
- 230000002411 adverse Effects 0.000 description 3
- 238000012360 testing method Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Landscapes
- User Interface Of Digital Computer (AREA)
Abstract
The application discloses a white screen detection method, a device, equipment and a storage medium, which relate to the technical field of computers and comprise the following steps: judging whether the web item to be detected contains a skeleton screen or not based on a preset skeleton screen judging rule to obtain a first judging result; if the web item to be detected is included, sampling a current page by using a preset white screen detection rule in the process of loading the page for the web item to be detected, so as to finish corresponding first white screen detection operation and obtain a first white screen detection result; if the page is not included, after the page loading is completed, sampling the current page based on a preset white screen detection rule to complete corresponding second white screen detection operation and obtain a second white screen detection result; and taking the first white screen detection result or the second white screen detection result as a target white screen detection result corresponding to the web item to be detected, and executing corresponding white screen detection result output operation. The timeliness of the white screen detection can be effectively improved, and further the user experience is improved.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for detecting a white screen.
Background
With the development of front-end technology, web (World Wide Web) application tends to be complex, abnormal scenes are more and more, many business scenes cannot be completely covered in the development and testing stages, the front end needs to run on various devices, page rendering abnormality can be caused, user use experience and satisfaction degree are affected, if a white screen problem cannot be found and solved in time, the use and popularization effect of Web projects can be seriously affected, even bad influence can be caused on enterprise images, background data errors can be seriously caused, and particularly in a financial business system, a white screen detection technology is required to find a white screen problem in time, and normal use and experience of users are guaranteed.
Disclosure of Invention
Accordingly, the present invention is directed to a method, apparatus, device and storage medium for detecting a white screen, which can effectively improve timeliness of white screen detection, thereby improving user experience. The specific scheme is as follows:
In a first aspect, the present application provides a method for detecting a white screen, including:
judging whether a web item to be detected contains a skeleton screen or not based on a preset skeleton screen judging rule so as to obtain a corresponding first judging result;
If the first judging result shows that the web item to be detected contains a skeleton screen, sampling a current page by using a preset white screen detection rule in the process of loading the page for the web item to be detected, so as to finish corresponding first white screen detection operation and obtain a first white screen detection result;
If the first judging result indicates that the framework screen is not included, after the page loading is completed, sampling the current page based on the preset white screen detection rule to complete corresponding second white screen detection operation and obtain a second white screen detection result;
And taking the first white screen detection result or the second white screen detection result as a target white screen detection result corresponding to the web item to be detected, and executing corresponding white screen detection result output operation.
Optionally, the white screen detection method further includes:
and in the process of executing the first white screen detection operation or the second white screen detection operation, judging whether a first preset detection termination condition is met or not currently based on a preset abnormal detection correction mechanism.
Optionally, the determining whether the first preset detection termination condition is currently met based on the preset anomaly detection correction mechanism includes:
And judging whether the first preset detection termination condition is met or not currently based on a preset target detection timeout time node corresponding to the web item to be detected.
Optionally, the sampling the current page by using a preset white screen detection rule includes:
Sampling the current page based on a preset sampling rule to obtain a preset number of target sampling points;
judging whether the preset number of target sampling points belong to container nodes according to preset container node judging rules;
when any target sampling point is determined to be not in the container node, determining that a second preset detection termination condition is met;
And when each sampling point is determined to belong to a container node, re-jumping to the step of sampling the current page based on the preset sampling rule to obtain a new preset number of target sampling points until the first preset detection termination condition or the second preset detection termination condition is met.
Optionally, the sampling the current page based on the preset sampling rule includes:
taking the geometric center of the current page as an origin, and constructing a corresponding virtual rectangular coordinate system;
And respectively executing corresponding equal-division acquisition operation based on a virtual Y axis and a virtual X axis in the virtual rectangular coordinate system so as to obtain a preset number of target sampling points.
Optionally, the determining, according to a preset container node determining rule, whether the preset number of target sampling points belong to a container node includes:
Judging whether the web item to be detected contains a skeleton screen or not again based on the preset skeleton screen judging rule so as to obtain a corresponding second judging result;
And determining whether the preset number of target sampling points belong to container nodes or not by utilizing root node identification information corresponding to the current page or not according to the second judging result.
Optionally, the determining, based on a preset skeleton screen determining rule, whether the web item to be detected includes the skeleton screen, so as to obtain a corresponding first determining result, includes:
Acquiring target parameter information sent by a project developer corresponding to a web project to be detected;
and judging whether the web item to be detected contains a skeleton screen or not based on the target parameter information so as to obtain a corresponding first judgment result.
In a second aspect, the present application provides a white screen detection apparatus, including:
The first judging module is used for judging whether the web item to be detected contains the skeleton screen or not based on a preset skeleton screen judging rule so as to obtain a corresponding first judging result;
the first white screen detection module is used for sampling a current page by utilizing a preset white screen detection rule in the process of loading the page aiming at the web item to be detected when the first judgment result shows that the skeleton screen is included, so as to finish corresponding first white screen detection operation and obtain a first white screen detection result;
The second white screen detection module is used for sampling the current page based on the preset white screen detection rule after the page loading is completed when the first judgment result indicates that the skeleton screen is not included, so as to complete corresponding second white screen detection operation and obtain a second white screen detection result;
and the result output module is used for taking the first white screen detection result or the second white screen detection result as a target white screen detection result corresponding to the web item to be detected, and executing corresponding white screen detection result output operation.
In a third aspect, the present application provides an electronic device, comprising:
a memory for storing a computer program;
And the processor is used for executing the computer program to realize the steps of the white screen detection method.
In a fourth aspect, the present application provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the white screen detection method described above.
In the application, whether the web item to be detected contains the skeleton screen or not is judged based on the preset skeleton screen judging rule so as to obtain a corresponding first judging result; if the first judging result shows that the web item to be detected contains a skeleton screen, sampling a current page by using a preset white screen detection rule in the process of loading the page for the web item to be detected, so as to finish corresponding first white screen detection operation and obtain a first white screen detection result; if the first judging result indicates that the framework screen is not included, after the page loading is completed, sampling the current page based on the preset white screen detection rule to complete corresponding second white screen detection operation and obtain a second white screen detection result; and taking the first white screen detection result or the second white screen detection result as a target white screen detection result corresponding to the web item to be detected, and executing corresponding white screen detection result output operation. According to the method and the device, whether the skeleton screen exists in the web item to be detected is judged firstly, and then the white screen detection is carried out in the page loading process or after the page loading is completed according to the obtained first judging result, so that the white screen can be found and reported in time when the white screen exists, adverse effects caused by untimely problem solving due to the fact that the white screen problem cannot be found in time in the prior art are avoided, the problem of inaccurate detection caused by the fact that the white screen detection cannot be carried out on the item containing the skeleton screen in the prior art is avoided, and user experience is further improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for detecting a white screen according to the present application;
FIG. 2 is a schematic flow chart of a specific method for detecting a white screen according to the present application;
FIG. 3 is a schematic diagram of a structure of a white screen detection device according to the present application;
Fig. 4 is a block diagram of an electronic device according to the present application.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
With the development of front-end technology, web applications tend to be complex, abnormal scenes are more and more, many business scenes cannot be completely covered in development and testing stages, the front end needs to run on various devices, page rendering is abnormal, user use experience and satisfaction are affected, if white screen problems cannot be found and solved in time, the use and popularization effect of web projects can be seriously affected, even bad effects on enterprise images can be caused, background data errors can be seriously caused, and particularly in a financial business system, white screen problems are timely found by the white screen detection technology, and normal use and experience of users are guaranteed. Therefore, the application provides a white screen detection scheme which can effectively improve the timeliness of white screen detection and further improve the user experience.
Referring to fig. 1, the embodiment of the invention discloses a white screen detection method, which comprises the following steps:
And S11, judging whether the web item to be detected contains the skeleton screen or not based on a preset skeleton screen judging rule so as to obtain a corresponding first judging result.
In this embodiment, as shown in fig. 2, the determining, based on a preset skeleton screen determining rule, whether the web item to be detected includes a skeleton screen, to obtain a corresponding first determining result includes: acquiring target parameter information sent by a project developer corresponding to a web project to be detected; and judging whether the web item to be detected contains a skeleton screen or not based on the target parameter information so as to obtain a corresponding first judgment result. In this way, the white screen detection scheme corresponding to the web item to be detected is determined by judging whether the web item to be detected contains the skeleton screen.
And step S12, if the first judging result shows that the skeleton screen is included, sampling the current page by utilizing a preset white screen detection rule in the process of loading the page aiming at the web item to be detected, so as to finish corresponding first white screen detection operation and obtain a first white screen detection result.
In this embodiment, if the obtained first determination result indicates that the web item to be detected does not have a skeleton screen, it is determined that white screen detection is performed on the web item to be detected in the process of page loading, and white screen polling is opened up.
It should be understood that, in this embodiment, it is necessary to determine whether the first preset detection termination condition is currently satisfied based on the preset abnormality detection correction mechanism. The determining whether the first preset detection termination condition is currently satisfied based on the preset abnormality detection correction mechanism may specifically include: and judging whether the first preset detection termination condition is met or not currently based on a preset target detection timeout time node corresponding to the web item to be detected. The target detection timeout node can be configured and adjusted in advance based on actual requirements. In this way, the occurrence of the situation that the white screen polling is always performed can be avoided by the preset abnormality detection and correction mechanism, so that unnecessary waste of time resources can be avoided. In addition, the phenomenon of misjudgment of the white screen caused by the network problem can be avoided.
Specifically, in this embodiment, the sampling the current page by using the preset white screen detection rule includes: sampling the current page based on a preset sampling rule to obtain a preset number of target sampling points; judging whether the preset number of target sampling points belong to container nodes according to preset container node judging rules; when any target sampling point is determined to be not in the container node, determining that a second preset detection termination condition is met; and when each sampling point is determined to belong to a container node, re-jumping to the step of sampling the current page based on the preset sampling rule to obtain a new preset number of target sampling points until the first preset detection termination condition or the second preset detection termination condition is met. The preset number can be configured in advance based on actual requirements. That is, in this embodiment, the detection is specifically performed by using a target sampling point obtained by sampling the current page to determine a corresponding detection result.
Further, the sampling the current page based on the preset sampling rule includes: taking the geometric center of the current page as an origin, and constructing a corresponding virtual rectangular coordinate system; and respectively executing corresponding equal-division acquisition operation based on a virtual Y axis and a virtual X axis in the virtual rectangular coordinate system so as to obtain a preset number of target sampling points. Specifically, after the corresponding equally dividing and collecting operations are respectively executed on the virtual Y axis and the virtual X axis, a repeated origin needs to be removed, so as to finally obtain the preset number of target sampling points.
In this embodiment, when determining the target sampling points, the determining whether the preset number of target sampling points belong to a container node according to a preset container node determining rule includes: judging whether the web item to be detected contains a skeleton screen or not again based on the preset skeleton screen judging rule so as to obtain a corresponding second judging result; and determining whether the preset number of target sampling points belong to container nodes or not by utilizing root node identification information corresponding to the current page or not according to the second judging result. Specifically, root node identification information, i.e., ID (Identity document, identification number) or class (information for identifying a specific tag), corresponding to the current page, sent by the project developer is first acquired. And then judging whether the web item to be detected contains a skeleton screen or not again to obtain the second judging result. It can be understood that the second determination result is consistent with the obtained first determination result, and if the second determination result is yes, the ID or class of the corresponding skeleton screen element needs to be obtained, and then the ID or class of the skeleton screen element is compared with the ID or class of any one of the target sampling points to determine whether the skeleton screen contains the ID or class of any one of the target sampling points. If the skeleton screen contains an ID or class of any target sampling point, determining that the corresponding target sampling point belongs to a container node; if not, the corresponding target sampling point does not belong to the container node.
It is further understood that in the above process, if any one of the target sampling points does not belong to the container node, it is determined that the second preset detection termination condition is satisfied, and white screen polling is stopped, so as to obtain a corresponding first white screen detection result. In addition, regardless of the result, after the sampling point judgment operation of the current round is completed, the white screen judgment result of the current round needs to be returned.
And step S13, if the first judging result shows that the skeleton screen is not included, after the page loading is completed, sampling the current page based on the preset white screen detection rule so as to complete corresponding second white screen detection operation and obtain a second white screen detection result.
In this embodiment, specifically, if the second determination result obtained at this time is no, the root node identification information needs to be compared with the ID or class of any one of the target sampling points to determine whether the ID or class of any one of the target sampling points exists in the root node identification information. If the ID or class of any target sampling point exists in the root node identification information, determining that the corresponding target sampling point belongs to a container node; if not, the corresponding target sampling point does not belong to the container node. The rest of the judgment logic is the same as in step S22. For example, in the process of executing the second white screen detection operation, it is also necessary to determine whether the first preset detection termination condition is currently satisfied based on a preset abnormality detection correction mechanism. And, regardless of the result, after the sampling point judgment operation of the current round is completed, the white screen judgment result of the current round needs to be returned.
And S14, taking the first white screen detection result or the second white screen detection result as a target white screen detection result corresponding to the web item to be detected, and executing corresponding white screen detection result output operation.
In this embodiment, only two kinds of target white screen detection results are finally determined and output, and the target white screen detection results are wire or false. Wherein, the wire represents that the white screen detection is normal, namely the current page rendering is normal; the false represents that the white screen detects abnormality, namely, the current page rendering abnormality.
In summary, the embodiment not only can detect the white screen in the conventional sense, but also can detect the white screen only displaying the skeleton screen. In addition, through an abnormality correction mechanism, the embodiment avoids the false judgment of a white screen during detection, and further enhances the detection accuracy.
Therefore, in the embodiment of the application, whether the web item to be detected contains the skeleton screen or not is judged based on the preset skeleton screen judging rule so as to obtain a corresponding first judging result; if the first judging result shows that the web item to be detected contains a skeleton screen, sampling a current page by using a preset white screen detection rule in the process of loading the page for the web item to be detected, so as to finish corresponding first white screen detection operation and obtain a first white screen detection result; if the first judging result indicates that the framework screen is not included, after the page loading is completed, sampling the current page based on the preset white screen detection rule to complete corresponding second white screen detection operation and obtain a second white screen detection result; and taking the first white screen detection result or the second white screen detection result as a target white screen detection result corresponding to the web item to be detected, and executing corresponding white screen detection result output operation. According to the method and the device, whether the skeleton screen exists in the web item to be detected is judged firstly, and then the white screen detection is carried out in the page loading process or after the page loading is completed according to the obtained first judging result, so that the white screen can be found and reported in time when the white screen exists, adverse effects caused by untimely problem solving due to the fact that the white screen problem cannot be found in time in the prior art are avoided, the problem of inaccurate detection caused by the fact that the white screen detection cannot be carried out on the item containing the skeleton screen in the prior art is avoided, and user experience is further improved.
Referring to fig. 3, the embodiment of the application also correspondingly discloses a white screen detection device, which comprises:
The first judging module 11 is configured to judge whether the web item to be detected includes a skeleton screen based on a preset skeleton screen judging rule, so as to obtain a corresponding first judging result;
The first white screen detection module 12 is configured to sample a current page by using a preset white screen detection rule in a process of loading the page for the web item to be detected when the first determination result indicates that the first determination result includes a skeleton screen, so as to complete a corresponding first white screen detection operation and obtain a first white screen detection result;
the second white screen detection module 13 is configured to sample, when the first determination result indicates that the skeleton screen is not included, the current page based on the preset white screen detection rule after the page loading is completed, so as to complete a corresponding second white screen detection operation, and obtain a second white screen detection result;
And the result output module 14 is configured to take the first white screen detection result or the second white screen detection result as a target white screen detection result corresponding to the web item to be detected, and perform a corresponding white screen detection result output operation.
The more specific working process of each module may refer to the corresponding content disclosed in the foregoing embodiment, and will not be described herein.
Therefore, according to the embodiment of the application, whether the web item to be detected contains the skeleton screen or not is judged based on the preset skeleton screen judging rule, so that a corresponding first judging result is obtained; if the first judging result shows that the web item to be detected contains a skeleton screen, sampling a current page by using a preset white screen detection rule in the process of loading the page for the web item to be detected, so as to finish corresponding first white screen detection operation and obtain a first white screen detection result; if the first judging result indicates that the framework screen is not included, after the page loading is completed, sampling the current page based on the preset white screen detection rule to complete corresponding second white screen detection operation and obtain a second white screen detection result; and taking the first white screen detection result or the second white screen detection result as a target white screen detection result corresponding to the web item to be detected, and executing corresponding white screen detection result output operation. According to the method and the device, whether the skeleton screen exists in the web item to be detected is judged firstly, and then the white screen detection is carried out in the page loading process or after the page loading is completed according to the obtained first judging result, so that the white screen can be found and reported in time when the white screen exists, adverse effects caused by untimely problem solving due to the fact that the white screen problem cannot be found in time in the prior art are avoided, the problem of inaccurate detection caused by the fact that the white screen detection cannot be carried out on the item containing the skeleton screen in the prior art is avoided, and user experience is further improved.
In some specific embodiments, the white screen detection device may specifically further include:
The first preset termination condition judging module is used for judging whether the first preset detection termination condition is met or not currently based on a preset abnormal detection correction mechanism in the process of executing the first white screen detection operation or the second white screen detection operation.
In some specific embodiments, the first termination condition determining module may specifically include:
And the first termination condition judging unit is used for judging whether the first preset detection termination condition is met or not currently based on a preset target detection timeout time node corresponding to the web item to be detected.
In some specific embodiments, the first white screen detection module 12 may specifically include:
the page sampling sub-module is used for sampling the current page based on a preset sampling rule so as to obtain a preset number of target sampling points;
The sampling point judging sub-module is used for judging whether the preset number of target sampling points belong to the container nodes according to a preset container node judging rule;
a first sampling point result judging unit, configured to determine that a second preset detection termination condition is satisfied when it is determined that any one of the target sampling points does not belong to a container node;
And the second sampling point result judging unit is used for re-jumping to the step of sampling the current page based on the preset sampling rule when each sampling point is determined to belong to a container node so as to obtain a new preset number of target sampling points until the first preset detection termination condition or the second preset detection termination condition is met.
In some specific embodiments, the page sampling submodule may specifically include:
The coordinate system construction unit is used for constructing a corresponding virtual rectangular coordinate system by taking the geometric center of the current page as an origin;
and the sampling unit is used for respectively executing corresponding equal-division acquisition operation based on the virtual Y axis and the virtual X axis in the virtual rectangular coordinate system so as to obtain a preset number of target sampling points.
In some specific embodiments, the sampling point determining sub-module may specifically include:
The second judging unit is used for judging whether the web item to be detected contains the skeleton screen or not again based on the preset skeleton screen judging rule so as to obtain a corresponding second judging result;
And the sampling point judging unit is used for determining whether the preset number of target sampling points belong to container nodes or not by utilizing the root node identification information corresponding to the current page according to the second judging result.
In some specific embodiments, the first determining module 11 may specifically include:
Acquiring target parameter information sent by a project developer corresponding to a web project to be detected;
and the first judging unit is used for judging whether the web item to be detected contains a skeleton screen or not based on the target parameter information so as to obtain a corresponding first judging result.
Further, the embodiment of the present application further discloses an electronic device, and fig. 4 is a block diagram of an electronic device 20 according to an exemplary embodiment, where the content of the diagram is not to be considered as any limitation on the scope of use of the present application.
Fig. 4 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input output interface 25, and a communication bus 26. The memory 22 is configured to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the white screen detection method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in the present embodiment may be specifically an electronic computer.
In this embodiment, the power supply 23 is configured to provide an operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol to be followed is any communication protocol applicable to the technical solution of the present application, which is not specifically limited herein; the input/output interface 25 is used for acquiring external input data or outputting external output data, and the specific interface type thereof may be selected according to the specific application requirement, which is not limited herein.
The memory 22 may be a carrier for storing resources, such as a read-only memory, a random access memory, a magnetic disk, or an optical disk, and the resources stored thereon may include an operating system 221, a computer program 222, and the like, and the storage may be temporary storage or permanent storage.
The operating system 221 is used for managing and controlling various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, netware, unix, linux, etc. The computer program 222 may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the white screen detection method performed by the electronic device 20 disclosed in any of the previous embodiments.
Further, the application also discloses a computer readable storage medium for storing a computer program; wherein the computer program when executed by a processor implements the white screen detection method disclosed previously. For specific steps of the method, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and no further description is given here.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing has outlined rather broadly the more detailed description of the application in order that the detailed description of the application that follows may be better understood, and in order that the present principles and embodiments may be better understood; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.
Claims (8)
1. A white screen detection method, comprising:
judging whether a web item to be detected contains a skeleton screen or not based on a preset skeleton screen judging rule so as to obtain a corresponding first judging result;
If the first judging result shows that the web item to be detected contains a skeleton screen, sampling a current page by using a preset white screen detection rule in the process of loading the page for the web item to be detected, so as to finish corresponding first white screen detection operation and obtain a first white screen detection result;
If the first judging result indicates that the framework screen is not included, after the page loading is completed, sampling the current page based on the preset white screen detection rule to complete corresponding second white screen detection operation and obtain a second white screen detection result;
Taking the first white screen detection result or the second white screen detection result as a target white screen detection result corresponding to the web item to be detected, and executing corresponding white screen detection result output operation;
the method for sampling the current page by using the preset white screen detection rule comprises the following steps:
Sampling the current page based on a preset sampling rule to obtain a preset number of target sampling points;
judging whether the preset number of target sampling points belong to container nodes according to preset container node judging rules;
when any target sampling point is determined to be not in the container node, determining that a second preset detection termination condition is met;
when each sampling point is determined to belong to a container node, re-jumping to the step of sampling the current page based on a preset sampling rule to obtain a new preset number of target sampling points until a first preset detection termination condition or a second preset detection termination condition is met;
Judging whether the preset number of target sampling points belong to a container node according to a preset container node judging rule, including:
Judging whether the web item to be detected contains a skeleton screen or not again based on the preset skeleton screen judging rule so as to obtain a corresponding second judging result;
Determining whether the preset number of target sampling points belong to container nodes or not by utilizing root node identification information corresponding to the current page according to the second judging result; the root node identification information is corresponding ID information or class information;
determining whether the preset number of target sampling points belong to a container node according to the second judging result and judging whether the preset number of target sampling points belong to the container node by using root node identification information corresponding to the current page, including:
When the second judgment result is yes, acquiring the ID or class of the corresponding skeleton screen element, and judging whether the skeleton screen contains the ID or class of any target sampling point or not by comparing the ID or class of the skeleton screen element with the ID or class of any target sampling point;
If the skeleton screen contains an ID or class of any target sampling point, determining that the corresponding target sampling point belongs to a container node;
If not, the corresponding target sampling point does not belong to the container node.
2. The white screen detection method of claim 1, further comprising:
and in the process of executing the first white screen detection operation or the second white screen detection operation, judging whether a first preset detection termination condition is met or not currently based on a preset abnormal detection correction mechanism.
3. The white screen detection method according to claim 2, wherein the determining whether the first preset detection termination condition is currently satisfied based on the preset abnormality detection correction mechanism includes:
And judging whether the first preset detection termination condition is met or not currently based on a preset target detection timeout time node corresponding to the web item to be detected.
4. The white screen detection method according to claim 3, wherein the sampling the current page based on the preset sampling rule includes:
taking the geometric center of the current page as an origin, and constructing a corresponding virtual rectangular coordinate system;
And respectively executing corresponding equal-division acquisition operation based on a virtual Y axis and a virtual X axis in the virtual rectangular coordinate system so as to obtain a preset number of target sampling points.
5. The white screen detection method according to any one of claims 1 to 4, wherein the determining whether the web item to be detected includes the skeleton screen based on the preset skeleton screen determination rule, so as to obtain a corresponding first determination result, includes:
Acquiring target parameter information sent by a project developer corresponding to a web project to be detected;
and judging whether the web item to be detected contains a skeleton screen or not based on the target parameter information so as to obtain a corresponding first judgment result.
6. A white screen detection device, comprising:
The first judging module is used for judging whether the web item to be detected contains the skeleton screen or not based on a preset skeleton screen judging rule so as to obtain a corresponding first judging result;
the first white screen detection module is used for sampling a current page by utilizing a preset white screen detection rule in the process of loading the page aiming at the web item to be detected when the first judgment result shows that the skeleton screen is included, so as to finish corresponding first white screen detection operation and obtain a first white screen detection result;
The second white screen detection module is used for sampling the current page based on the preset white screen detection rule after the page loading is completed when the first judgment result indicates that the skeleton screen is not included, so as to complete corresponding second white screen detection operation and obtain a second white screen detection result;
the result output module is used for taking the first white screen detection result or the second white screen detection result as a target white screen detection result corresponding to the web item to be detected, and executing corresponding white screen detection result output operation;
Wherein, the first white screen detection module includes:
the page sampling sub-module is used for sampling the current page based on a preset sampling rule so as to obtain a preset number of target sampling points;
The sampling point judging sub-module is used for judging whether the preset number of target sampling points belong to the container nodes according to a preset container node judging rule;
a first sampling point result judging unit, configured to determine that a second preset detection termination condition is satisfied when it is determined that any one of the target sampling points does not belong to a container node;
The second sampling point result judging unit is used for re-jumping to the step of sampling the current page based on the preset sampling rule when each sampling point is determined to belong to a container node so as to obtain a new preset number of target sampling points until a first preset detection termination condition or a second preset detection termination condition is met;
the sampling point judging sub-module comprises:
The second judging unit is used for judging whether the web item to be detected contains the skeleton screen or not again based on the preset skeleton screen judging rule so as to obtain a corresponding second judging result;
The sampling point judging unit is used for determining whether the preset number of target sampling points belong to container nodes or not by utilizing the root node identification information corresponding to the current page according to the second judging result; the root node identification information is corresponding ID information or class information;
The sampling point judging unit is used for: when the second judgment result is yes, acquiring the ID or class of the corresponding skeleton screen element, and judging whether the skeleton screen contains the ID or class of any target sampling point or not by comparing the ID or class of the skeleton screen element with the ID or class of any target sampling point; if the skeleton screen contains an ID or class of any target sampling point, determining that the corresponding target sampling point belongs to a container node; if not, the corresponding target sampling point does not belong to the container node.
7. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the white screen detection method as claimed in any one of claims 1 to 5.
8. A computer readable storage medium for storing a computer program which, when executed by a processor, implements the white screen detection method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311254236.3A CN117667665B (en) | 2023-09-26 | 2023-09-26 | White screen detection method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311254236.3A CN117667665B (en) | 2023-09-26 | 2023-09-26 | White screen detection method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117667665A CN117667665A (en) | 2024-03-08 |
CN117667665B true CN117667665B (en) | 2024-07-05 |
Family
ID=90074099
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311254236.3A Active CN117667665B (en) | 2023-09-26 | 2023-09-26 | White screen detection method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117667665B (en) |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060129992A1 (en) * | 2004-11-10 | 2006-06-15 | Oberholtzer Brian K | Software test and performance monitoring system |
US20100251370A1 (en) * | 2009-03-26 | 2010-09-30 | Inventec Corporation | Network intrusion detection system |
US8561029B2 (en) * | 2009-09-30 | 2013-10-15 | Nec Laboratories America, Inc. | Precise thread-modular summarization of concurrent programs |
CN104050257A (en) * | 2014-06-13 | 2014-09-17 | 百度国际科技(深圳)有限公司 | Detection method and device for phishing webpage |
CN114610580A (en) * | 2022-03-17 | 2022-06-10 | 北京火山引擎科技有限公司 | Page white screen monitoring method, device, equipment and medium |
-
2023
- 2023-09-26 CN CN202311254236.3A patent/CN117667665B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN117667665A (en) | 2024-03-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107992427B (en) | Method, device and equipment for creating service test scene and storage medium thereof | |
US8256001B2 (en) | Managing add-ons | |
WO2020253066A1 (en) | Page management method and apparatus, and computer device and storage medium | |
US10860295B1 (en) | Automated detection of ambiguities in software design diagrams | |
CN104346279A (en) | Method and device for software testing | |
CN111309743A (en) | Report pushing method and device | |
CN117667665B (en) | White screen detection method, device, equipment and storage medium | |
CN110162982B (en) | Method and device for detecting illegal rights, storage medium and electronic equipment | |
CN110943887A (en) | Probe scheduling method, device, equipment and storage medium | |
CN115269254A (en) | Order abnormity determining method, device, equipment and medium | |
CN115935231A (en) | Data classification method, device, equipment and storage medium | |
CN110659096B (en) | Method, device, system and storage medium for displaying network topological graph | |
CN115329143A (en) | Directed acyclic graph evaluation method, device, equipment and storage medium | |
CN114185804A (en) | Interface testing method and device and terminal equipment | |
CN106802856A (en) | The performance test methods of game application, server and game application client | |
CN110780852A (en) | Method, device, equipment and medium for determining data source | |
CN115859926B (en) | Electronic form data relationship processing method and device, electronic equipment and medium | |
CN117610505B (en) | Data processing method and device based on standard model | |
EP4266171A1 (en) | System to identify and characterize code changes | |
CN112948209A (en) | Application program use result generation method and device, electronic equipment and storage medium | |
CN108108369A (en) | Common interface storehouse call error treating method and apparatus | |
CN116107875A (en) | Software testing method, device, equipment and storage medium | |
CN115480922A (en) | Resource information processing method, device, electronic equipment and storage medium | |
CN115373996A (en) | Automatic test method, device and equipment | |
CN115098391A (en) | Page detection method, device, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |