Page fluency testing method and device
By automatically determining the test scenarios and modes on the smart terminal device and performing click or sliding tests, the complexity of page fluency testing and device compatibility problems in the existing technology are solved, and efficient and accurate fluency testing and multi-device compatibility are achieved. .
Patent Information
- Application Number
- CN202411108661.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2025-01-03
AI Technical Summary
The existing page fluency testing methods have problems such as complex environmental deployment, large manual operation errors, cumbersome testing steps and the inability to batch execute different test scenarios during the APP development process.
A page fluency test method is proposed. By determining the scene and test data on the smart terminal device, determining the test mode based on the test data, performing click test or sliding test, obtaining the total number of drawn frames and frame drops, and calculating the fluency data. And the unified sliding operation position is converted through screen resolution to achieve automated testing.
It realizes automatic simulation of manual operations, improves the efficiency and accuracy of page fluency testing, and can conduct batch testing, solves the problem of inconsistent sliding operation caused by screen resolution of different devices, and achieves test compatibility between multiple devices.
Smart Images

Figure CN119248659A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a method and device for testing page fluency. Background Art
[0002] In the process of APP development, page fluency testing is an indispensable part. The existing page fluency testing methods usually use the Systrace tool and add the monitoring logic Choreographer class in the code to record tracking data or frame rate data. However, since APPs are usually run on mobile phones, the page loading time will vary each time due to differences in the operating environment (CPU temperature, device power, runtime memory consumption, etc.). The existing test methods have complex test environment deployment, require manual recording and calculation of frame rate information, and are prone to manual operation errors. At the same time, it is also necessary to add monitoring logic in the APP source code, and the test steps are cumbersome, time-consuming and labor-intensive. In addition, different test scenarios cannot be executed in batches, which has obvious disadvantages. Summary of the invention
[0003] In view of this, the present invention proposes a method and device for testing page fluency, and the specific scheme is as follows:
[0004] In the first aspect, a page fluency testing method is proposed, which is applied to a smart terminal device with a screen; the specific steps include:
[0005] Determine the scenario that corresponds to the page to be tested on the screen;
[0006] Determine the test data corresponding to the scenario; different scenarios correspond to different test data;
[0007] In the current scenario, the test mode is determined based on the test data; the test modes include: click mode and slide mode;
[0008] If it is determined that the test mode is the click mode, a click test is performed on the page, and the click test includes sliding operations and clicking operations on the page;
[0009] If it is determined that the test mode is the sliding mode, a sliding test is performed on the page, where the sliding test includes performing a sliding operation on the page;
[0010] Get the total number of drawing frames and dropped frames in the click test or slide test, and calculate the smoothness data.
[0011] In some specific embodiments, the click test includes:
[0012] Get the starting and ending coordinates of the sliding operation;
[0013] After pausing for a preset time, randomly generate the sliding speed of the sliding operation;
[0014] Perform sliding and clicking operations on the page based on sliding speed, preset sliding function and preset clicking function;
[0015] Calculate the sliding time of the sliding operation, and determine the length of the pause time between each click operation and / or sliding operation according to the sliding time;
[0016] Update the sliding speed, and update the sliding function based on the determined sliding speed;
[0017] The step of "performing sliding and clicking operations on the page" is performed based on the updated sliding speed, the preset click function and the updated sliding function.
[0018] In some specific embodiments, the sliding mode includes a first sliding mode; if the test mode is determined to be the first sliding mode, the sliding test includes:
[0019] Get the starting and ending coordinates of the sliding operation;
[0020] After pausing for a preset time, randomly generate the sliding speed of the sliding operation;
[0021] Slide the page based on the sliding speed and the preset sliding function;
[0022] Calculate the sliding time, and determine the length of the pause time between each sliding operation according to the sliding time;
[0023] Updating the sliding speed of the sliding operation, and updating the sliding function based on the determined sliding speed;
[0024] The step of "performing a sliding operation on the page" is performed based on the updated sliding speed and the updated sliding function.
[0025] In some specific embodiments, the sliding mode includes a second sliding mode; if the test mode is determined to be the second sliding mode, the sliding test includes:
[0026] Get the starting and ending coordinates of the sliding operation;
[0027] Get the screen resolution of the smart terminal device;
[0028] The starting coordinates and the ending coordinates are converted according to the screen resolution to obtain the actual starting coordinates and the actual ending coordinates after the conversion;
[0029] After pausing for a preset time, randomly generate a sliding speed for the sliding operation, and perform the sliding operation on the page based on the sliding speed and the preset sliding function;
[0030] Calculate the sliding time of the sliding operation, and determine the length of the pause time between each sliding operation according to the sliding time;
[0031] Updating the sliding speed of the sliding operation, and updating the sliding function based on the determined sliding speed;
[0032] The step of "performing a sliding operation on the page" is performed based on the updated sliding speed and the updated sliding function.
[0033] In actual applications, the smart terminal device with a screen can be a mobile phone. In reality, the screen resolutions of different mobile phones of different brands are different, which may cause errors in the sliding test positions of the page on different mobile phones, and the test positions of different mobile phone screen sizes are incompatible. For example, when sliding the same content on the same page, the distance that users need to slide their fingers is actually different on devices with different screen sizes and different screen resolutions.
[0034] Therefore, during the sliding test, by converting the starting and ending coordinates of the sliding operation according to the screen resolution, the sliding operation positions on different device screens can remain unified, further achieving compatibility with the test conditions of smart terminal devices of different brands, and better simulating the user's sliding operation on the screen.
[0035] In some specific embodiments, the process of converting the start coordinates and the end coordinates according to the screen resolution to obtain the converted actual start coordinates and the actual end coordinates includes:
[0036] Get the starting coordinate and the ending coordinate relative to the width percentage parameter x of the page and the height percentage parameter y of the page;
[0037] Multiply x by the number of pixels of the page width corresponding to the screen resolution to obtain the abscissa of the actual starting coordinate and the actual ending coordinate after conversion; multiply y by the number of pixels of the page height corresponding to the screen resolution to obtain the ordinate of the actual starting coordinate and the actual ending coordinate after conversion.
[0038] In some specific embodiments, the test data includes: the width and height percentage parameters of the page, and / or the starting coordinates and ending coordinates corresponding to the sliding test, and / or the number of sliding, and / or the number of clicks, and / or the sliding time range.
[0039] In some specific embodiments, before determining the scene corresponding to the page to be tested on the screen, the method further includes: pre-storing a plurality of preset groups of scenes, a plurality of groups of pages to be tested and test data corresponding to each scene.
[0040] In actual applications, there are multiple groups of scenes and pages to be tested. After calculating the fluency data corresponding to the current scene, it is detected whether all scenes of all pages have been tested. If all scenes of all pages have been tested, a test report is output according to the fluency data corresponding to all scenes.
[0041] If there are untested pages and scenes, the next page to be tested is determined, and the step of determining the scene corresponding to the page to be tested on the screen is executed until all pages and the scenes corresponding to the pages are tested, and a test report is output based on the fluency data corresponding to all scenes.
[0042] In some specific embodiments, it also includes: when there is an exception in any step of the test process, the exception is captured and displayed, and the test is stopped.
[0043] In a specific embodiment, the process of obtaining the total number of drawing frames and the number of dropped frames in the click test or the sliding test and calculating the fluency data includes:
[0044] Determine the total test time of the click test or slide test, subtract the number of frames from the total number of drawn frames to get the actual number of drawn frames; divide the actual number of drawn frames by the total test time to get the average frame rate;
[0045] A fluency index is predefined. When the average frame rate reaches the corresponding value of the preset high fluency, the page fluency in this scenario is determined to be good.
[0046] When the average frame rate reaches the corresponding value of the preset fluency, the page fluency in this scenario is determined to be average;
[0047] When the average frame rate reaches a corresponding value of a preset low fluency, it is determined that the page fluency in this scenario is poor.
[0048] In practical applications, the fluency index can also be adjusted to have richer evaluation criteria according to actual needs, such as using the percentage of dropped frames as a judgment indicator.
[0049] In a second aspect, a page fluency testing device is proposed, which is used to implement any page fluency testing method in the aforementioned technical solution, including:
[0050] A scene matching unit is used to determine the scene corresponding to the page to be tested on the screen, and determine the test data corresponding to the scene; different scenes correspond to different test data;
[0051] A testing unit, used to determine a test mode based on test data, and if the test mode is determined to be a click mode, perform a click test on the page; if the test mode is determined to be a slide mode, perform a slide test on the page;
[0052] The calculation unit is used to obtain the total number of drawing frames and the number of dropped frames in the click test or the sliding test, and calculate the fluency data.
[0053] In some specific embodiments, a coordinate conversion unit is further included;
[0054] The coordinate conversion unit is used to obtain the starting coordinates and the ending coordinates of the sliding operation, obtain the screen resolution of the intelligent terminal device, convert the starting coordinates and the ending coordinates according to the screen resolution, and obtain the converted actual starting coordinates and the actual ending coordinates.
[0055] In actual applications, there are multiple groups of scenarios and pages to be tested, and a test report generating unit is also included, which is used to output a test report according to the fluency data corresponding to all scenarios when all scenarios of all pages are tested.
[0056] In an actual application process, the page fluency testing device may be a smart terminal device with a screen; or the page fluency testing process may be implemented by connecting the page fluency testing device to a smart terminal device with a screen.
[0057] Beneficial effects: The present application proposes a method and device for testing page fluency, by determining the scene corresponding to the page to be tested on the screen; in the current scene, determining the test data corresponding to the scene; wherein different scenes correspond to different test data; determining the test mode based on the test data, by performing a click test and / or a sliding test on the page, obtaining the total number of drawing frames and the number of dropped frames in the click test or the sliding test, and finally calculating the fluency data. Through this method and device, it is possible to realize automatic simulation of manual operation to perform page fluency tests of different modes under different scenes and different preset test data, and can automatically and accurately record the total number of drawing frames and the number of dropped frames of the page displayed on the screen of the smart terminal device during the test. It is highly automated and can perform page tests in batches, which can effectively improve the efficiency and accuracy of the test. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0059] Figure 1 A schematic diagram of the steps of the method in this application;
[0060] Figure 2 A schematic diagram of the steps of the click mode in the method of this application;
[0061] Figure 3 This is a schematic diagram of the steps of the first sliding mode in the method of this application;
[0062] Figure 4 This is a schematic diagram of the steps of the second sliding mode in the method of this application;
[0063] Figure 5 Schematic diagram of the connection relationship between the various units of the device in this application.
[0064] Figure numerals: 1 - data storage unit; 2 - scene matching unit; 3 - testing unit; 4 - calculation unit; 5 - coordinate conversion unit; 6 - test report generation unit. DETAILED DESCRIPTION
[0065] In the following, various embodiments of the present disclosure will be described more fully. The present disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of the present disclosure to the specific embodiments disclosed herein, but rather the present disclosure should be understood to cover all adjustments, equivalents and / or alternatives that fall within the spirit and scope of the various embodiments of the present disclosure.
[0066] The terms used in the various embodiments disclosed in the present invention are only used for the purpose of describing specific embodiments and are not intended to limit the various embodiments disclosed in the present invention. As used herein, the singular form is intended to also include the plural form, unless the context clearly indicates otherwise. Unless otherwise specified, all terms used herein (including technical terms and scientific terms) have the same meaning as the meanings commonly understood by ordinary technicians in the field of the various embodiments disclosed in the present invention. Terms (such as terms defined in generally used dictionaries) will be interpreted as having the same meaning as the contextual meaning in the relevant technical field and will not be interpreted as having an idealized meaning or an overly formal meaning, unless clearly defined in the various embodiments disclosed in the present invention.
[0067] Example 1
[0068] This embodiment discloses a method for testing page fluency, which is applied to a smart terminal device with a screen. The specific steps are as follows: Figure 1 As shown, including:
[0069] S100, determining a scene corresponding to a page to be tested on a screen; determining test data corresponding to the scene; different scenes correspond to different test data;
[0070] S200, in the current scenario, determining a test mode based on test data; the test mode includes: a click mode and a slide mode;
[0071] S300: If it is determined that the test mode is the click mode, a click test is performed on the page, where the click test includes sliding and clicking operations on the page;
[0072] S400: If it is determined that the test mode is the sliding mode, a sliding test is performed on the page, where the sliding test includes performing a sliding operation on the page;
[0073] S500: Obtain the total number of drawing frames and the number of dropped frames in the click test or the sliding test, and calculate the fluency data.
[0074] In some specific embodiments, Figure 2 As shown, the click test includes:
[0075] S301, obtaining the starting coordinates and the ending coordinates of the sliding operation;
[0076] S302, after pausing for a preset time, randomly generating a sliding speed of the sliding operation;
[0077] S303, performing sliding operations and clicking operations on the page based on the sliding speed, the preset sliding function and the preset clicking function;
[0078] S304, calculating the sliding time of the sliding operation, and determining the length of the pause time between each click operation and / or sliding operation according to the sliding time;
[0079] S305, updating the sliding speed, and updating the sliding function based on the determined sliding speed;
[0080] S306: Execute the step of “performing sliding and clicking operations on the page” based on the updated sliding speed, the preset click function and the updated sliding function.
[0081] In some specific embodiments, Figure 3 As shown, the sliding mode includes the first sliding mode; if the test mode is determined to be the first sliding mode, the sliding test includes:
[0082] S411, obtaining the starting coordinates and the ending coordinates of the sliding operation;
[0083] S412, after pausing for a preset time, randomly generating a sliding speed of the sliding operation;
[0084] S413, performing a sliding operation on the page based on the sliding speed and a preset sliding function;
[0085] S414, calculating the sliding time, and determining the length of the pause time between each sliding operation according to the sliding time;
[0086] S415, updating the sliding speed of the sliding operation, and updating the sliding function based on the determined sliding speed;
[0087] S416: Execute the step of “performing a sliding operation on the page” based on the updated sliding speed and the updated sliding function.
[0088] In some specific embodiments, Figure 4 As shown, the sliding mode includes the second sliding mode; if the test mode is determined to be the second sliding mode, the sliding test includes:
[0089] S421, obtaining the starting coordinates and the ending coordinates of the sliding operation;
[0090] S422, obtaining a screen resolution of the smart terminal device; converting the starting coordinates and the ending coordinates according to the screen resolution to obtain actual starting coordinates and actual ending coordinates after conversion;
[0091] S423, after pausing for a preset time, randomly generating a sliding speed of the sliding operation;
[0092] S424, performing a sliding operation on the page based on the sliding speed and a preset sliding function;
[0093] S425, calculating the sliding time of the sliding operation, and determining the length of the pause time between each sliding operation according to the sliding time;
[0094] S426, updating the sliding speed of the sliding operation, and updating the sliding function based on the determined sliding speed;
[0095] S427: Execute the step of “performing a sliding operation on the page” based on the updated sliding speed and the updated sliding function.
[0096] In actual applications, a series of steps including updating the sliding speed and "performing a sliding operation on the page" or "performing a click operation and a sliding operation on the page" can be continuously executed in a loop in the click test and the slide test. In a specific embodiment, each scene has corresponding test data, and the conditions for completing the test can be determined by the test data, wherein the conditions for ending the slide test or the click test can be when the sliding in the slide test reaches a preset number of sliding times, the sliding test reaches a preset sliding time, or all frames of the page corresponding to the scene are completed.
[0097] In actual applications, the smart terminal device with a screen can be a mobile phone. In reality, the screen resolutions of different mobile phones of different brands are different, which may cause errors in the sliding test positions of the page on different mobile phones, and the test positions of different mobile phone screen sizes are incompatible. For example, when sliding the same content on the same page, the distance that users need to slide their fingers is actually different on devices with different screen sizes and different screen resolutions.
[0098] Therefore, during the sliding test, by converting the starting and ending coordinates of the sliding operation according to the screen resolution, the sliding operation positions on different device screens can remain unified, further achieving compatibility with the test conditions of smart terminal devices of different brands, and better simulating the user's sliding operation on the screen.
[0099] In some specific embodiments, the process of converting the start coordinates and the end coordinates according to the screen resolution to obtain the converted actual start coordinates and the actual end coordinates includes:
[0100] Get the starting coordinate and the ending coordinate relative to the width percentage parameter x of the page and the height percentage parameter y of the page;
[0101] Multiply x by the number of pixels of the page width corresponding to the screen resolution to obtain the abscissa of the actual starting coordinate and the actual ending coordinate after conversion; multiply y by the number of pixels of the page height corresponding to the screen resolution to obtain the ordinate of the actual starting coordinate and the actual ending coordinate after conversion.
[0102] In some specific embodiments, the test data includes: the width and height percentage parameters of the page, and / or the starting coordinates and ending coordinates corresponding to the sliding test, and / or the number of sliding, and / or the number of clicks, and / or the sliding time range.
[0103] In some specific embodiments, before determining the scene corresponding to the page to be tested on the screen, it also includes pre-storing a plurality of preset groups of scenes, a plurality of groups of pages to be tested and test data corresponding to each scene.
[0104] In actual applications, when the smart terminal device is an Android device, the method of this embodiment can be executed by a Python automation script, wherein the Python automation script can obtain information about the screen resolution of the smart terminal device and execute various functions by calling the Adb module (Android DebugBridge, a tool module for communicating and interacting with Android devices). In a specific embodiment, multiple groups of preset scenarios, multiple groups of pages to be tested, and test data corresponding to each scenario can be pre-stored and packaged into the automation script to facilitate the script to call data during execution.
[0105] In a specific embodiment, each scenario has corresponding test data. The process of determining the test mode through the test data can be judged by the Boolean value of the flag bit of the global variable preset in the script. In a specific embodiment, the global variables of the script include dict_info, is_on_page, and is_start, which are used to store and control the status and information of the current task.
[0106] The global variable dict_info has two flags, is_exact_pos and is_click, which are used to indicate whether to use the existing coordinates and whether to perform a click operation. If both are True, it can be determined that the test mode is click mode;
[0107] If both are not True, it can be determined that the test mode is sliding mode;
[0108] Further, if is_exact_pos is True but is_click is not True, it can be determined that the test mode is the first sliding mode; if is_exact_pos is False, it can be determined that the test mode is the second sliding mode.
[0109] The preset sliding function may be out_hand_swipe, which may simulate the sliding operation of the user's finger; in the sliding operation loop, the return position of the sliding operation may be determined by setting back_pos to the reverse order of the end coordinate and the start coordinate.
[0110] In a specific embodiment, the sliding time w_time is calculated in the script, and time.sleep(w_time) is further used to determine the preset pause time between each sliding operation or clicking operation.
[0111] In actual applications, there are multiple groups of scenes and pages to be tested. After calculating the fluency data corresponding to the current scene, it is detected whether all scenes of all pages have been tested. If all scenes of all pages have been tested, a test report is output based on the fluency data corresponding to all scenes. If there are untested pages and scenes, the next page to be tested is determined, and the step of determining the scene corresponding to the page to be tested on the screen is executed until all pages and the scenes corresponding to the pages are tested, and a test report is output based on the fluency data corresponding to all scenes.
[0112] In some specific embodiments, the method further includes: when any step in the test process has an exception, the exception is captured and displayed, and the test is stopped. When the method is implemented using a Python automation script, is_on_page and is_start may be set to False to stop the execution of the current test.
[0113] In a specific embodiment, the process of obtaining the total number of drawing frames and the number of dropped frames in the click test or the sliding test and calculating the fluency data includes:
[0114] Determine the total test time of the click test or slide test, subtract the number of frames from the total number of drawn frames to get the actual number of drawn frames; divide the actual number of drawn frames by the total test time to get the average frame rate;
[0115] A fluency index is predefined. When the average frame rate reaches the corresponding value of the preset high fluency, the page fluency in this scenario is determined to be good.
[0116] When the average frame rate reaches the corresponding value of the preset fluency, the page fluency in this scenario is determined to be average;
[0117] When the average frame rate reaches a corresponding value of a preset low fluency, it is determined that the page fluency in this scenario is poor.
[0118] In practical applications, the fluency index can also be adjusted to have richer evaluation criteria according to actual needs, such as using the percentage of dropped frames as a judgment indicator.
[0119] This embodiment proposes a method for testing page fluency, by determining the scene corresponding to the page to be tested on the screen; in the current scene, determining the test data corresponding to the scene; wherein different scenes correspond to different test data; determining the test mode based on the test data, by performing a click test and / or a sliding test on the page, obtaining the total number of drawing frames and the number of dropped frames in the click test or the sliding test, and finally calculating the fluency data. It realizes automatic simulation of manual operation to perform page fluency tests of different modes under different scenes and different preset test data, and can automatically and accurately record the total number of drawing frames and the number of dropped frames of the page displayed on the screen of the smart terminal device during the test. It is highly automated and can perform page tests in batches, which can effectively improve the efficiency and accuracy of the test. Furthermore, it can also solve the problem of inconsistent sliding operations caused by different screen resolutions of smart terminal devices, and realize test compatibility between multiple devices.
[0120] Example 2
[0121] This embodiment discloses a device for testing page fluency, which can be used to implement any of the methods for testing page fluency in the above technical solutions, including:
[0122] A scene matching unit 2 is used to determine a scene corresponding to the page to be tested on the screen, and determine test data corresponding to the scene; different scenes correspond to different test data;
[0123] A testing unit 3 is used to determine a test mode based on the test data, and if the test mode is determined to be a click mode, a click test is performed on the page, wherein the click test includes sliding and clicking operations on the page; if the test mode is determined to be a sliding mode, a sliding test is performed on the page, wherein the sliding test includes sliding operations on the page;
[0124] The calculation unit 4 is used to obtain the total number of drawing frames and the number of dropped frames in the click test or the sliding test, and calculate the fluency data.
[0125] In some specific embodiments, a coordinate conversion unit 5 is also included; the coordinate conversion unit 5 is used to obtain the starting coordinates and the ending coordinates of the sliding operation, obtain the screen resolution of the smart terminal device, convert the starting coordinates and the ending coordinates according to the screen resolution, and obtain the actual starting coordinates and the actual ending coordinates after the conversion.
[0126] In some specific embodiments, a data storage unit 1 is also included, which is used to pre-store multiple preset groups of scenes, multiple groups of pages to be tested, and test data corresponding to each scene. In actual applications, by pre-storing multiple groups of scenes, multiple groups of pages to be tested, and test data corresponding to each scene, the scene matching unit 2 and the test unit 3 can quickly call the test data required for their tests in the subsequent test process. In some specific embodiments, the test data includes: the width and height percentage parameters of the page, and / or the starting coordinates and ending coordinates corresponding to the sliding test, and / or the number of sliding times, and / or the number of clicks, and / or the sliding time range.
[0127] In a specific embodiment, the starting coordinates and ending coordinates of the sliding operation can be obtained in advance from the test data corresponding to each scene, and the screen resolution of the smart terminal device can be obtained, and the actual starting coordinates and actual ending coordinates corresponding to the sliding operation of each scene can be converted in advance, and pre-stored in the data storage unit 1 to facilitate quick calling during the test process.
[0128] In actual applications, there are multiple groups of scenarios and pages to be tested, and a test report generating unit 6 is also included, which is used to output a test report according to the fluency data corresponding to all scenarios obtained by the calculating unit 4 when all scenarios of all pages are tested.
[0129] In an actual application process, the page fluency testing device can also be an intelligent terminal device with a screen, such as a computer; in a testing process, the page fluency test can be achieved by connecting the page fluency testing device to an intelligent terminal device with a screen, such as a mobile phone.
[0130] After the test is completed, the fluency data obtained from multiple test scenarios can be further saved in a local csv file for subsequent analysis and comparison.
[0131] One of the connection relationships between the units is as follows Figure 5 As shown, the data storage unit 1 is respectively connected to the coordinate conversion unit 5, the scene matching unit 2 and the test unit 3; the coordinate conversion unit 5 is also connected to the test unit 3; the test unit 3 is also respectively connected to the scene matching unit 2 and the calculation unit 4; and the test report generation unit 6 is connected to the calculation unit 4.
[0132] The present embodiment provides a device for testing page fluency, which can be used to implement any of the page fluency testing methods in the above technical solutions. Click tests and / or sliding tests can be performed on the page, the total number of drawing frames and the number of dropped frames in the click test or the sliding test can be obtained, and the fluency data can be finally calculated. Further, a test report file can be obtained based on the fluency data, and it can realize automatic simulation of manual operation to perform page fluency tests in different modes under different scenarios and different preset test data, and automatically and accurately record the total number of drawing frames and the number of dropped frames of the page displayed on the screen of the smart terminal device during the test, so as to achieve highly automated testing, batch page testing, and effectively improve the efficiency and accuracy of the test. Furthermore, it can also solve the problem of inconsistent sliding operations caused by different screen resolutions of smart terminal devices, and achieve test compatibility between multiple devices.
[0133] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for the implementation of the present invention. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenarios can be combined into one module, or can be further divided into multiple sub-modules. The above-mentioned serial numbers of the present invention are only for description and do not represent the advantages and disadvantages of the implementation scenarios. Disclosed above are only a few specific implementation scenarios of the present invention, but the present invention is not limited thereto, and any changes that can be thought of by those skilled in the art should fall within the scope of protection of the present invention.
Claims
1. A method for testing page fluency, characterized in that: The method is applied to a smart terminal device having a screen; the specific steps include: Determining a scenario corresponding to the page to be tested on the screen; In the current scenario, determining the test data corresponding to the scenario; different scenarios correspond to different test data; Determine a test mode based on the test data; the test mode includes: a click mode and a slide mode; If it is determined that the test mode is the click mode, a click test is performed on the page, wherein the click test includes performing a sliding operation and a click operation on the page; If it is determined that the test mode is the sliding mode, performing a sliding test on the page, the sliding test including performing a sliding operation on the page; The total number of drawing frames and the number of dropped frames in the click test or the sliding test are obtained, and the fluency data is calculated.
2. A method for testing page fluency according to claim 1, characterized in that: The click test includes: Obtaining the starting coordinates and the ending coordinates of the sliding operation; After pausing for a preset time, randomly generating a sliding speed of the sliding operation; performing the sliding operation and the clicking operation on the page based on the sliding speed, a preset sliding function, and a preset clicking function; Calculating a sliding time of the sliding operation, and determining a length of a pause time between each of the clicking operations and / or the sliding operations according to the sliding time; updating the sliding speed, and updating the sliding function based on the determined sliding speed; The step of "performing the sliding operation and the clicking operation on the page" is performed based on the updated sliding speed, the preset click function and the updated sliding function.
3. A method for testing page fluency according to claim 1, characterized in that: The sliding mode includes a first sliding mode; if it is determined that the test mode is the first sliding mode, the sliding test includes: Obtaining the starting coordinates and the ending coordinates of the sliding operation; After pausing for a preset time, randomly generating a sliding speed of the sliding operation; Perform the sliding operation on the page based on the sliding speed and a preset sliding function; Calculating a sliding time, and determining the length of a pause time between each sliding operation according to the sliding time; updating the sliding speed of the sliding operation, and updating the sliding function based on the determined sliding speed; The step of "performing the sliding operation on the page" is performed based on the updated sliding speed and the updated sliding function.
4. A method for testing page fluency according to claim 1, characterized in that: The sliding mode includes a second sliding mode; if it is determined that the test mode is the second sliding mode, the sliding test includes: Obtaining the starting coordinates and the ending coordinates of the sliding operation; Obtaining the screen resolution of the smart terminal device; Convert the starting coordinates and the ending coordinates according to the screen resolution to obtain actual starting coordinates and actual ending coordinates after conversion; After pausing for a preset time, randomly generating a sliding speed of the sliding operation, and performing the sliding operation on the page based on the sliding speed and a preset sliding function; Calculating a sliding time of the sliding operation, and determining a length of a pause time between each sliding operation according to the sliding time; updating the sliding speed of the sliding operation, and updating the sliding function based on the determined sliding speed; The step of "performing the sliding operation on the page" is performed based on the updated sliding speed and the updated sliding function.
5. A method for testing page fluency according to claim 4, characterized in that: The process of converting the starting coordinates and the ending coordinates according to the screen resolution to obtain the converted actual starting coordinates and the actual ending coordinates includes: Obtaining a width percentage parameter x of the start coordinate and the end coordinate relative to the page and a height percentage parameter y of the page; Multiply x by the number of pixels of the page width corresponding to the screen resolution to obtain the converted horizontal coordinates of the actual starting coordinate and the actual ending coordinate; multiply y by the number of pixels of the page height corresponding to the screen resolution to obtain the converted vertical coordinates of the actual starting coordinate and the actual ending coordinate.
6. A method for testing page fluency according to claim 1, characterized in that: The test data includes: the width and height percentage parameters of the page, and / or the starting coordinates and the ending coordinates corresponding to the sliding test, and / or the number of sliding times, and / or the number of clicks, and / or the sliding time range.
7. A method for testing page fluency according to claim 1, characterized in that: Before determining the scenario corresponding to the page to be tested on the screen, the method further includes: Preset multiple groups of the scenarios, multiple groups of the pages to be tested, and the test data corresponding to each scenario are pre-stored.
8. A method for testing page fluency according to claim 1, characterized in that: Also includes: When an exception occurs in any step of the test process, the exception is captured and displayed, and the test is stopped.
9. A device for testing page fluency, characterized in that: The device is used to implement the page fluency testing method according to any one of claims 1 to 8; comprising: A scene matching unit, used to determine a scene corresponding to the page to be tested on the screen, and determine test data corresponding to the scene; different scenes correspond to different test data; a testing unit, configured to determine a test mode based on the test data, and if the test mode is determined to be a click mode, perform a click test on the page; if the test mode is determined to be a slide mode, perform a slide test on the page; The calculation unit is used to obtain the total number of drawing frames and the number of dropped frames in the click test or the sliding test, and calculate the fluency data.
10. A device for testing page fluency according to claim 9, characterized in that: Also includes a coordinate conversion unit; The coordinate conversion unit is used to obtain the starting coordinates and the ending coordinates of the sliding operation, obtain the screen resolution of the smart terminal device, and convert the starting coordinates and the ending coordinates according to the screen resolution to obtain the converted actual starting coordinates and the actual ending coordinates.
