CN114238048A - Automatic testing method and system for Web front-end performance - Google Patents

Automatic testing method and system for Web front-end performance Download PDF

Info

Publication number
CN114238048A
CN114238048A CN202111410813.4A CN202111410813A CN114238048A CN 114238048 A CN114238048 A CN 114238048A CN 202111410813 A CN202111410813 A CN 202111410813A CN 114238048 A CN114238048 A CN 114238048A
Authority
CN
China
Prior art keywords
page
scene
test
data
access
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.)
Granted
Application number
CN202111410813.4A
Other languages
Chinese (zh)
Other versions
CN114238048B (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.)
Guangzhou Xuanwu Wireless Technology Co Ltd
Original Assignee
Guangzhou Xuanwu Wireless 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 Guangzhou Xuanwu Wireless Technology Co Ltd filed Critical Guangzhou Xuanwu Wireless Technology Co Ltd
Priority to CN202111410813.4A priority Critical patent/CN114238048B/en
Publication of CN114238048A publication Critical patent/CN114238048A/en
Application granted granted Critical
Publication of CN114238048B publication Critical patent/CN114238048B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • G06F11/3414Workload generation, e.g. scripts, playback
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • G06F11/3419Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment by assessing time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method and a system for automatically testing the performance of a Web front end, wherein the method comprises the following steps: acquiring and analyzing test data; after the communication session link to be tested is established, testing the Web end through a test instruction generated by the test data; respectively accessing a URL scene and a menu scene according to a tested page path, and receiving access performance data of the URL scene and access performance data of the menu scene; and writing the access performance data of the URL scene and the access performance data of the menu scene into a test report by a rewriting method, and automatically sending the test report to related personnel after the test is finished. In the testing process, the Chrome console is operated to monitor various testing data, so that the error rate of manual acquisition and calculation is reduced, and the workload is reduced.

Description

Automatic testing method and system for Web front-end performance
Technical Field
The invention relates to the technical field of data processing, in particular to a method and a system for automatically testing the performance of a Web front end.
Background
In the front-end performance test of the existing application, a tester needs to collect performance indexes such as white screen time, first screen time, rendering time, heap memory consumption and recycling of each page. In the implementation project or the main line product, the performance test of the main line product depends on that testers manually request each page, collect various performance index data, manually record each item of data by using Excel, and finally process and generate a performance test report so as to determine whether the performance of the front-end page meets the requirements. However, the prior art has the following disadvantages:
1. when the product version is released frequently, the method is limited by limited testing resources, and the test is executed purely by hand, so that the method cannot cover all product versions and all contents. In addition, the page configurations and page-related service functions of different projects are different, and if the page performance of a project is judged only according to the product performance of a certain version inherited by the project, the page performance is obviously unreliable. Therefore, some projects need to do performance tests of the changed pages separately.
2. In the testing process, for the front-end test of the menu access mode, event logs need to be recorded manually through a developer tool in a browser, and event node time corresponding to each index needs to be screened and counted manually to obtain performance data, so that the manual operation steps are complicated.
3. For a menu access mode, time of various front-end events cannot be acquired through a Chrome interface, time consumption of white screen, first screen, rendering and the like cannot be directly calculated, manual recording is needed, various events are screened from recording results, test time consumption is longer, and efficiency is lower.
4. When the heap memory is collected, the initial value, the peak value and the stable value of the memory also need to be observed by naked eyes, so that the error is large, and errors are easy to occur when the numerical value is obtained.
5. When the number of pages for manually recording the test result is large, there may be input error data, which affects the correctness of the test result.
6. The front-end performance test has two modes of direct access through a URL (uniform resource locator) and click access through a system menu, because the two modes need to be respectively tested to collect and calculate time indexes such as front-end rendering and the like so as to ensure the comprehensiveness of data and scenes, more data needs to be recorded manually, and the time consumption is longer.
Disclosure of Invention
In order to solve the above prior art problems, the present invention provides a method and a system for automatically testing the performance of a Web front end, so as to realize the automatic testing of the performance of the Web application front end.
The first aspect of the present invention provides a method for automatically testing the performance of a Web front end, including:
acquiring and analyzing test data;
after the communication session link to be tested is established, testing the Web end through a test instruction generated by the test data;
respectively accessing a URL scene and a menu scene according to a tested page path, and receiving access performance data of the URL scene and access performance data of the menu scene;
and writing the access performance data of the URL scene and the access performance data of the menu scene into a test report by a rewriting method, and automatically sending the test report to related personnel after the test is finished.
Further, the accessing the URL scene and the menu scene respectively includes: accessing a URL scene, specifically:
after the page is stable and the resource loading is finished, acquiring a currently used js heap memory from a developer console, and monitoring the js heap memory in real time;
and re-requesting the page by the automatic test framework until the request and the resource loading are finished, stopping real-time monitoring, and storing the js heap memory peak value identified by the real-time monitoring and the memory value after the page is stabilized.
Further, the accessing the URL scene and the menu scene respectively includes: accessing a menu scene, specifically:
accessing a default page and recording a heap memory when the page is stable, after clearing cache, accessing a tested page and starting to record a page loading event log;
acquiring real-time data of a js heap memory, stopping recording a page loading event log after the detected page is stable, and storing the page loading event log to the local; wherein the page load event log comprises: page access time and page rendering time;
and calculating an access time difference and a rendering time difference according to the page access time and the page rendering time.
Further, after the obtaining and analyzing the test data, the method includes:
establishing a test communication session link; specifically, the method comprises the following steps:
calling Webdriver through the Selenium, driving a Chrome browser by using the Webdriver, and starting the Web application to be tested to establish a test communication session link.
The second aspect of the present invention provides an automated testing system for Web front-end performance, comprising:
the data processing module is used for acquiring and analyzing the test data;
the testing module is used for testing the Web end through a testing instruction generated by the testing data after the communication session link to be tested is established;
the scene access module is used for respectively accessing the URL scene and the menu scene according to the tested page path and receiving the access performance data of the URL scene and the access performance data of the menu scene;
and the test report generating module is used for writing the access performance data of the URL scene and the access performance data of the menu scene into a test report through a rewriting method, and automatically sending the test report to related personnel after the test is finished.
Further, the scene access module is further configured to:
after the page is stable and the resource loading is finished, acquiring a currently used js heap memory from a developer console, and monitoring the js heap memory in real time;
and re-requesting the page by the automatic test framework until the request and the resource loading are finished, stopping real-time monitoring, and storing the js heap memory peak value identified by the real-time monitoring and the memory value after the page is stabilized.
Further, the scene access module is further configured to:
accessing a default page and recording a heap memory when the page is stable, after clearing cache, accessing a tested page and starting to record a page loading event log;
acquiring real-time data of a js heap memory, stopping recording a page loading event log after the detected page is stable, and storing the page loading event log to the local; wherein the page load event log comprises: page access time and page rendering time;
and calculating an access time difference and a rendering time difference according to the page access time and the page rendering time.
Further, the data processing module is further configured to:
establishing a test communication session link; specifically, the method comprises the following steps:
calling Webdriver through the Selenium, driving a Chrome browser by using the Webdriver, and starting the Web application to be tested to establish a test communication session link.
A third aspect of the present invention provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the method for automatically testing the performance of the Web front end according to any one of the first aspects.
A fourth aspect of the present invention provides a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, where when the computer program runs, a device in which the computer-readable storage medium is located is controlled to execute the method for automatically testing the performance of the Web front end according to any one of the first aspects.
Compared with the prior art, the embodiment of the invention has the beneficial effects that:
the invention provides a method and a system for automatically testing the performance of a Web front end, wherein the method comprises the following steps: acquiring and analyzing test data; after the communication session link to be tested is established, testing the Web end through a test instruction generated by the test data; respectively accessing a URL scene and a menu scene according to a tested page path, and receiving access performance data of the URL scene and access performance data of the menu scene; and writing the access performance data of the URL scene and the access performance data of the menu scene into a test report by a rewriting method, and automatically sending the test report to related personnel after the test is finished. In the testing process, the Chrome console is operated to monitor various testing data, so that the error rate of manual acquisition and calculation is reduced, and the workload is reduced.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for automatically testing performance of a Web front end according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for automatically testing the performance of a Web front end according to another embodiment of the present invention;
fig. 3 is a flowchart of a method for automatically testing the performance of a Web front end according to another embodiment of the present invention;
fig. 4 is a flowchart of a method for automatically testing the performance of a Web front end according to another embodiment of the present invention;
fig. 5 is a flowchart of a method for automatically testing the performance of a Web front end according to another embodiment of the present invention;
fig. 6 is a flowchart of a method for automatically testing the performance of a Web front end according to another embodiment of the present invention;
fig. 7 is a device diagram of an automated testing system for Web front-end performance according to an embodiment of the present invention;
fig. 8 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be understood that the step numbers used herein are for convenience of description only and are not intended as limitations on the order in which the steps are performed.
It is to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
The terms "comprises" and "comprising" indicate the presence of the described features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
The term "and/or" refers to and includes any and all possible combinations of one or more of the associated listed items.
A first aspect.
Referring to fig. 1, an embodiment of the present invention provides an automated testing method for Web front-end performance, including:
and S10, acquiring and analyzing the test data.
And S20, after the communication session link to be tested is established, testing the Web end through the test instruction generated by the test data.
And S30, respectively accessing the URL scene and the menu scene according to the tested page path, and receiving the access performance data of the URL scene and the menu scene.
And S40, writing the access performance data of the URL scene and the access performance data of the menu scene into a test report through a rewriting method, and automatically sending the test report to related personnel after the test is finished.
In a specific implementation manner of the embodiment of the present invention, the accessing the URL scene and the menu scene respectively includes: accessing a URL scene, specifically:
after the page is stable and the resource loading is finished, acquiring a currently used js heap memory from a developer console, and monitoring the js heap memory in real time;
and re-requesting the page by the automatic test framework until the request and the resource loading are finished, stopping real-time monitoring, and storing the js heap memory peak value identified by the real-time monitoring and the memory value after the page is stabilized.
The respectively accessing the URL scene and the menu scene further comprises: accessing a menu scene, specifically:
accessing a default page and recording a heap memory when the page is stable, after clearing cache, accessing a tested page and starting to record a page loading event log;
acquiring real-time data of a js heap memory, stopping recording a page loading event log after the detected page is stable, and storing the page loading event log to the local; wherein the page load event log comprises: page access time and page rendering time;
and calculating an access time difference and a rendering time difference according to the page access time and the page rendering time.
In another specific implementation manner of the embodiment of the present invention, after the obtaining and analyzing the test data, the method includes:
establishing a test communication session link; specifically, the method comprises the following steps:
calling Webdriver through the Selenium, driving a Chrome browser by using the Webdriver, and starting the Web application to be tested to establish a test communication session link.
In the testing process, the Chrome console is operated to monitor various testing data, the error rate of manual acquisition and calculation is reduced, and the workload is reduced.
In another embodiment of the present invention, the present invention provides an automated testing method for Web front-end performance, including:
1. a tester inputs a page of a related scene through an Excel design, and each row of data in an Excel document maintains a single Web page, including whether the page is tested or not and a page access path. And maintaining information such as documents, accounts and the like through a Web end of the automatic test platform, uploading the information to a test server, and automatically reading the Excel file after the test is started by clicking. When the Excel file is analyzed, traversal is started from a first row of data, all pages needing to be tested are extracted through an identification column whether the pages need to be tested or not, corresponding access paths such as a primary menu, a secondary menu and the like are sequentially decomposed, row positions of the pages and the decomposed paths are stored in a specified global variable, a tested system is accessed through input system addresses, accounts, passwords and account posts, and performance testing is started (the flow is shown in figure 2).
Based on the test case generation process, the following purposes are mainly achieved:
1) each Excel file can be read for 1 time to store all test cases to be executed, and the file reading and writing expenses are reduced.
2) And rapidly generating a test case in real time according to Excel data in each test. Therefore, only the correctness of Excel data needs to be ensured, the test case script is maintained in zero, and the workload is reduced.
3) When tests are needed to be conducted on different environments and different account numbers, only the environment and the account number information need to be filled in the automatic test platform to initiate the tests again, and therefore labor cost is reduced.
4) When the test platform does not fill any information and directly initiates a test, the system automatically tracks the address of the client, obtains the latest test application information of the client and directly executes a performance test task, namely, the test task is completed by one key.
2. As shown in fig. 3, when the test script is executed, the Webdriver is called through the Selenium, the Webdriver is used to drive the Chrome browser, and the Web application to be tested is started, so that a complete communication session link is established. After the connection is successful, in the tested Web application on the Chrome, a test instruction is executed through a Python script, each page is accessed (two scenes of URL access and menu access) according to the tested page path, and different monitoring acquisition methods are adopted to respectively collect performance data corresponding to the two access modes:
note: when URL accesses, the resource of the current tab page of the browser can be requested to be loaded, and when the menu accesses, only the resource of the access page is requested to be loaded
2.1 As shown in FIG. 4, URL access: and after the page is accessed according to the page path, refreshing the page, and after the page is stabilized and the resource loading is finished, acquiring the currently used js heap memory from the console of the developer by using an AI image identification method and character analysis, and starting real-time monitoring. And re-requesting the page by the automatic test framework until the request and the resource loading are finished, stopping AI monitoring, and storing the js heap memory peak value identified by the AI monitoring and the memory value after the page is stabilized. And synchronously acquiring time points corresponding to events such as firstPaint time, navigationstart, loadEventEnd, domConentLoadedEventEnd and the like provided by the Chrome interface, and calculating front-end performance indexes such as white screen time, first screen time, rendering time and the like.
2.2 as shown in FIG. 5, menu access: firstly, accessing a default page and recording a heap memory when the page is stable, and accessing a tested page after clearing the cache. And recording the stabilized heap memory under the monitoring tool interface of the developer through AI image recognition, re-accessing the page to be tested, simultaneously controlling a Chrome console to record the page loading process through mouse key simulation, and storing the recorded data. And acquiring real-time data (a page access peak value before page access and a page access stable data after page access) of a js heap memory in an AI identification mode, stopping recording a page loading event log and storing the log to the local after the tested page is stable, wherein Tracing StartedInBrowser and paint in the log respectively represent page access and page rendering time. The recorded data is parsed and the time difference (rendering time) of each event (e.g., rendering event) is calculated.
Based on the process, the following purposes are achieved:
1) two access scenes (URL access and menu access) existing when a user accesses the system are integrated, resources of a whole browser tab page are loaded during the URL access, only resource files of the accessed page are loaded during the menu access, and menu and avatar information resource data are not loaded, namely files of other non-access pages such as menu.
2) The image identification method can effectively monitor the change of the heap memory, record the heap memory when the page is loaded and the heap memory after the page is loaded in real time, output the heap memory recycling and consumption conditions of two access modes by matching with a relevant algorithm in a test frame, and better monitor whether the system has the problem of memory overflow.
3) The method combines mouse key simulation and Chrome open correlation methods, can freely control the operation of a developer console in the test process, is convenient for quickly opening a heap memory test tool, a page loading monitoring tool and the like, assists in acquiring test data, and replaces manual operation.
4) For performance indexes such as white screen, first screen and rendering time, log file analysis and js interface request modes are adopted for collection, and compared with manual calculation and manual execution, the method is more accurate and rapid.
3. As shown in fig. 6, when each use case is executed, no matter in a url access mode or a menu access mode, the system collects and analyzes the change values of the heap memory before and after and the time consumption of various events according to the index sequence on the use case document, writes back the performance data to the test report by calling the openpyxl rewriting method of the third-party module, and after the use case is executed, the system reads the mail address newly submitted by the IP of the submitter in the database, calls the mail sending method packaged in the test frame, and automatically sends the test report to the relevant personnel.
The method provided by the invention realizes the automatic performance test of the Web application front end by using a technical means based on Python + Selenium + Chrome, and collects performance data by combining image recognition, mouse key simulation operation, file data reading, event node time consumption calculation and other modes.
1. And maintaining a test page through Excel, automatically generating a test case according to a preset template based on Excel data, and driving the test through a script. The test data is separated from the test script, and the maintenance cost is reduced.
2. A tester does not need a large amount of codes, only needs to maintain a page to be tested by virtue of Excel, and drives a Chrome browser to finish various testing operations, so that the testing threshold is greatly reduced.
3. In the testing process, the Chrome console is operated to monitor various testing data, the data are acquired through methods such as file reading, data screening, AI image recognition, mouse key simulation and the like, the error rate of manual acquisition and calculation is reduced, and the workload is reduced.
4. By means of the Python technology, data collected from the Chrome browser are directly written into a test report, manual intervention is reduced, and cost is reduced.
5. The same test case and system information do not need to be uploaded repeatedly by the same submitter at the front end, when zero-input direct submission is carried out, the system can automatically extract the recently submitted test case and system information by capturing the IP of the submitter to carry out test, the complexity of operation is reduced, and the operation is more convenient.
A second aspect.
Referring to fig. 7, an embodiment of the present invention provides an automated testing system for Web front-end performance, including:
the data processing module 10 is used for acquiring and analyzing the test data;
the testing module 20 is configured to test the Web end through a testing instruction generated by the testing data after the communication session link to be tested is established;
the scene access module 30 is configured to respectively access the URL scene and the menu scene according to the tested page path, and receive access performance data of the URL scene and access performance data of the menu scene;
and the test report generating module 40 is configured to write the access performance data of the URL scene and the access performance data of the menu scene into a test report by a rewriting method, and automatically send the test report to relevant people after the test is completed.
In a specific implementation manner of the embodiment of the present invention, the scene access module 30 is further configured to:
after the page is stable and the resource loading is finished, acquiring a currently used js heap memory from a developer console, and monitoring the js heap memory in real time;
and re-requesting the page by the automatic test framework until the request and the resource loading are finished, stopping real-time monitoring, and storing the js heap memory peak value identified by the real-time monitoring and the memory value after the page is stabilized.
In another specific implementation manner of the embodiment of the present invention, the scene access module 30 is further configured to:
accessing a default page and recording a heap memory when the page is stable, after clearing cache, accessing a tested page and starting to record a page loading event log;
acquiring real-time data of a js heap memory, stopping recording a page loading event log after the detected page is stable, and storing the page loading event log to the local; wherein the page load event log comprises: page access time and page rendering time;
and calculating an access time difference and a rendering time difference according to the page access time and the page rendering time.
In another specific implementation manner of the embodiment of the present invention, the data processing module 10 is further configured to:
establishing a test communication session link; specifically, the method comprises the following steps:
calling Webdriver through the Selenium, driving a Chrome browser by using the Webdriver, and starting the Web application to be tested to establish a test communication session link.
In the testing process of the system provided by the invention, the Chrome console is operated to monitor various testing data, the error rate of manual acquisition and calculation is reduced, and the workload is reduced.
In a third aspect.
The present invention provides an electronic device, including:
a processor, a memory, and a bus;
the bus is used for connecting the processor and the memory;
the memory is used for storing operation instructions;
the processor is configured to invoke the operation instruction, and the executable instruction enables the processor to execute an operation corresponding to the method for automatically testing the performance of the front end of the Web, as shown in the first aspect of the present application.
In an alternative embodiment, an electronic device is provided, as shown in fig. 8, the electronic device 5000 shown in fig. 8 includes: a processor 5001 and a memory 5003. The processor 5001 and the memory 5003 are coupled, such as via a bus 5002. Optionally, the electronic device 5000 may also include a transceiver 5004. It should be noted that the transceiver 5004 is not limited to one in practical application, and the structure of the electronic device 5000 is not limited to the embodiment of the present application.
The processor 5001 may be a CPU, general purpose processor, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 5001 may also be a combination of processors implementing computing functionality, e.g., a combination comprising one or more microprocessors, a combination of DSPs and microprocessors, or the like.
Bus 5002 can include a path that conveys information between the aforementioned components. The bus 5002 may be a PCI bus or EISA bus, etc. The bus 5002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus.
The memory 5003 may be, but is not limited to, a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, an EEPROM, a CD-ROM or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 5003 is used for storing application program codes for executing the present solution, and the execution is controlled by the processor 5001. The processor 5001 is configured to execute application program code stored in the memory 5003 to implement the teachings of any of the foregoing method embodiments.
Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like.
A fourth aspect.
The invention provides a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements a method for automated testing of Web front-end performance as presented in the first aspect of the present application.
Yet another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, which, when run on a computer, enables the computer to perform the corresponding content in the aforementioned method embodiments.

Claims (10)

1. An automated testing method for Web front-end performance is characterized by comprising the following steps:
acquiring and analyzing test data;
after the communication session link to be tested is established, testing the Web end through a test instruction generated by the test data;
respectively accessing a URL scene and a menu scene according to a tested page path, and receiving access performance data of the URL scene and access performance data of the menu scene;
and writing the access performance data of the URL scene and the access performance data of the menu scene into a test report by a rewriting method, and automatically sending the test report to related personnel after the test is finished.
2. The method for automatically testing the performance of the Web front end according to claim 1, wherein the accessing the URL scene and the menu scene respectively comprises: accessing a URL scene, specifically:
after the page is stable and the resource loading is finished, acquiring a currently used js heap memory from a developer console, and monitoring the js heap memory in real time;
and re-requesting the page by the automatic test framework until the request and the resource loading are finished, stopping real-time monitoring, and storing the js heap memory peak value identified by the real-time monitoring and the memory value after the page is stabilized.
3. The method for automatically testing the performance of the Web front end according to claim 1, wherein the accessing the URL scene and the menu scene respectively comprises: accessing a menu scene, specifically:
accessing a default page and recording a heap memory when the page is stable, after clearing cache, accessing a tested page and starting to record a page loading event log;
acquiring real-time data of a js heap memory, stopping recording a page loading event log after the detected page is stable, and storing the page loading event log to the local; wherein the page load event log comprises: page access time and page rendering time;
and calculating an access time difference and a rendering time difference according to the page access time and the page rendering time.
4. The method for automatically testing the performance of the Web front end according to claim 1, wherein after the obtaining and analyzing the test data, the method comprises:
establishing a test communication session link; specifically, the method comprises the following steps:
calling Webdriver through the Selenium, driving a Chrome browser by using the Webdriver, and starting the Web application to be tested to establish a test communication session link.
5. An automated testing system for Web front-end performance, comprising:
the data processing module is used for acquiring and analyzing the test data;
the testing module is used for testing the Web end through a testing instruction generated by the testing data after the communication session link to be tested is established;
the scene access module is used for respectively accessing the URL scene and the menu scene according to the tested page path and receiving the access performance data of the URL scene and the access performance data of the menu scene;
and the test report generating module is used for writing the access performance data of the URL scene and the access performance data of the menu scene into a test report through a rewriting method, and automatically sending the test report to related personnel after the test is finished.
6. The automated Web front-end performance testing system of claim 5, wherein the scenario access module is further configured to:
after the page is stable and the resource loading is finished, acquiring a currently used js heap memory from a developer console, and monitoring the js heap memory in real time;
and re-requesting the page by the automatic test framework until the request and the resource loading are finished, stopping real-time monitoring, and storing the js heap memory peak value identified by the real-time monitoring and the memory value after the page is stabilized.
7. The automated Web front-end performance testing system of claim 5, wherein the scenario access module is further configured to:
accessing a default page and recording a heap memory when the page is stable, after clearing cache, accessing a tested page and starting to record a page loading event log;
acquiring real-time data of a js heap memory, stopping recording a page loading event log after the detected page is stable, and storing the page loading event log to the local; wherein the page load event log comprises: page access time and page rendering time;
and calculating an access time difference and a rendering time difference according to the page access time and the page rendering time.
8. The automated Web front-end performance testing system of claim 5, wherein the data processing module is further configured to:
establishing a test communication session link; specifically, the method comprises the following steps:
calling Webdriver through the Selenium, driving a Chrome browser by using the Webdriver, and starting the Web application to be tested to establish a test communication session link.
9. An electronic device comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the Web front end performance automated testing method of any one of claims 1 to 4 when executing the computer program.
10. A computer-readable storage medium, comprising a stored computer program, wherein the computer program, when executed, controls an apparatus in which the computer-readable storage medium is located to perform the method for automated testing of Web front-end performance according to any one of claims 1 to 4.
CN202111410813.4A 2021-11-25 2021-11-25 Automatic testing method and system for Web front-end performance Active CN114238048B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111410813.4A CN114238048B (en) 2021-11-25 2021-11-25 Automatic testing method and system for Web front-end performance

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111410813.4A CN114238048B (en) 2021-11-25 2021-11-25 Automatic testing method and system for Web front-end performance

Publications (2)

Publication Number Publication Date
CN114238048A true CN114238048A (en) 2022-03-25
CN114238048B CN114238048B (en) 2022-08-23

Family

ID=80751114

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111410813.4A Active CN114238048B (en) 2021-11-25 2021-11-25 Automatic testing method and system for Web front-end performance

Country Status (1)

Country Link
CN (1) CN114238048B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115827480A (en) * 2022-12-20 2023-03-21 中船重工奥蓝托无锡软件技术有限公司 Automatic testing method, device and system for ship performance prediction APP

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101017457A (en) * 2007-02-09 2007-08-15 山东浪潮齐鲁软件产业股份有限公司 Automatically testing method of computer software
US20090183143A1 (en) * 2008-01-10 2009-07-16 Zhong Jie Li Method and apparatus for generating test cases of software system
CN106874207A (en) * 2017-02-27 2017-06-20 税友软件集团股份有限公司 The automated testing method and device of a kind of web page
CN111400149A (en) * 2020-01-19 2020-07-10 上海趣蕴网络科技有限公司 Application performance data monitoring system, client and method
US20200310945A1 (en) * 2019-03-29 2020-10-01 Usablenet Inc. Methods for improved web application testing using remote headless browsers and devices thereof
CN112231213A (en) * 2020-10-16 2021-01-15 广州助蜂网络科技有限公司 Web automatic testing method, system, storage medium and terminal equipment
CN112965914A (en) * 2021-03-30 2021-06-15 携程旅游网络技术(上海)有限公司 Application page testing method, system, device and medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101017457A (en) * 2007-02-09 2007-08-15 山东浪潮齐鲁软件产业股份有限公司 Automatically testing method of computer software
US20090183143A1 (en) * 2008-01-10 2009-07-16 Zhong Jie Li Method and apparatus for generating test cases of software system
CN106874207A (en) * 2017-02-27 2017-06-20 税友软件集团股份有限公司 The automated testing method and device of a kind of web page
US20200310945A1 (en) * 2019-03-29 2020-10-01 Usablenet Inc. Methods for improved web application testing using remote headless browsers and devices thereof
CN111400149A (en) * 2020-01-19 2020-07-10 上海趣蕴网络科技有限公司 Application performance data monitoring system, client and method
CN112231213A (en) * 2020-10-16 2021-01-15 广州助蜂网络科技有限公司 Web automatic testing method, system, storage medium and terminal equipment
CN112965914A (en) * 2021-03-30 2021-06-15 携程旅游网络技术(上海)有限公司 Application page testing method, system, device and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115827480A (en) * 2022-12-20 2023-03-21 中船重工奥蓝托无锡软件技术有限公司 Automatic testing method, device and system for ship performance prediction APP

Also Published As

Publication number Publication date
CN114238048B (en) 2022-08-23

Similar Documents

Publication Publication Date Title
CN109062780B (en) Development method of automatic test case and terminal equipment
US11507677B2 (en) Image classification modeling while maintaining data privacy compliance
CN110825618B (en) Method and related device for generating test case
CN106550038B (en) Data configuration diagnosis system and method of digital control system
CN110597704B (en) Pressure test method, device, server and medium for application program
CN111666201A (en) Regression testing method, device, medium and electronic equipment
CN110990274A (en) Data processing method, device and system for generating test case
Tuovenen et al. MAuto: Automatic mobile game testing tool using image-matching based approach
CN114238048B (en) Automatic testing method and system for Web front-end performance
CN114490394A (en) Test range determining method, device, equipment and medium
CN114185791A (en) Method, device and equipment for testing data mapping file and storage medium
CN110232018A (en) Interface test method, device, computer equipment
CN109582578A (en) System, method, computer-readable medium and the electronic equipment of software test case
CN111127223B (en) Insurance product testing method, insurance product testing device and storage medium
CN116841543A (en) Development method for dynamically generating cross-platform multi-terminal application based on Flutter
CN115052037B (en) Client detection method, device, storage medium and equipment
CN110716859A (en) Method for automatically pushing test cases for modified codes and related device
CN111008140B (en) Cross-platform UI (user interface) automatic testing method and device
CN113360397A (en) Regression testing method, device, equipment and storage medium of system function
CN112416727A (en) Batch processing operation checking method, device, equipment and medium
CN114546850A (en) Automatic testing method, system and device for embedded point and storage medium
CN112463126A (en) Software development method based on information technology consulting technology
CN115701591A (en) Business process testing method, device, medium and electronic equipment
CN111339748B (en) Evaluation method, device, equipment and medium of analytical model
US7971164B2 (en) Assessing resources required to complete a VLSI design

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