CN111045934A - Page analysis method, device, client, storage medium and electronic equipment - Google Patents

Page analysis method, device, client, storage medium and electronic equipment Download PDF

Info

Publication number
CN111045934A
CN111045934A CN201911203749.5A CN201911203749A CN111045934A CN 111045934 A CN111045934 A CN 111045934A CN 201911203749 A CN201911203749 A CN 201911203749A CN 111045934 A CN111045934 A CN 111045934A
Authority
CN
China
Prior art keywords
page
information
client
element information
test
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.)
Withdrawn
Application number
CN201911203749.5A
Other languages
Chinese (zh)
Inventor
董世杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN201911203749.5A priority Critical patent/CN111045934A/en
Publication of CN111045934A publication Critical patent/CN111045934A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure relates to a page analysis method, a page analysis device, a client, a storage medium and an electronic device. The method is applied to the server and comprises the following steps: receiving page element information of a currently displayed first page sent by a client, wherein the page element information comprises element style information; and generating a second page according to the page element information so as to analyze the first page based on the second page. Therefore, the server can restore the actual expression form of the first page currently shown by the client according to the second page generated by the page element information, so that the first page can be analyzed based on the second page, for example, whether the first page is abnormal or not and where the first page is abnormal can be analyzed through the second page. Therefore, the reliability of the analysis result is ensured, and each page does not need to be written with a test case for analysis, so that the page analysis cost is effectively reduced.

Description

Page analysis method, device, client, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of network technologies, and in particular, to a page analysis method, an apparatus, a client, a storage medium, and an electronic device.
Background
In the related art, before a website is released, a lot of testing work needs to be performed to analyze whether an abnormality exists in a User Interface (UI). In general, a technician needs to write a test case for each page, and analyze the page through the test case. However, on one hand, the expression form of the test case is obtained only by analyzing the test case, and the actual operation environment of the page is complex and diverse, the test case has certain limitation, and is difficult to cover all operation scenes, so that the actual expression form of the page on the user client cannot be reflected. On the other hand, if the corresponding test case is compiled for each page, the method is complicated, the implementation cost is high, and the efficiency of the whole test process is low.
Disclosure of Invention
The disclosure aims to provide a page analysis method, a page analysis device, a client, a storage medium and an electronic device, so as to solve the problems in the related art.
In order to achieve the above object, in a first aspect, the present disclosure provides a page analysis method applied to a server, where the method includes: receiving page element information of a currently displayed first page, which is sent by a client, wherein the page element information comprises element style information; and generating a second page according to the page element information so as to analyze the first page based on the second page.
According to the technical scheme, the page element information is directly captured and sent to the server through the client, so that the server can restore the actual expression form of the first page currently displayed by the client according to the second page generated by the page element information, and can directly reflect the real state of the first page displayed to the user by the client, so that the first page can be analyzed based on the second page, for example, whether the first page is abnormal or not and where the first page is abnormal can be analyzed through the second page. Therefore, the reliability of the analysis result is ensured, and each page does not need to be compiled with a test case for analysis, so that the page analysis cost is effectively reduced, the analysis flow is simplified, and the page analysis efficiency is improved.
Optionally, the method further comprises: testing the second page to determine whether the first page has a pattern abnormality; and/or outputting the second page.
With this alternative, automatic testing may be performed by the server at the time of testing, or manual testing may be performed by a technician.
Optionally, before receiving the page element information, the method further includes: receiving a page configuration information acquisition request sent by the client; and sending page configuration information to the client, so that the client determines whether to capture the page element information of the first page after displaying the first page according to the page configuration information.
Optionally, the page configuration information includes an address list of the test pages, test period information of each test page, fetch period information of each test page, and fetch probability information of each test page.
Optionally, the page configuration information obtaining request includes address information of the first page; the method further comprises the following steps: inquiring an address list of a test page according to the address information; and if the address information is contained in the address list and the current time is in the test time period aiming at the first page, sending page configuration information to the client, wherein the page configuration information comprises grabbing probability information aiming at the first page and grabbing time period information.
Optionally, the method further comprises: and if the number of times of receiving the page element information related to the first page in a preset period reaches a preset number, deleting the address information of the first page from an address list of a test page.
Through the alternative scheme, the sampling test can be realized by presetting the maximum grabbing times (namely the preset times) in the preset period, and the waste of network resources is avoided. And the address list is enabled to be dynamically updated according to the test times.
Optionally, the generating a second page according to the page element information includes: and generating the second page according to the characteristic information of the client and the page element information, wherein the page element information also comprises element content information.
Through the alternative scheme, the server can generate the second page according to the characteristic information and the page element information of the client, so that the generated second page is adaptive to the characteristic information of the client and better accords with the actual expression form of the first page, the real state of the first page is restored to the maximum extent, and a more reliable basis is provided for testing.
In a second aspect, the present disclosure provides a page analysis method applied to a client, where the method includes: under the condition that page element information of a first page displayed currently is determined to be grabbed, the page element information is grabbed, and the page element information comprises element style information; and sending the page element information to a server, so that the server generates a second page according to the page element information, and analyzing the first page based on the second page.
According to the technical scheme, the page element information is directly captured and sent to the server through the client, so that the server can restore the actual expression form of the first page currently displayed by the client according to the second page generated by the page element information, and can directly reflect the real state of the first page displayed to the user by the client, so that the first page can be analyzed based on the second page, for example, whether the first page is abnormal or not and where the first page is abnormal can be analyzed through the second page. Therefore, the reliability of the analysis result is ensured, and each page does not need to be compiled with a test case for analysis, so that the page analysis cost is effectively reduced, the analysis flow is simplified, and the page analysis efficiency is improved.
Optionally, before crawling the page element information, the method further includes: sending a page configuration information acquisition request to the server; receiving page configuration information sent by the server; and determining whether to capture the page element information of the first page after the first page is displayed according to the page configuration information.
Optionally, the page configuration information includes an address list of the test pages, test period information of each test page, capture period information of each test page, and capture probability information of each test page; the determining whether to capture the page element information of the first page after the first page is displayed according to the page configuration information includes: inquiring the address list according to the address information of the first page; generating a random number; and if the address information is contained in the address list, the current time is in the test time period aiming at the first page, and the random number is smaller than the grabbing probability aiming at the first page, the page element information is grabbed at the random time point in the grabbing time period aiming at the first page after the first page is displayed.
Through the alternative scheme, whether the page element information is captured or not is judged by the client, and when the current page access amount is large, the pressure of the server can be effectively relieved. And moreover, sampling grabbing and sampling testing can be realized, and the problem of network resource waste is effectively avoided. In addition, by setting the capturing period information, the client can capture the page element information at a random time point in the capturing period information, so that different clients capture different time points, more page states in the interaction process can be obtained, and the test diversity is improved.
Optionally, the page configuration information includes capture probability information and capture period information for the first page; the determining whether to capture the page element information of the first page after the first page is displayed according to the page configuration information includes: generating a random number; and if the random number is smaller than the grabbing probability information, determining that the page element information is grabbed at a random time point in the grabbing time period information after the first page is displayed.
By this alternative, the server first determines whether the address information of the first page is included in the address list and whether the current time is within the test period for the first page, which can take into account the processing efficiency of the server and the client. And moreover, sampling grabbing and sampling testing can be realized, and the problem of network resource waste is effectively avoided. In addition, by setting the capturing period information, the client can capture the page element information at a random time point in the capturing period information, so that different clients capture different time points, more page states in the interaction process can be obtained, and the test diversity is improved.
Optionally, the method further comprises: and under the condition that the client determines that the first page is abnormal, determining that page element information of the first page needs to be captured.
Through the alternative scheme, under the condition that the client determines that the first page is abnormal, the client can directly capture the page element information of the first page without being limited by parameters such as test time interval information, capture probability information and the like, and send the page element information to the server, the server generates the second page, and the abnormal position of the first page can be quickly positioned through the second page, so that the first page can be analyzed in real time.
Optionally, the method further comprises: and sending the characteristic information of the client to the server so that the server generates the second page according to the characteristic information and the page element information, wherein the page element information also comprises element content information.
In a third aspect, the present disclosure provides a page analysis apparatus applied to a server, where the apparatus includes: the first receiving module is used for receiving page element information of a first page which is currently displayed and sent by a client, wherein the page element information comprises element style information; and the page generating module is used for generating a second page according to the page element information so as to analyze the first page based on the second page.
Optionally, the apparatus further comprises: the test module is used for testing the second page to determine whether the first page has abnormal style; and/or the output module is used for outputting the second page.
Optionally, the first receiving module is further configured to receive a page configuration information obtaining request sent by the client before receiving the page element information; the device also comprises a first sending module used for sending page configuration information to the client so that the client can determine whether to grab the page element information of the first page after the first page is displayed according to the page configuration information.
Optionally, the page configuration information obtaining request includes address information of the first page; the device further comprises: the query module is used for querying an address list of the test page according to the address information; the first sending module is further configured to send page configuration information to the client if the address information is included in the address list and the current time is within a test period for the first page, where the page configuration information includes capture probability information and capture period information for the first page.
Optionally, the apparatus further comprises: and the deleting module is used for deleting the address information of the first page from an address list of the test page if the number of times of receiving the page element information of the first page in a preset period reaches a preset number.
Optionally, the page generating module includes: and the page generation submodule is used for generating the second page according to the characteristic information of the client and the page element information, and the page element information also comprises element content information.
In a fourth aspect, the present disclosure provides a client, comprising: the grabbing module is used for grabbing the page element information under the condition that the page element information of the first page displayed currently is grabbed, wherein the page element information comprises element style information; and the second sending module is used for sending the page element information to a server so that the server generates a second page according to the page element information, and the first page is analyzed based on the second page.
Optionally, the second sending module is further configured to send a request for obtaining page configuration information to the server before capturing the page element information; the client further comprises a second receiving module for receiving the page configuration information sent by the server; and the first determining module is used for determining whether to grab the page element information of the first page after the first page is displayed according to the page configuration information.
Optionally, the page configuration information includes an address list of the test pages, test period information of each test page, capture period information of each test page, and capture probability information of each test page; the first determining module includes: the query submodule is used for querying the address list according to the address information of the first page; the first random number generation submodule is used for generating a random number; a first determining submodule, configured to determine to capture the page element information at a random time point within a capture period for the first page after the first page is displayed, if the address information is included in the address list, a current time is within a test period for the first page, and the random number is smaller than the capture probability for the first page.
Optionally, the page configuration information includes capture probability information and capture period information for the first page; the first determining module includes: the second random number generation submodule is used for generating a random number; and the second determining submodule is used for determining to capture the page element information at a random time point in the capture time period information after the first page is displayed if the random number is smaller than the capture probability information.
Optionally, the client further includes: and the second determining module is used for determining that the page element information of the first page needs to be captured under the condition that the client determines that the first page is abnormal.
Optionally, the second sending module is further configured to: and sending the characteristic information of the client to the server so that the server generates the second page according to the characteristic information and the page element information, wherein the page element information also comprises element content information.
In a fifth aspect, the present disclosure provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method provided by the first aspect of the present disclosure.
In a sixth aspect, the present disclosure provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method provided by the second aspect of the present disclosure.
In a seventh aspect, the present disclosure provides an electronic device, comprising: a memory having a computer program stored thereon; a processor for executing the computer program in the memory to implement the steps of the method provided by the first aspect of the present disclosure.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
FIG. 1 is a schematic diagram illustrating one implementation environment in accordance with an example embodiment.
FIG. 2 is a flow diagram illustrating a method of page analysis in accordance with an exemplary embodiment.
FIG. 3 is a flowchart illustrating a method of page analysis in accordance with another exemplary embodiment.
FIG. 4 is a flowchart illustrating a method of page analysis in accordance with another exemplary embodiment.
Fig. 5 is a block diagram illustrating a page analysis apparatus according to an exemplary embodiment.
Fig. 6 is a block diagram illustrating a client according to another exemplary embodiment.
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
FIG. 1 is a schematic diagram illustrating one implementation environment in accordance with an example embodiment. As shown in FIG. 1, the implementation environment may include a server 101 and a client 102. The client 102 may be a Web browser, such as an IE browser, a Safari browser, a Chrome browser, a 360 browser, and the like, and may be configured to display a page to a user, and operate in an electronic device such as a mobile phone, a notebook computer, a desktop computer, and a platform computer. The server 101 and the client 102 are communicatively coupled, and may communicate in any manner, for example, 3G, 4G, 5G, NB-IOT, eMTC, LTE-a, near field communication, and the like.
FIG. 2 is a flow diagram illustrating a method of page analysis that may be applied to a server, such as server 101 shown in FIG. 1, in accordance with an exemplary embodiment. As shown in fig. 2, the method may include S201 and S202.
In S201, page element information of a currently displayed first page sent by a client is received.
Illustratively, what the client 102 currently presents to the user is a first page, which may be any page in a website. In the present disclosure, the client 102 may grab the page element information of the first page if it is determined to grab the page element information, where the elements in the page include, for example, a table, a button, a text box, and the like in the page. The page element information may include element style information, which may include style information of elements in the first page, such as information of HTML (hypertext markup language), CSS (cascading styles documents), and the like of the first page.
The manner in which the client 102 captures the page element information may refer to related technologies in the art. After capturing the page element information of the first page, the client 102 may send the page element information to the server 101.
In S202, a second page is generated according to the page element information.
After receiving the page element information sent by the client 102, the server 101 may generate a second page according to the page element information. Illustratively, the server 101 may generate the second page using, for example, a headless browser, an android simulator, or an iOS simulator, among others. In this disclosure, since the page element information is directly captured by the client 102 and sent to the server 101, the server 101 can restore the actual representation form of the first page currently displayed by the client 102 according to the second page generated by the page element information, so that the first page can be analyzed based on the second page, for example, whether and where the first page is abnormal is analyzed by the second page.
According to the technical scheme, the page element information is directly captured and sent to the server through the client, so that the server can restore the actual expression form of the first page currently displayed by the client according to the second page generated by the page element information, and can directly reflect the real state of the first page displayed to the user by the client, so that the first page can be analyzed based on the second page, for example, whether the first page is abnormal or not and where the first page is abnormal can be analyzed through the second page. Therefore, the reliability of the analysis result is ensured, and each page does not need to be compiled with a test case for analysis, so that the page analysis cost is effectively reduced, the analysis flow is simplified, and the page analysis efficiency is improved.
In the present disclosure, the second page generated by the server 101 may be tested to determine whether a style exception occurs in the first page, where the style exception may include, for example, an exception condition that a table in the page is not aligned, a format is disordered, and a content exceeds a normal range. During testing, automatic testing can be performed through the server 101, and manual testing can also be performed by technicians.
In an embodiment of the automated testing, the page analysis method applied to the server provided by the present disclosure may further include:
and testing the second page to determine whether the first page has a pattern exception.
For example, the server 101 may perform screenshot on the second page through a screenshot generating program to generate image data of the second page, and perform image similarity calculation on the image data of the second page and stored normal image data of the first page to obtain similarity information, where the similarity information may be represented in the form of a percentage, for example. If the similarity information is larger than or equal to a preset similarity threshold, the similarity between the image data of the second page and the normal image data of the first page is higher, and the first page is not abnormal in style; if the similarity information is smaller than the preset similarity threshold, it indicates that the similarity between the image data of the second page and the normal image data of the first page is low, and the first page may have abnormal style. The server 101 may further determine a position of the first page where the pattern abnormality occurs by image-comparing the image data of the second page with the normal image data of the first page. The similarity threshold may be calibrated in advance.
In an embodiment of manual testing, the server 101 may output the second page to a client used by a technician for manual testing by the technician to determine whether the first page is out of pattern.
In yet another embodiment, the server 101 may either automatically test the second page or output the second page for manual testing. For example, in the case that the automated test result of the server 101 indicates that the first page is abnormal, the second page-to-manual test may be output.
It can be understood that, due to the numerous users, there may be a great number of clients accessing the same page at the same time, however, the network resources are limited, the processing capacity of the device is also limited, and if each client performs a fetch operation and sends the fetch operation to the server 101, it is easy to waste resources and affect the performance of the device. Therefore, it is necessary to perform sampling grabbing and sampling testing, thereby avoiding resource waste.
FIG. 3 is a flowchart illustrating a method of page analysis in accordance with another exemplary embodiment. As shown in fig. 3, optionally, before S201, the page analysis method applied to the server provided by the present disclosure may further include S301 and S302.
In S301, a page configuration information acquisition request sent by a client is received.
In S302, the page configuration information is sent to the client.
In the present disclosure, the page configuration information may be set in advance and stored in the server 101. The client 102 may send a page configuration information obtaining request to the server 101 when requesting to access the first page. After receiving the acquisition request, the server 101 may send page configuration information to the client 102. After receiving the page configuration information sent by the server 101, the client 102 may determine whether to capture page element information of the first page after the first page is displayed according to the page configuration information.
In one embodiment, the page configuration information may include an address list of the test pages, test period information of each test page, fetch period information of each test page, and fetch probability information of each test page. The test period information, the grab period information, and the grab probability information may be the same or different for each page.
The address list of the test page may be a list composed of address information of pages currently to be tested, for example, the address list may include address information of the first page. The test period information may be a preset time period in which a certain page needs to be tested, for example, if the first page needs to be tested at 10 o 'clock to 11 o' clock, the test period information for the first page is 10 o 'clock to 11 o' clock.
The crawling period information refers to a period of time in which the client 102 may crawl page element information, and may be set according to a time that the user normally stays on the page, for example. Illustratively, the client 102 may grab the page element information at a random point in time between 1s-5s after the first page presentation is completed, e.g., the client 102 may grab at 2s, or grab at 3 s. Due to the randomness of the page and the user in the interaction process, for example, the time of some pop-ups appearing in the same page may be different, in the disclosure, by setting the capturing time period information, the client 102 may capture page element information at a random time point in the capturing time period information, so that different clients capture different time points, and thus, more page states in the interaction process can be obtained, and the test diversity is improved.
The grab probability information may be expressed in the form of a percentage, for example, the grab probability information of the first page may be set to 1%. For example, the client 102 may generate a random number, where a value range of the random number is (0, 1), and if the generated random number is smaller than the fetch probability information, it indicates that the page is hit within the fetch probability.
In this embodiment, the client 102 may first query the address list according to the address information of the first page, and determine whether the address information of the first page is included in the address list. If the address information of the first page is included in the address list, it indicates that the first page needs to be tested. The client 102 may find the test period information, the fetch probability information, and the fetch period information corresponding to the first page from the page configuration information. The client 102 may also generate a random number. If the client 102 determines that the current time is within the test time period for the first page and the random number is smaller than the capture probability for the first page, it is determined that the page element information is captured at a random time point within the capture time period for the first page after the first page is displayed.
In another embodiment, the page configuration information obtaining request sent by the client 102 to the server 101 may include address information of the first page. In this embodiment, the server 101 may first query the address list of the test page according to the address information to determine whether the address information is included in the address list. Therein, the address list of the test page has been explained above.
If the server 101 determines that the address information of the first page is included in the address list and the current time is within the test time period for the first page, it indicates that the first page needs to be tested currently, and then the server 101 sends page configuration information to the client 102. The page configuration information may include grab probability information and grab period information for the first page. After receiving the page configuration information, the client 102 may first generate a random number, and determine to capture page element information at a random time point within the capture period information after displaying the first page if the generated random number is smaller than the capture probability information for the first page.
Through the technical scheme, the problem of network resource waste can be effectively avoided through sampling grabbing and sampling testing. In the above two embodiments, the first embodiment is that the client 102 determines whether to grab the page element information, and in the second embodiment, the server 101 may first determine whether the address information of the first page is included in the address list and whether the current time is within the test period for the first page. It should be noted that one of the above two embodiments may be adopted as needed, for example, when the current page access amount is relatively large, the first embodiment may be adopted to reduce the stress of the server 101. Alternatively, the second embodiment may be adopted in order to achieve both the processing efficiency of the server 101 and the processing efficiency of the client 102.
The page analysis method applied to the server provided by the present disclosure may further include:
and if the number of times of receiving the page element information related to the first page reaches a preset number, deleting the address information of the first page from the address list of the test page.
For each page, the maximum capturing frequency (i.e., the preset frequency) within a preset period may be preset, where the preset period is, for example, one day. For example, for the first page, the maximum number of crawls per day may be set to 100, and after the server 101 receives page element information about the first page 100 times per day, the address information of the first page may be deleted from the address list of the test page, which indicates that the first page no longer needs to be tested today. In this way, the address list can be dynamically updated according to the test times.
Considering that the client 102 may also determine some abnormal situations of the first page, such as a logic code abnormal problem, during the process of presenting the first page by the client 102 itself. In order to ensure that the server 101 can analyze the page abnormality in real time, when the client 102 determines that the first page is abnormal, the client 102 can directly capture the page element information of the first page without being limited by parameters such as test time interval information and capture probability information, and send the page element information to the server 101, the server 101 generates a second page, and the position where the logic code abnormality occurs can be quickly located through the second page, which is beneficial to performing logic code abnormality analysis on the first page in real time.
In order to restore the actual representation of the first page to the maximum, in this disclosure, the above S202 may include:
and generating a second page according to the characteristic information of the client and the page element information.
The client 102 may send the feature information of the client 102 to the server 101, where the feature information may include, for example, version information (e.g., browser version such as IE, Safari, Chrome, etc.) of the client 102, window size, and other information. For example, the client 102 may transmit the feature information at the same time as transmitting the page element information to the server 101, or the client 102 may transmit the feature information after transmitting the page element information to the server 101.
In this way, the server 101 may generate the second page according to the feature information and the page element information of the client 102, so that the generated second page is adapted to the feature information of the client 102 and better conforms to the actual expression form of the first page, and the true state of the first page is restored to the maximum extent, thereby providing a more reliable basis for the test.
In addition, the page element information may further include element content information. Optionally, the client 102 may perform data desensitization processing on the element content information, where the data desensitization processing refers to performing data deformation on some sensitive information through a desensitization rule, so as to implement reliable protection of sensitive private data. Because whether the style of the page is abnormal is mainly judged when the page is tested, data desensitization treatment can be carried out on sensitive data, such as personal information of a user, such as an identity card number, a contact telephone, a residential address and the like, for example, all the numbers in the identity card number are replaced by 8 to ensure the safety of user information.
FIG. 4 is a flowchart illustrating a method of page analysis in accordance with another exemplary embodiment. The method may be applied to a client, such as client 102 shown in FIG. 1. As shown in fig. 4, the method may include S401 and S402.
In S401, in the case where it is determined that the page element information of the currently presented first page is crawled, the page element information is crawled. Wherein the page element information may include element style information.
In S402, the page element information is transmitted to the server. After the client sends the page element information to the server, the server can generate a second page according to the page element information, so that the first page can be analyzed based on the second page.
According to the technical scheme, the page element information is directly captured and sent to the server through the client, so that the server can restore the actual expression form of the first page currently displayed by the client according to the second page generated by the page element information, and can directly reflect the real state of the first page displayed to the user by the client, so that the first page can be analyzed based on the second page, for example, whether the first page is abnormal or not and where the first page is abnormal can be analyzed through the second page. Therefore, the reliability of the analysis result is ensured, and each page does not need to be compiled with a test case for analysis, so that the page analysis cost is effectively reduced, the analysis flow is simplified, and the page analysis efficiency is improved.
Optionally, before crawling the page element information, the method further includes: sending a page configuration information acquisition request to the server; receiving page configuration information sent by the server; and determining whether to capture the page element information of the first page after the first page is displayed according to the page configuration information.
Optionally, the page configuration information includes an address list of the test pages, test period information of each test page, capture period information of each test page, and capture probability information of each test page; the determining whether to capture the page element information of the first page after the first page is displayed according to the page configuration information includes: inquiring the address list according to the address information of the first page; generating a random number; and if the address information is contained in the address list, the current time is in the test time period aiming at the first page, and the random number is smaller than the grabbing probability aiming at the first page, the page element information is grabbed at the random time point in the grabbing time period aiming at the first page after the first page is displayed.
Optionally, the page configuration information includes capture probability information and capture period information for the first page; the determining whether to capture the page element information of the first page after the first page is displayed according to the page configuration information includes: generating a random number; and if the random number is smaller than the grabbing probability information, determining that the page element information is grabbed at a random time point in the grabbing time period information after the first page is displayed.
Optionally, the method further comprises: and under the condition that the client determines that the first page is abnormal, determining that page element information of the first page needs to be captured.
Optionally, the method further comprises: and sending the characteristic information of the client to the server so that the server generates the second page according to the characteristic information and the page element information, wherein the page element information also comprises element content information.
With regard to the method in the above embodiment, the specific implementation manner of each step has been described in detail in the embodiment of the server-side method, and will not be elaborated here.
Fig. 5 is a block diagram illustrating a page analysis apparatus according to an exemplary embodiment, where the apparatus may be applied to a server, such as the server 101 shown in fig. 1, and as shown in fig. 5, the apparatus 500 may include: a first receiving module 501, configured to receive page element information of a currently displayed first page sent by a client, where the page element information includes element style information; a page generating module 502, configured to generate a second page according to the page element information, so as to analyze the first page based on the second page.
Optionally, the apparatus 500 may further include: the test module is used for testing the second page to determine whether the first page has abnormal style; and/or the output module is used for outputting the second page.
Optionally, the first receiving module 501 may be further configured to receive a page configuration information obtaining request sent by the client before receiving the page element information; the apparatus 500 may further include a first sending module, configured to send page configuration information to the client, so that the client determines, according to the page configuration information, whether to grab the page element information of the first page after the first page is displayed.
Optionally, the page configuration information obtaining request includes address information of the first page; the apparatus 500 may further include: the query module is used for querying an address list of the test page according to the address information; the first sending module is further configured to send page configuration information to the client if the address information is included in the address list and the current time is within a test period for the first page, where the page configuration information includes capture probability information and capture period information for the first page.
Optionally, the apparatus 500 may further include: and the deleting module is used for deleting the address information of the first page from an address list of the test page if the number of times of receiving the page element information of the first page in a preset period reaches a preset number.
Optionally, the page generating module 502 may include: and the page generation submodule is used for generating the second page according to the characteristic information of the client and the page element information, and the page element information also comprises element content information.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 6 is a block diagram illustrating a client according to another exemplary embodiment, and as shown in fig. 6, the client 600 may include: the grabbing module 601 is configured to grab page element information of a currently displayed first page under the condition that the page element information is determined to be grabbed, where the page element information includes element style information; a second sending module 602, configured to send the page element information to a server, so that the server generates a second page according to the page element information, so as to analyze the first page based on the second page.
Optionally, the second sending module 602 may be further configured to send a request for obtaining page configuration information to the server before capturing the page element information; the client 600 may further include a second receiving module, configured to receive the page configuration information sent by the server; and the first determining module is used for determining whether to grab the page element information of the first page after the first page is displayed according to the page configuration information.
Optionally, the page configuration information includes an address list of the test pages, test period information of each test page, capture period information of each test page, and capture probability information of each test page; the first determining module may include: the query submodule is used for querying the address list according to the address information of the first page; the first random number generation submodule is used for generating a random number; a first determining submodule, configured to determine to capture the page element information at a random time point within a capture period for the first page after the first page is displayed, if the address information is included in the address list, a current time is within a test period for the first page, and the random number is smaller than the capture probability for the first page.
Optionally, the page configuration information includes capture probability information and capture period information for the first page; the first determining module may include: the second random number generation submodule is used for generating a random number; and the second determining submodule is used for determining to capture the page element information at a random time point in the capture time period information after the first page is displayed if the random number is smaller than the capture probability information.
Optionally, the client 600 may further include: and the second determining module is used for determining that the page element information of the first page needs to be captured under the condition that the client determines that the first page is abnormal.
Optionally, the second sending module 602 may be further configured to: and sending the characteristic information of the client to the server so that the server generates the second page according to the characteristic information and the page element information, wherein the page element information also comprises element content information.
With regard to the client in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 7 is a block diagram illustrating an electronic device 700 in accordance with an example embodiment. For example, the electronic device 700 may be provided as a server, such as the server 101 shown in fig. 1. Referring to fig. 7, an electronic device 700 includes a processor 722, which may be one or more in number, and a memory 732 for storing computer programs that are executable by the processor 722. The computer programs stored in memory 732 may include one or more modules that each correspond to a set of instructions. Further, the processor 722 may be configured to execute the computer program to perform the page analysis method applied to the server described above.
Additionally, the electronic device 700 may also include a power component 726 that may be configured to perform power management of the electronic device 700 and a communication component 750 that may be configured to enable communication, e.g., wired or wireless communication, of the electronic device 700. The electronic device 700 may also include input/output (I/O) interfaces 758. The electronic device 700 may operate based on an operating system stored in memory 732, such as Windows Server, Mac OSXTM, UnixTM, LinuxTM, and the like.
In another exemplary embodiment, there is also provided a computer readable storage medium including program instructions, which when executed by a processor, implement the steps of the above-described page analysis method applied to a server. For example, the computer readable storage medium may be the memory 732 described above including program instructions that are executable by the processor 722 of the electronic device 700 to perform the page analysis method described above as applied to a server.
In another exemplary embodiment, a computer program product is also provided, which comprises a computer program executable by a programmable apparatus, the computer program having code portions for performing the above-mentioned page analysis method applied to a server when executed by the programmable apparatus.
In another exemplary embodiment, there is also provided a computer readable storage medium including program instructions which, when executed by a processor, implement the steps of the page analysis method applied to a client described above.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that, in the foregoing embodiments, various features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various combinations that are possible in the present disclosure are not described again.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (17)

1. A page analysis method is applied to a server, and the method comprises the following steps:
receiving page element information of a currently displayed first page, which is sent by a client, wherein the page element information comprises element style information;
and generating a second page according to the page element information so as to analyze the first page based on the second page.
2. The method of claim 1, further comprising:
testing the second page to determine whether the first page has a pattern abnormality;
and/or outputting the second page.
3. The method of claim 1, wherein prior to receiving the page element information, the method further comprises:
receiving a page configuration information acquisition request sent by the client;
and sending page configuration information to the client, so that the client determines whether to capture the page element information of the first page after displaying the first page according to the page configuration information.
4. The method of claim 3, wherein the page configuration information comprises an address list of test pages, test period information for each test page, fetch period information for each test page, and fetch probability information for each test page.
5. The method according to claim 3, wherein the page configuration information acquisition request includes address information of the first page; the method further comprises the following steps:
inquiring an address list of a test page according to the address information;
and if the address information is contained in the address list and the current time is in the test time period aiming at the first page, sending page configuration information to the client, wherein the page configuration information comprises grabbing probability information aiming at the first page and grabbing time period information.
6. The method according to any one of claims 1-5, further comprising:
and if the number of times of receiving the page element information related to the first page in a preset period reaches a preset number, deleting the address information of the first page from an address list of a test page.
7. The method according to any of claims 1-5, wherein said generating a second page according to said page element information comprises:
and generating the second page according to the characteristic information of the client and the page element information, wherein the page element information also comprises element content information.
8. A page analysis method is applied to a client, and the method comprises the following steps:
under the condition that page element information of a first page displayed currently is determined to be grabbed, the page element information is grabbed, and the page element information comprises element style information;
and sending the page element information to a server, so that the server generates a second page according to the page element information, and analyzing the first page based on the second page.
9. The method of claim 8, wherein prior to crawling the page element information, the method further comprises:
sending a page configuration information acquisition request to the server;
receiving page configuration information sent by the server;
and determining whether to capture the page element information of the first page after the first page is displayed according to the page configuration information.
10. The method of claim 9, wherein the page configuration information comprises an address list of test pages, test period information of each test page, fetch period information of each test page, and fetch probability information of each test page;
the determining whether to capture the page element information of the first page after the first page is displayed according to the page configuration information includes:
inquiring the address list according to the address information of the first page;
generating a random number;
and if the address information is contained in the address list, the current time is in the test time period aiming at the first page, and the random number is smaller than the grabbing probability aiming at the first page, the page element information is grabbed at the random time point in the grabbing time period aiming at the first page after the first page is displayed.
11. The method of claim 9, wherein the page configuration information comprises crawling probability information and crawling period information for the first page;
the determining whether to capture the page element information of the first page after the first page is displayed according to the page configuration information includes:
generating a random number;
and if the random number is smaller than the grabbing probability information, determining that the page element information is grabbed at a random time point in the grabbing time period information after the first page is displayed.
12. The method of claim 9, further comprising:
and under the condition that the client determines that the first page is abnormal, determining that page element information of the first page needs to be captured.
13. The method according to any one of claims 8-12, further comprising:
and sending the characteristic information of the client to the server so that the server generates the second page according to the characteristic information and the page element information, wherein the page element information also comprises element content information.
14. A page analysis device applied to a server, the device comprising:
the first receiving module is used for receiving page element information of a first page which is currently displayed and sent by a client, wherein the page element information comprises element style information;
and the page generating module is used for generating a second page according to the page element information so as to analyze the first page based on the second page.
15. A client, comprising:
the grabbing module is used for grabbing the page element information under the condition that the page element information of the first page displayed currently is grabbed, wherein the page element information comprises element style information;
and the second sending module is used for sending the page element information to a server so that the server generates a second page according to the page element information, and the first page is analyzed based on the second page.
16. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 13.
17. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to carry out the steps of the method of any one of claims 1 to 7.
CN201911203749.5A 2019-11-29 2019-11-29 Page analysis method, device, client, storage medium and electronic equipment Withdrawn CN111045934A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911203749.5A CN111045934A (en) 2019-11-29 2019-11-29 Page analysis method, device, client, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911203749.5A CN111045934A (en) 2019-11-29 2019-11-29 Page analysis method, device, client, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN111045934A true CN111045934A (en) 2020-04-21

Family

ID=70234212

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911203749.5A Withdrawn CN111045934A (en) 2019-11-29 2019-11-29 Page analysis method, device, client, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111045934A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111666513A (en) * 2020-04-23 2020-09-15 北京三快在线科技有限公司 Page processing method and device, electronic equipment and readable storage medium
CN112835793A (en) * 2021-01-29 2021-05-25 杭州朗和科技有限公司 Webpage debugging method and device
CN112965944A (en) * 2021-02-24 2021-06-15 携程计算机技术(上海)有限公司 Visual page restoration method and system, electronic device and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010122228A1 (en) * 2009-04-22 2010-10-28 Ip Networks Oy Testing apparatus and method
CN103729285A (en) * 2012-10-11 2014-04-16 腾讯科技(深圳)有限公司 Method, device and system for testing web page
CN107122301A (en) * 2017-04-27 2017-09-01 武汉斗鱼网络科技有限公司 Interface detection method and device
CN107133180A (en) * 2017-06-07 2017-09-05 腾讯科技(深圳)有限公司 Method of testing, test device and the storage medium of dynamic page
CN108804318A (en) * 2018-05-24 2018-11-13 北京金山安全软件有限公司 Page element testing method and device, electronic equipment and storage medium
CN108829885A (en) * 2018-06-27 2018-11-16 珠海市君天电子科技有限公司 Page generation method, device, server, electronic equipment and storage medium
WO2019196274A1 (en) * 2018-04-10 2019-10-17 平安科技(深圳)有限公司 Web page testing method and apparatus, electronic device, and medium
CN110399291A (en) * 2019-06-20 2019-11-01 平安普惠企业管理有限公司 User Page test method and relevant device based on image recognition

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010122228A1 (en) * 2009-04-22 2010-10-28 Ip Networks Oy Testing apparatus and method
CN103729285A (en) * 2012-10-11 2014-04-16 腾讯科技(深圳)有限公司 Method, device and system for testing web page
CN107122301A (en) * 2017-04-27 2017-09-01 武汉斗鱼网络科技有限公司 Interface detection method and device
CN107133180A (en) * 2017-06-07 2017-09-05 腾讯科技(深圳)有限公司 Method of testing, test device and the storage medium of dynamic page
WO2019196274A1 (en) * 2018-04-10 2019-10-17 平安科技(深圳)有限公司 Web page testing method and apparatus, electronic device, and medium
CN108804318A (en) * 2018-05-24 2018-11-13 北京金山安全软件有限公司 Page element testing method and device, electronic equipment and storage medium
CN108829885A (en) * 2018-06-27 2018-11-16 珠海市君天电子科技有限公司 Page generation method, device, server, electronic equipment and storage medium
CN110399291A (en) * 2019-06-20 2019-11-01 平安普惠企业管理有限公司 User Page test method and relevant device based on image recognition

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111666513A (en) * 2020-04-23 2020-09-15 北京三快在线科技有限公司 Page processing method and device, electronic equipment and readable storage medium
CN112835793A (en) * 2021-01-29 2021-05-25 杭州朗和科技有限公司 Webpage debugging method and device
CN112965944A (en) * 2021-02-24 2021-06-15 携程计算机技术(上海)有限公司 Visual page restoration method and system, electronic device and storage medium
CN112965944B (en) * 2021-02-24 2023-09-19 携程计算机技术(上海)有限公司 Visual page restoration method and system, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107133180B (en) Dynamic page testing method, testing device and storage medium
EP3324325B1 (en) Method, client, and system for testing application
CN106484611B (en) Fuzzy test method and device based on automatic protocol adaptation
CN111813701B (en) HTTP-based interface testing method and device, computer equipment and storage medium
CN111506917A (en) Page display method, display device, readable storage medium and electronic equipment
CN112597020A (en) Interface testing method and device, computer equipment and storage medium
US8838094B2 (en) Acquiring information from volatile memory of a mobile device
WO2023168926A1 (en) Method and apparatus for determining software anomaly, storage medium, and electronic apparatus
CN111177623A (en) Information processing method and device
CN111045934A (en) Page analysis method, device, client, storage medium and electronic equipment
CN108427639B (en) Automated testing method, application server and computer readable storage medium
JP5112401B2 (en) Web action history acquisition system, Web action history acquisition method, gateway device, and program
US9571557B2 (en) Script caching method and information processing device utilizing the same
CN107888451B (en) Method and device for testing Web server
CN110677447B (en) User stay time length determining method, device, equipment and storage medium
CN107766224B (en) Test method and test device
CN112087455A (en) Method, system, equipment and medium for generating WAF site protection rule
CN110825603A (en) Page first loading time determining method and device, electronic equipment and storage medium
CN108255672B (en) Data verification method and device, storage medium and electronic equipment
CN113282511B (en) Test method and test equipment
CN112817816B (en) Embedded point processing method and device, computer equipment and storage medium
CN111782291B (en) Method and device for starting test page
EP2477380A1 (en) Apparatus and method for providing and executing content
CN110222846B (en) Information security method and information security system for internet terminal
CN112597019A (en) Front-end code debugging method, device, system 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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20200421