CN109766256B - Method and device for testing H5 page performance in application program and computer equipment - Google Patents

Method and device for testing H5 page performance in application program and computer equipment Download PDF

Info

Publication number
CN109766256B
CN109766256B CN201811572820.2A CN201811572820A CN109766256B CN 109766256 B CN109766256 B CN 109766256B CN 201811572820 A CN201811572820 A CN 201811572820A CN 109766256 B CN109766256 B CN 109766256B
Authority
CN
China
Prior art keywords
page
test
data
instruction
test terminal
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
Application number
CN201811572820.2A
Other languages
Chinese (zh)
Other versions
CN109766256A (en
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.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN201811572820.2A priority Critical patent/CN109766256B/en
Publication of CN109766256A publication Critical patent/CN109766256A/en
Application granted granted Critical
Publication of CN109766256B publication Critical patent/CN109766256B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application relates to a method and a device for testing H5 page performance in an application program, computer equipment and a storage medium. The method comprises the following steps: the method comprises the steps of obtaining an address of an H5 page to be tested of an application program to be tested, generating a test instruction of the H5 page, sending the test instruction to a test terminal, wherein the test instruction is used for indicating the test terminal to open the H5 page of the test terminal, calling a packet capturing interface, opening a packet capturing program of the test terminal, obtaining various time-consuming data of key events preset in the H5 page during loading, obtaining a packet capturing file of the packet capturing program and a log file of the application program to be tested, and obtaining a performance test result of the H5 page according to the packet capturing file, the log file and the various time-consuming data. According to the method, the H5 page of the application program is opened at the test terminal, the truest performance data is obtained, the truest test data is ensured to be obtained, the accuracy of the test data is ensured, and meanwhile, the H5 page performance can be comprehensively evaluated according to the packet capturing file, various time-consuming data and the log file.

Description

Method and device for testing H5 page performance in application program and computer equipment
Technical Field
The present application relates to the field of page monitoring technologies, and in particular, to a method and an apparatus for testing performance of an H5 page in an application program, a computer device, and a storage medium.
Background
With the rapid development of the internet and the mobile terminal devices, users have higher and higher requirements on the webpage loading speed when viewing the webpage by using the mobile terminal. Therefore, when an application is released, the performance test of the H5 page of the application is particularly important.
In a conventional test method, the performance of an H5 page is evaluated through relevant performance data such as network communication traffic. The method has single testing dimension and cannot comprehensively evaluate the performance of the H5 page.
Disclosure of Invention
In view of the above, there is a need to provide a method, an apparatus, a computer device and a storage medium for testing H5 page performance in an application program, which can comprehensively evaluate the H5 page performance.
A method for testing the performance of an H5 page in an application program comprises the following steps:
acquiring an address of an H5 page to be tested of an application program to be tested, and generating a test instruction for the H5 page;
sending the test instruction to a test terminal, wherein the test instruction is used for indicating the test terminal to open the H5 page of the test terminal;
calling a packet capturing interface, and opening a packet capturing program of the test terminal;
acquiring various time-consuming data of preset key events during loading of the H5 page;
acquiring a packet capturing file of the packet capturing program and a log file of the application program to be tested;
and obtaining a performance test result of the H5 page according to the packet capturing file, the log file and various time-consuming data.
In another embodiment, the step of obtaining various types of time-consuming data of a preset key event during loading of the H5 page includes:
receiving buried point information of the browsing control of the H5 page during loading;
acquiring a starting time point and an ending time point of a preset key event in the H5 page loading process according to the embedded point information;
and acquiring various types of time-consuming data corresponding to the preset key events according to the time difference between the starting time point and the ending time point of the preset key events.
In another embodiment, the step of obtaining a start time point and an end time point of a preset key event in the H5 page loading process according to the buried point information includes:
when the embedded point information is received, calling a test terminal, and capturing a time point screenshot of a preset key event in the H5 page loading process;
and determining the name, the starting time point and the ending time point of the preset key event according to the information content of the embedded point and each time point of the screenshot.
In another embodiment, the step of obtaining the performance test result of the H5 page according to the package capture file, the log file and various types of time-consuming data includes:
acquiring resource flow data and http request data according to the packet capturing file and the log file;
and evaluating the page performance of the H5 page according to the various time-consuming data, the resource flow data and the http request data to obtain a performance test result of the H5 page.
In another embodiment, before the step of sending the test instruction to the test terminal, the method further includes:
sending an unloading instruction to the test terminal according to the test instruction, wherein the unloading instruction is used for instructing the test terminal to unload the application program to be tested;
cleaning the log data of the application program to be tested;
and sending an installation instruction to the test terminal, wherein the installation instruction is used for indicating the test terminal to install the application program to be tested.
In another embodiment, the method further comprises:
receiving a report generation request for an H5 page to be tested;
and calling a graph tool, and generating a visual H5 page performance detection report according to various time-consuming data, resource flow data and http request data of the H5 page.
An apparatus for testing performance of an H5 page in an application, the apparatus comprising:
the test instruction acquisition module is used for acquiring the address of the H5 page to be tested of the application program to be tested and generating a test instruction for the H5 page;
the instruction sending module is used for sending the test instruction to a test terminal, and the test instruction is used for indicating the test terminal to open the H5 page of the test terminal;
the packet capturing processing module is used for calling a packet capturing interface and opening a packet capturing program of the test terminal;
the time consumption acquisition module is used for acquiring various time consumption data of preset key events during loading of the H5 page;
the data acquisition module is used for acquiring a packet capturing file of the packet capturing program and a log file of the application program to be detected;
and the performance evaluation module is used for obtaining a performance test result of the H5 page according to the packet capturing file, the log file and various time-consuming data.
In another embodiment, the time-consuming acquisition module comprises:
the embedded point acquisition module is used for receiving embedded point information of the browsing control of the H5 page during loading;
the time acquisition module is used for acquiring a starting time point and an ending time point of a preset key event in the H5 page loading process according to the embedded point information;
and the calculating module is used for acquiring various types of time-consuming data corresponding to the preset key events according to the time difference between the starting time point and the ending time point of the preset key events.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the method of any of the embodiments described above when the computer program is executed.
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 of any of the preceding embodiments
According to the method and device for testing the performance of the H5 page in the application program, the computer equipment and the storage medium, the packet capturing program of the testing terminal is utilized to obtain the packet capturing file in the loading process of the H5 page to be tested, obtain various time-consuming data and log files in the loading process of the H5 page, and obtain the performance testing result according to the packet capturing file, the various time-consuming data and the log files. According to the method, the H5 page of the application program is opened at the test terminal, the truest performance data is obtained, the truest test data is ensured to be obtained, the accuracy of the test data is ensured, and meanwhile, the H5 page performance can be comprehensively evaluated according to the packet capturing file, various time-consuming data and the log file.
Drawings
FIG. 1 is a diagram illustrating an application scenario of a method for testing H5 page performance in an application program according to an embodiment;
FIG. 2 is a flowchart illustrating a method for testing H5 page performance in an application according to an embodiment;
FIG. 3 is a block diagram of an apparatus for H5 page performance testing in an application according to an embodiment;
FIG. 4 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The H5 page performance testing method in the application program can be applied to the application environment shown in FIG. 1. The test host 102 is connected to the test terminal 104, and the specific connection mode may be USB or other network connection. The method comprises the steps that a test host acquires an address of an H5 page of an application program to be tested, generates a test instruction of the H5 page, sends the test instruction to a test terminal, the test instruction is used for indicating the test terminal to open the H5 page of the test terminal, calls a packet capturing interface, opens a packet capturing program of the test terminal, acquires various time-consuming data of the H5 page during loading, acquires a packet capturing file of the packet capturing program and a log file of the application program to be tested, and obtains a performance test result of the H5 page according to the packet capturing file, the log file and the various time-consuming data. The test host and the test terminal may be, but are not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
In an embodiment, as shown in fig. 2, a method for testing performance of an H5 page in an application program is provided, which is described by taking an example that the method is applied to a test host in fig. 1, and includes the following steps:
s202, acquiring the address of the H5 page to be tested of the application program to be tested, and generating a test instruction for the H5 page.
Specifically, the test host configures test related information including information of the test terminal, information of the application to be tested, and information of the H5 page to be tested through the test configuration page. The information of the test terminal includes the name, IP address, communication port, etc. of the test terminal. The information of the application program to be tested comprises the name of the application software to be tested. The information of the H5 page to be tested comprises the address of the H5 page to be tested.
And configuring the address of the H5 page to be tested of the application program to be tested through the test configuration page at the test host, and generating a test instruction for the H5 page.
And S204, sending a test instruction to the test terminal, and opening the H5 page of the test terminal, wherein the test instruction is used for indicating the test terminal to open the H5 page of the test terminal.
Specifically, the test host communicates with the test terminal, sends the test instruction to the test terminal, and the test terminal calls the application program to be tested according to the address of the H5 page to be tested of the application program to be tested in the test instruction, and opens the address of the H5 page to be tested of the application program to be tested.
And S206, calling a packet capturing interface and opening a packet capturing program of the test terminal.
The packet capturing program is installed in the test terminal, and the packet capturing program refers to a tool capable of performing operations such as interception, retransmission, editing, unloading and the like on data packets transmitted and received by the network of the test terminal, for example, a Fiddler packet capturing program. Through the packet capturing program, the flow data and HTTP request data spent by requesting page resources can be acquired.
S208, various time-consuming data of preset key events of the H5 page during loading are obtained.
The preset key event refers to a key event indicating the page performance in the loading process of the page, and the category of the preset key event can be preset according to the performance test requirement, such as a Dom event, a white screen event, a loading start event, a loading end event and the like of the loaded page. Time consuming data is a critical part of the performance of H5 pages. In one embodiment, the buried dots are pre-implanted in the H5 page. Embedding a point, namely embedding a script program in an H5 page of an application degree in advance, and automatically reporting data to a test host when preset key time is triggered in the loading process of the H5 page. And analyzing the reported data by receiving the reported data of the embedded points to obtain various time-consuming data of the H5 page during loading.
S210, acquiring a packet capturing file of the packet capturing program and a log file of the application program to be tested.
The packet capturing file is a data packet which is transmitted and received by a test terminal through network transmission in the loading process of the H5 page of the packet capturing program. The data packet includes the serial number, time, source and destination MAC address, source and destination IP address, protocol type, source and destination port number, etc. of the data packet. The log file is generated in the test execution process of the application program to be tested. And flow data and HTTP request data in the H5 page loading process can be acquired according to the packet capturing file and the log file.
And S212, obtaining a performance test result of the H5 page according to the packet capturing file, the log file and various time-consuming data.
Specifically, the packet capturing file, the log file and various time-consuming data are analyzed to obtain data required by the performance test. The data required by the performance test can be pre-configured, the source of the required data and the keywords are configured, and after the packet capturing file, the log file and various time-consuming data are obtained, the keywords are utilized to analyze the data from the corresponding source to obtain the required performance test data. For example, the packet capturing file and the log file are analyzed, the flow data spent by the page request can be obtained, the time-consuming data can be analyzed, and the time data spent by the white screen, the LOAD loading and the like in the H5 page loading process can be obtained.
In one embodiment, the data required for the performance test may include time data, resource size data, file compression data, transmission compression data, domain name number data, total request number data, HTTP header data, HTTP return code data, and the like. Time data such as white screen time, dom load time, resource load time, etc. The resource size data includes the size of a single resource in the H5 page. The file compression data includes information data on whether the resource file is compressed. The transmission compressed data comprises compressed data in response packet headers such as JS and pictures, the domain name number data comprises the number of domain names involved in one page, and the total request number comprises the number of total requests of one page. The HTTP header data includes whether or not a large amount of useless HTTP header information is included in the request, and the like.
According to the H5 page performance testing method in the application program, the packet capturing program of the testing terminal is utilized to obtain the packet capturing file in the loading process of the H5 page to be tested, obtain various time-consuming data and log files in the loading process of the H5 page, and obtain the performance testing result according to the packet capturing file, the various time-consuming data and the log files. According to the method, the H5 page of the application program is opened at the test terminal, the truest performance data is obtained, the truest test data is ensured to be obtained, the accuracy of the test data is ensured, and meanwhile, the H5 page performance can be comprehensively evaluated according to the packet capturing file, various time-consuming data and the log file.
In another embodiment, the step of obtaining various types of time-consuming data of preset key events during loading of the H5 page includes: receiving buried point information of a browsing control of an H5 page during loading, acquiring a starting time point and an ending time point of a preset key event in the H5 page loading process according to the buried point information, and acquiring various time-consuming data corresponding to each preset key event according to a time difference between the starting time point and the ending time point of the preset key event.
Specifically, the browsing control (webview) is a control for displaying a web page based on a webkit engine, and can simulate real operation of a user by opening a to-be-tested H5 page of a to-be-tested application program of the test terminal, so as to ensure that real data is obtained. The embedded point is a certain preset key event inserting script for webview of an H5 page, when the key events are triggered, a test program reports data to a test host, the test host acquires a starting time point and a result time point of the preset key event when the H5 page is obtained, and the time difference between the starting time point and the ending time point of the preset key event is determined. The type of the preset key event is determined according to the buried point information. The key events are, for example, a Dom event for loading a page, a load start event, and a load end event.
In another embodiment, the step of obtaining a start time point and an end time point of a preset key event in the H5 page loading process according to the buried point information includes: and when the embedded point information is received, calling the test terminal, presetting a time point screenshot of a key event in the H5 page loading process, and determining the name, the starting time point and the ending time point of the preset key event according to the embedded point information content and each time point of the screenshot.
Specifically, the test terminal can know the loading condition of the H5 page according to the embedded point information, when the embedded point information is obtained, a screenshot instruction is generated, the screenshot instruction is communicated with the test terminal, the test terminal is called to capture a current H5 page screenshot, and current screenshot information is obtained, wherein the current screenshot information comprises picture information, the embedded point information and time information. The picture information can be used for the staff to check the problems by combining with the log data. And determining the name, the starting time point and the ending time point of the preset key event according to the buried point information and each time point of the screenshot.
In the embodiment, the comparison of the time data is obtained by using the embedded point information of the browsing control during loading and the screenshot method, and the time data counted by event callback of webview is reliable and accurate.
In another embodiment, the step of obtaining the performance test result of the H5 page according to the package capture file, the log file and various types of time-consuming data includes: and acquiring resource flow data and http request data according to the packet capturing file and the log file, and evaluating the page performance of the H5 page according to various time-consuming data, the resource flow data and the http request data to obtain a performance test result of the H5 page.
In the embodiment, besides the resource flow data and the http request data, various time-consuming data of the H5 page to be tested are generated, so that the H5 page performance can be comprehensively evaluated.
Specifically, a reference threshold value of each item of data may be set, and each item of test data obtained by the test is compared with the reference threshold value to obtain a performance test result of the H5 page.
In another embodiment, before the step of sending a test instruction to the test terminal, the step of instructing the test terminal to open an H5 page of the test terminal further includes: and sending an unloading instruction to the test terminal according to the test instruction, wherein the unloading instruction is used for instructing the test terminal to unload the application program to be tested, cleaning log data of the application program to be tested, and sending an installation instruction to the test terminal, and the installation instruction is used for instructing the test terminal to install the application program to be tested.
Specifically, after the test instruction is received, in order to avoid that the current data is interfered by the previous test data, before the current test is executed, the to-be-tested application installed on the test terminal is uninstalled, the log data of the to-be-tested application is cleaned, and the to-be-tested application is reinstalled, so that the accuracy of the test data is ensured.
In another embodiment, the method for testing the performance of the H5 page in the application program further includes: receiving a report generation request of the H5 page to be detected, calling a diagram tool, and generating a visual H5 page performance detection report according to various time-consuming data, resource flow data and http request data of the H5 page.
Specifically, after obtaining the time quantization data, the resource flow data, and the http request data of the H5 page, a configuration report generation instruction is configured on the configuration page, where the instruction may include the requested H5 page, and may be one page, or multiple pages, or may be a comparison of data of multiple pages. Specifically, a report generation request for an H5 page to be detected is received, and a visual H5 page performance detection report is generated according to various time-consuming data, resource flow data and http request data of the H5 page. By generating the detection report, various time-consuming data, http request waterfall flow, resource flow, page screenshot, ADB log and the like in the H5 test process can be visually displayed.
It should be understood that, although the steps in the flowchart of fig. 2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not limited to being performed in the exact order illustrated and, unless explicitly stated herein, may be performed in other orders. Moreover, at least a portion of the steps in fig. 2 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 3, there is provided an apparatus for testing performance of an H5 page in an application program, including: the device comprises a test instruction acquisition module, an instruction sending module, a packet capturing processing module, a time-consuming acquisition module, a data acquisition module and a performance evaluation module, wherein:
the test instruction obtaining module 302 is configured to obtain an address of an H5 page to be tested of the application program to be tested, and generate a test instruction for the H5 page.
The instruction sending module 304 is configured to send a test instruction to the test terminal, where the test instruction is used to instruct the test terminal to open an H5 page of the test terminal.
And the packet capturing processing module 306 is used for calling a packet capturing interface and opening a packet capturing program of the test terminal.
The time-consuming acquiring module 308 is configured to acquire various types of time-consuming data of a preset key event during loading of the H5 page.
The data obtaining module 310 is configured to obtain a packet capturing file of a packet capturing program and a log file of an application program to be tested.
And the performance evaluation module 312 is configured to obtain a performance test result of the H5 page according to the packet capturing file, the log file, and various time-consuming data.
According to the H5 page performance testing device in the application program, the packet capturing program of the testing terminal is utilized to obtain the packet capturing file in the loading process of the H5 page to be tested, obtain various time-consuming data and log files in the loading process of the H5 page, and obtain the performance testing result according to the packet capturing file, the various time-consuming data and the log files. According to the method, the H5 page of the application program is opened at the test terminal, the truest performance data is obtained, the truest test data is ensured to be obtained, the accuracy of the test data is ensured, and meanwhile, the H5 page performance can be comprehensively evaluated according to the packet capturing file, various time-consuming data and the log file.
In another embodiment, the time-consuming acquisition module comprises:
the embedded point acquisition module is used for receiving embedded point information of the browsing control of the H5 page during loading;
the time acquisition module is used for acquiring a starting time point and an ending time point of a preset key event in the H5 page loading process according to the embedded point information;
and the calculating module is used for acquiring various time-consuming data corresponding to each preset key event according to the time difference between the starting time point and the ending time point of the preset key event.
Specifically, the time obtaining module is configured to call the test terminal when the embedded point information is received, capture a time point screenshot of a preset key event in an H5 page loading process, and determine a name, a start time point, and an end time point of the preset key event according to the embedded point information content and each time point of the screenshot.
In another embodiment, a performance evaluation module includes:
and the analysis module is used for acquiring the resource flow data and the http request data according to the packet capturing file and the log file.
And the performance test module is used for evaluating the page performance of the H5 page according to various time-consuming data, resource flow data and http request data to obtain a performance test result of the H5 page.
In another embodiment, the H5 page performance testing device in the application further comprises a cleaning module;
and the instruction sending module is further used for sending an unloading instruction to the test terminal according to the test instruction, wherein the unloading instruction is used for indicating the test terminal to unload the application program to be tested.
And the cleaning module is used for cleaning the log data of the application program to be tested.
And the instruction sending module is also used for sending an installation instruction to the test terminal, and the installation instruction is used for indicating the test terminal to install the application program to be tested.
In another embodiment, the apparatus for testing H5 page performance in an application further includes:
and the report request module is used for receiving a report generation request of the H5 page to be tested.
And the chart processing module is used for calling a chart tool and generating a visual H5 page performance detection report according to various time-consuming data, resource flow data and http request data of the H5 page.
For specific limitations of the H5 page performance testing apparatus in the application program, reference may be made to the above limitations of the H5 page performance testing method in the application program, and details are not described here again. All or part of each module in the H5 page performance testing device in the application program can be implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 4. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to realize a performance test method for H5 pages in an application program. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 4 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computer device comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program:
acquiring an address of an H5 page to be tested of an application program to be tested, and generating a test instruction for the H5 page;
sending a test instruction to the test terminal, wherein the test instruction is used for indicating the test terminal to open an H5 page of the test terminal;
calling a packet capturing interface, and opening a packet capturing program of the test terminal;
acquiring various time-consuming data of preset key events during loading of an H5 page;
acquiring a packet capturing file of a packet capturing program and a log file of an application program to be tested;
and obtaining a performance test result of the H5 page according to the packet capturing file, the log file and various time-consuming data.
In another embodiment, the step of obtaining various types of time-consuming data of preset key events during loading of the H5 page includes:
receiving buried point information of a browsing control of an H5 page during loading;
acquiring a starting time point and an ending time point of a preset key event in the loading process of the H5 page according to the embedded point information;
and acquiring various types of time-consuming data corresponding to the preset key events according to the time difference between the starting time point and the ending time point of the preset key events.
In another embodiment, the step of obtaining a start time point and an end time point of a preset key event in the H5 page loading process according to the buried point information includes:
when the embedded point information is received, calling a test terminal, and presetting a time point screenshot of a key event in the H5 page loading process;
and determining the name, the starting time point and the ending time point of the preset key event according to the information content of the embedded point and each time point of the screenshot.
In another embodiment, the step of obtaining the performance test result of the H5 page according to the package capture file, the log file and various types of time-consuming data includes:
acquiring resource flow data and http request data according to the packet capturing file and the log file;
and evaluating the page performance of the H5 page according to various time-consuming data, resource flow data and http request data to obtain a performance test result of the H5 page.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
sending an unloading instruction to the test terminal according to the test instruction, wherein the unloading instruction is used for instructing the test terminal to unload the application program to be tested;
cleaning log data of an application program to be tested;
and sending an installation instruction to the test terminal, wherein the installation instruction is used for instructing the test terminal to install the application program to be tested.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
receiving a report generation request of an H5 page to be tested;
and calling a graph tool, and generating a visual H5 page performance detection report according to various time-consuming data, resource flow data and http request data of the H5 page.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring an address of an H5 page to be tested of an application program to be tested, and generating a test instruction for the H5 page;
sending a test instruction to the test terminal, wherein the test instruction is used for indicating the test terminal to open an H5 page of the test terminal;
calling a packet capturing interface, and opening a packet capturing program of the test terminal;
acquiring various time-consuming data of preset key events when an H5 page is loaded;
acquiring a packet capturing file of a packet capturing program and a log file of an application program to be tested;
and obtaining a performance test result of the H5 page according to the packet capturing file, the log file and various time-consuming data.
In another embodiment, the step of obtaining various types of time-consuming data of preset key events during loading of the H5 page includes:
receiving buried point information of a browsing control of an H5 page during loading;
acquiring a starting time point and an ending time point of a preset key event in the loading process of the H5 page according to the embedded point information;
and acquiring various types of time-consuming data corresponding to the preset key events according to the time difference between the starting time point and the ending time point of the preset key events.
In another embodiment, the step of obtaining a start time point and an end time point of a preset key event in the H5 page loading process according to the buried point information includes:
when the embedded point information is received, calling a test terminal, and presetting a time point screenshot of a key event in the H5 page loading process;
and determining the name, the starting time point and the ending time point of the preset key event according to the information content of the embedded point and each time point of the screenshot.
In another embodiment, the step of obtaining the performance test result of the H5 page according to the package capture file, the log file and various types of time-consuming data includes:
acquiring resource flow data and http request data according to the packet capturing file and the log file;
and evaluating the page performance of the H5 page according to various time-consuming data, resource flow data and http request data to obtain a performance test result of the H5 page.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
sending an unloading instruction to the test terminal according to the test instruction, wherein the unloading instruction is used for indicating the test terminal to unload the application program to be tested;
cleaning log data of an application program to be tested;
and sending an installation instruction to the test terminal, wherein the installation instruction is used for instructing the test terminal to install the application program to be tested.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
receiving a report generation request of an H5 page to be tested;
and calling a graph tool, and generating a visual H5 page performance detection report according to various time-consuming data, resource flow data and http request data of the H5 page.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A performance test method for an H5 page in an application program is applied to a test host, wherein the test host is connected with a test terminal, and the method comprises the following steps:
acquiring an address of an H5 page to be tested of an application program to be tested, and generating a test instruction for the H5 page;
sending the test instruction to a test terminal, wherein the test instruction is used for indicating the test terminal to open the H5 page of the test terminal;
calling a packet capturing interface, and opening a packet capturing program of the test terminal;
receiving embedded point information of the browsing control of the H5 page during loading;
when buried point information of a preset key event is received, generating a screenshot instruction, communicating with a test terminal, calling the test terminal to screenshot in a current H5 page, and acquiring information of the current screenshot, wherein the information of the current screenshot comprises picture information, buried point information and time information;
determining the name, the starting time point and the ending time point of a preset key event according to the information content of the embedded point and each time point of the screenshot;
acquiring various types of time-consuming data corresponding to each preset key event according to the time difference between the starting time point and the ending time point of the preset key event;
acquiring a packet capturing file of the packet capturing program and a log file of the application program to be tested;
and obtaining a performance test result of the H5 page according to the packet capturing file, the log file and various time-consuming data.
2. The method according to claim 1, wherein the step of obtaining the performance test result of the H5 page according to the package capture file, the log file and various types of time-consuming data comprises:
acquiring resource flow data and http request data according to the packet capturing file and the log file;
and evaluating the page performance of the H5 page according to the various time-consuming data, the resource flow data and the http request data to obtain a performance test result of the H5 page.
3. The method of claim 1, wherein prior to the step of sending the test instructions to the test terminal, the method further comprises:
sending an unloading instruction to the test terminal according to the test instruction, wherein the unloading instruction is used for instructing the test terminal to unload the application program to be tested;
cleaning the log data of the application program to be tested;
and sending an installation instruction to the test terminal, wherein the installation instruction is used for indicating the test terminal to install the application program to be tested.
4. The method of claim 3, further comprising:
receiving a report generation request for an H5 page to be tested;
and calling a graph tool, and generating a visual H5 page performance detection report according to various time-consuming data, resource flow data and http request data of the H5 page.
5. A device for testing H5 page performance in an application program is applied to a test host, the test host is connected with a test terminal, and the device comprises:
the test instruction acquisition module is used for acquiring the address of the H5 page to be tested of the application program to be tested and generating a test instruction for the H5 page;
the instruction sending module is used for sending the test instruction to a test terminal, and the test instruction is used for indicating the test terminal to open the H5 page of the test terminal;
the packet capturing processing module is used for calling a packet capturing interface and opening a packet capturing program of the test terminal;
the time-consuming acquisition module is used for receiving the embedded point information of the browsing control of the H5 page during loading; when buried point information of a preset key event is received, generating a screenshot instruction, communicating with a test terminal, calling the test terminal to screenshot in a current H5 page, and acquiring information of the current screenshot, wherein the information of the current screenshot comprises picture information, buried point information and time information; determining the name, the starting time point and the ending time point of a preset key event according to the information content of the embedded point and each time point of the screenshot; acquiring various types of time-consuming data corresponding to the preset key events according to the time difference between the starting time point and the ending time point of the preset key events;
the data acquisition module is used for acquiring a packet capturing file of the packet capturing program and a log file of the application program to be detected;
and the performance evaluation module is used for obtaining a performance test result of the H5 page according to the packet capturing file, the log file and various time-consuming data.
6. The apparatus of claim 5, wherein the performance evaluation module comprises:
the analysis module is used for acquiring resource flow data and http request data according to the packet capturing file and the log file;
and the performance test module is used for evaluating the page performance of the H5 page according to the various types of time-consuming data, resource flow data and http request data to obtain a performance test result of the H5 page.
7. The apparatus according to claim 5, wherein the apparatus for testing H5 page performance in the application further comprises a cleaning module;
the instruction sending module is further used for sending an unloading instruction to the test terminal according to the test instruction, wherein the unloading instruction is used for instructing the test terminal to unload the application program to be tested;
the cleaning module is used for cleaning the log data of the application program to be detected;
and the instruction sending module is further used for sending an installation instruction to the test terminal, wherein the installation instruction is used for indicating the test terminal to install the application program to be tested.
8. The apparatus of claim 7, wherein the means for testing H5 page performance in the application further comprises:
the report request module is used for receiving a report generation request for the H5 page to be tested;
and the chart processing module is used for calling a chart tool and generating a visual H5 page performance detection report according to various time-consuming data, resource flow data and http request data of the H5 page.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 4 when executing the computer program.
10. 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 of any one of claims 1 to 4.
CN201811572820.2A 2018-12-21 2018-12-21 Method and device for testing H5 page performance in application program and computer equipment Active CN109766256B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811572820.2A CN109766256B (en) 2018-12-21 2018-12-21 Method and device for testing H5 page performance in application program and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811572820.2A CN109766256B (en) 2018-12-21 2018-12-21 Method and device for testing H5 page performance in application program and computer equipment

Publications (2)

Publication Number Publication Date
CN109766256A CN109766256A (en) 2019-05-17
CN109766256B true CN109766256B (en) 2023-02-07

Family

ID=66450855

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811572820.2A Active CN109766256B (en) 2018-12-21 2018-12-21 Method and device for testing H5 page performance in application program and computer equipment

Country Status (1)

Country Link
CN (1) CN109766256B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110221954A (en) * 2019-05-29 2019-09-10 吉旗(成都)科技有限公司 Application program for mobile terminal page method for monitoring performance and device
CN110928767B (en) * 2019-10-12 2023-05-02 深圳赛安特技术服务有限公司 Webpage analysis method, device, equipment and storage medium
CN110781437A (en) * 2019-10-28 2020-02-11 北京字节跳动网络技术有限公司 Method and device for acquiring webpage image loading duration and electronic equipment
CN111061606A (en) * 2019-11-04 2020-04-24 深圳震有科技股份有限公司 Monitoring and early warning method based on browser, terminal and storage medium
CN111371643B (en) * 2020-02-28 2022-07-05 京东科技控股股份有限公司 Authentication method, device and storage medium
CN113449227B (en) * 2020-03-24 2023-09-19 北京新氧科技有限公司 Page information processing method and terminal equipment
CN111444103B (en) * 2020-03-31 2024-04-26 腾讯音乐娱乐科技(深圳)有限公司 Web page automatic testing method and related equipment
US11042465B1 (en) 2020-09-02 2021-06-22 Coupang Corp. Systems and methods for analyzing application loading times
CN112115057B (en) * 2020-09-24 2024-09-20 京东科技控股股份有限公司 Automatic test method, device and equipment for application program page building flow
CN113762312A (en) * 2021-01-29 2021-12-07 北京沃东天骏信息技术有限公司 Page buried point analysis method and device
CN113741397B (en) * 2021-09-09 2023-04-21 四川虹美智能科技有限公司 Performance test method and system for intelligent household equipment
CN115061902A (en) * 2022-05-09 2022-09-16 上海钧正网络科技有限公司 Page loading time testing method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106330990A (en) * 2015-06-17 2017-01-11 阿里巴巴集团控股有限公司 B/S structure performance monitoring analysis system and method
CN107479907A (en) * 2016-06-07 2017-12-15 中兴通讯股份有限公司 The development approach of application program, apparatus and system
CN107783899A (en) * 2017-08-25 2018-03-09 上海壹账通金融科技有限公司 The method of testing of the H5 pages, device and computer equipment in application program
WO2018113385A1 (en) * 2016-12-24 2018-06-28 上海壹账通金融科技有限公司 Method and system for dynamically tracking application of client, client, and server
CN108345632A (en) * 2017-12-29 2018-07-31 中国平安财产保险股份有限公司 Call method, device, equipment and the computer readable storage medium of the H5 pages

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8234369B2 (en) * 2008-12-23 2012-07-31 Verizon Patent And Licensing Inc. Web page response monitoring

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106330990A (en) * 2015-06-17 2017-01-11 阿里巴巴集团控股有限公司 B/S structure performance monitoring analysis system and method
CN107479907A (en) * 2016-06-07 2017-12-15 中兴通讯股份有限公司 The development approach of application program, apparatus and system
WO2018113385A1 (en) * 2016-12-24 2018-06-28 上海壹账通金融科技有限公司 Method and system for dynamically tracking application of client, client, and server
CN107783899A (en) * 2017-08-25 2018-03-09 上海壹账通金融科技有限公司 The method of testing of the H5 pages, device and computer equipment in application program
CN108345632A (en) * 2017-12-29 2018-07-31 中国平安财产保险股份有限公司 Call method, device, equipment and the computer readable storage medium of the H5 pages

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
从0到1:打造移动端H5性能测试平台;腾讯移动品质中心TMQ;《https://blog.csdn.net/TMQ1225/article/details/53204476》;20161117;第1-11页 *

Also Published As

Publication number Publication date
CN109766256A (en) 2019-05-17

Similar Documents

Publication Publication Date Title
CN109766256B (en) Method and device for testing H5 page performance in application program and computer equipment
CN110008118B (en) Page data testing method and device, computer equipment and storage medium
WO2018120722A1 (en) Asynchronous interface testing method, terminal, device, system, and storage medium
CN108848000B (en) Network request testing method and device, computer equipment and storage medium
CN110990205A (en) Interface call testing method, device and computer readable storage medium
CN109815089A (en) H5 page monitoring method, device, computer equipment and storage medium
CN110008117A (en) Page test method, device, computer equipment and storage medium
CN109753418B (en) Performance test method and device, computer equipment and storage medium
US10084637B2 (en) Automatic task tracking
CN111835756B (en) APP privacy compliance detection method and device, computer equipment and storage medium
CN111475376A (en) Method and device for processing test data, computer equipment and storage medium
CN108052440B (en) Method, device, equipment and storage medium for correcting operation logic of business system
CN111240905B (en) Screen projection diagnosis method, device, system, storage medium and equipment
CN108256322B (en) Security testing method and device, computer equipment and storage medium
CN110162453B (en) Test method, test device, computer readable storage medium and computer equipment
CN110990249B (en) Code scanning result processing method, device, computer equipment and storage medium
CN110659092A (en) Webpage screenshot method and device, computer equipment and storage medium
CN111797026A (en) Test case generation method and device, computer equipment and storage medium
CN110659435A (en) Page data acquisition processing method and device, computer equipment and storage medium
CN110597709A (en) Interactive debugging method and device for mixed-mode mobile application and computer equipment
CN111431767B (en) Multi-browser resource synchronization method and device, computer equipment and storage medium
CN112153375A (en) Front-end performance testing method, device, equipment and medium based on video information
US10191844B2 (en) Automatic garbage collection thrashing monitoring
CN113553088A (en) Patch package distribution method and device, computer equipment and storage medium
CN110516172B (en) Resource calling method and device, computer equipment and storage 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