An automated testing method for browser screen recording

By collecting operation behavior and screen change data on the browser, building and adjusting test containers and environment containers, the problem of inefficient testing of existing automated testing solutions when software functions are updated is solved, and efficient and accurate automated testing is achieved.

CN119807077BActive Publication Date: 2025-06-10ZHONGHE YUNKE INFORMATION TECH GRP CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510286614.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-12
Publication Date
2025-06-10
Estimated Expiration
2045-03-12

AI Technical Summary

Technical Problem

When software functions are added and updated, existing automated testing solutions require continuous writing and maintenance of a large number of test cases, resulting in inefficient testing, waste of resources and insufficient test coverage.

Method used

By obtaining the user's operating behavior parameters on the browser, building a test container and performing layered processing, simulating the browser environment of different devices for testing, analyzing the code coverage and screen change rate, and adjusting the test environment container to improve testing efficiency.

Benefits of technology

It effectively reduces the regeneration workload of test scripts and test environment frameworks, improves the accuracy and timeliness of automated tests, supports parallel execution of multiple test cases, shortens the test cycle, and improves code compatibility and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807077B_ABST
    Figure CN119807077B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of protocol detection, and particularly to an automated test method for browser screen recording, including: obtaining operation behavior parameters of a user's operations on a browser, and calculating to obtain operation data; converting the operation data into a number of test containers, performing hierarchical processing on each test container, and encapsulating it with the operation behavior parameters; simulating browsers in a number of different devices to build a number of environment containers, analyzing to obtain the code coverage rate, and combining it with the screen change rate to determine the running situation of the code in the test containers; calculating the effective value of the environment containers in combination with the code coverage rate corresponding to each test container; storing the qualified environment containers, calling similar environment containers according to the similarity value for the next simulation run, and adjusting the similar environment containers according to the results of the next simulation run to generate new environment containers; the present invention effectively improves the accuracy and timeliness of the automated test for browser screen recording.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of protocol detection, and particularly to an automated test method for browser screen recording. Background Art

[0002] Automated testing is a crucial part in ensuring software quality. However, there are some significant deficiencies in existing automated test solutions. Writing and maintaining a large number of test cases, as the software functions increase and are updated, the test team needs to continuously write and maintain a large number of test cases. This process is not only time-consuming and laborious but also error-prone, leading to low test efficiency. Test cases often need to be repeatedly executed for different versions and environments, resulting in waste of resources and reduced test efficiency. Whenever the software code changes, regression testing needs to be performed to ensure the new changes. Due to the large amount of work in writing and maintaining test cases, some test cases have insufficient coverage and cannot comprehensively verify the functions and performance of the software. As software requirements change and the technology stack is updated, existing test cases need to be adjusted and optimized accordingly, but this process is often difficult, making it hard to maintain test cases.

[0003] Chinese Patent Application Publication No.: CN118760420A discloses a Grid-based cross-terminal responsive design system and method. This invention discloses a Grid-based cross-terminal responsive design system and method, which relates to the technical field of web page responsive design, including a cross-terminal responsive design platform. The cross-terminal responsive design platform is communicatively connected to a device detection and recognition module, a Grid layout design module, a breakpoint management module, a content adaptive adjustment module, a dynamic content management module, and a feedback module. Among them, the modules are electrically connected; the device detection and recognition module is used to detect and obtain the characteristic information of the screen size, resolution, operating system, and browser type of the access device; the Grid layout design module is used to design a web page layout framework based on CSS Grid. This invention ensures that web page content is displayed in the most optimized way on different devices and screen sizes. Through a predefined grid structure and flexible responsive rules, it automatically adapts to various screen sizes and resolutions, providing users with a consistent and smooth visual experience.

[0004] Chinese Patent Application Publication No.: CN113703749A discloses an information system based on visual programming technology and a construction method thereof. The invention provides an information system based on visual programming technology and a construction method thereof, belonging to the technical field of software information system development. The information system based on visual programming technology includes a bottom component module, a data model module, a visual programming module, and an automated deployment module. The bottom component module contains several components that can be used in all aspects of the operation of the information system. The data model module is a set of component libraries for operating the data required by the information system. The visual programming module provides a set of what-you-see-is-what-you-get software design tools. The automated deployment module takes over the remaining code automatic generation and deployment links after the application program developed by the system user is completed. The invention provides a new method for constructing software application systems and information systems, which consists of component developers, system users, and system administrators, enabling enterprises to save costs when developing new business applications.

[0005] It can be seen that in the prior art, it is not possible to effectively generate and adjust test scripts and test environment frameworks after simulating code operation by combining the collected operation data of the screen and the browser, so as to reduce the workload of subsequent re-generation of scripts and test environment frameworks. Summary of the Invention

[0006] Therefore, the present invention provides an automated test method for browser screen recording to overcome the problem that in the prior art, it is not possible to effectively generate and adjust test scripts and test environment frameworks after simulating code operation by combining the collected operation data of the screen and the browser, so as to reduce the workload of subsequent re-generation of scripts and test environment frameworks.

[0007] To achieve the above object, the present invention provides an automated test method for browser screen recording, including:

[0008] Obtain the operation behavior parameters of the user's operations on the browser, and calculate the operation data;

[0009] Use the operation data to construct several test containers, and after hierarchical processing of each test container, encapsulate it with the operation behavior parameters;

[0010] Simulate browsers in several different devices to build several environment containers, put each test container into the environment container for simulated operation to obtain the code coverage rate, and combine the code coverage rate with the screen change rate to determine the running situation of the code in the test container;

[0011] Determine the effective weighted values of each of the test containers according to the results of the hierarchical processing, calculate the effective value of the environment container by combining the code coverage rates corresponding to each of the test containers, and determine whether the environment container is qualified based on the effective value;

[0012] Store the qualified environment containers, call similar environment containers according to the similarity value for the next simulation run, and adjust the similar environment containers according to the results of the next simulation run to generate new environment containers.

[0013] Furthermore, the process of obtaining the screen change parameters before and after putting each of the test containers into the environment container for the simulation run and calculating the screen change rate includes:

[0014] Record the changes in window size and pixel density on the screen before and after putting each of the test containers into the environment container for the simulation run;

[0015] Calculate the window size change rate according to the change in window size, and calculate the pixel density change rate according to the change in pixel density;

[0016] Calculate the screen change rate by combining the window size change rate and the pixel density change rate.

[0017] Furthermore, the process of converting the operation data into the test containers includes:

[0018] Clean the operation data to generate unit data;

[0019] Extract the key information in the unit data to construct an image;

[0020] Construct the test containers according to the image;

[0021] Wherein, the unit data is the smallest data set that the test containers can run completely.

[0022] Furthermore, the process of encapsulating each of the test containers after hierarchical processing with the operation behavior parameters includes:

[0023] Allocate according to the running results of each of the test containers to the basic layer, professional layer, and interface layer;

[0024] Associate and map the operation behavior parameters with the corresponding test containers;

[0025] Configure encapsulation parameters;

[0026] Wherein, the basic layer is the common data layer for the operation of each system, the professional layer is the data layer for the operation of professional systems, and the interface layer is the data layer for connecting each system for interaction.

[0027] Further, the process of simulating the construction of several of the environment containers in browsers of several different devices includes:

[0028] Determine the device type and browser configuration;

[0029] Customize an environment image according to the device type and the browser configuration;

[0030] Create the environment container based on the environment image.

[0031] Further, the process of placing each of the test containers into the environment container for simulation operation and analyzing to obtain the code coverage rate includes:

[0032] Deploy each of the test containers to the environment container;

[0033] Start the environment container and record the code coverage rate of each of the test containers.

[0034] Further, determine that the running condition of the code in the test container is normal, has code errors, has code redundancy, or has code missing based on the code coverage rate and the screen change rate.

[0035] Further, the process of determining the effective weighted value of each of the test containers according to the result of the hierarchical processing and calculating the effective value of the environment container by combining the code coverage rate corresponding to each of the test containers includes:

[0036] Select the environment containers in which the running condition of the code in each of the test containers is normal;

[0037] Determine the effective weighted value of each of the test containers running in the environment container according to the result of the hierarchical processing;

[0038] Calculate the effective value of the environment container by combining the effective weighted value and the code coverage rate of each of the test containers.

[0039] Further, compare the effective value of the environment container with a preset effective value, and determine whether the environment container is qualified according to the comparison result, where

[0040] The preset effective value is positively correlated with the total number of test containers included in the environment container.

[0041] Further, the process of calling a similar environment container for the next simulation operation according to a similarity value and adjusting the similar environment container to generate a new environment container according to the result of the next simulation operation includes:

[0042] Obtain a similarity value by comparing and calculating an existing environment container and the operation behavior parameters of the user's next operation;

[0043] Compare the similarity value with a preset similarity value, and determine a similar environment container according to the comparison result;

[0044] Perform the next simulation run on the similar environment container, compare it with the result of the user's next operation, and adjust the similar environment container according to the comparison result to generate a new environment container.

[0045] Compared with the prior art, the beneficial effects of the present invention are as follows. By collecting the operation behaviors and screen changes when the user operates on the browser, the present invention effectively records the user operation process. By analyzing the recorded operation process, it can be clearly seen the difficulties and obstacles encountered by the user during the use of the product, and the cumbersome links in the process can also be found. According to the operation sequence and path of the user, the page layout can be optimized. Place the function buttons frequently used by the user in more prominent and easy-to-operate positions, reduce the user's operation steps and time, and at the same time intuitively and comprehensively record the operations performed by the user on the browser, providing comprehensive parameters for subsequent automated testing. At the same time, when there is a large deviation between the collected operation behavior and the baseline model, the abnormality can be detected in time, and when the user feedbacks that the product has problems, the operation record can help the developer quickly locate the problem. According to the screen changes and operation response time in the operation record, the performance of the product is evaluated, improving the accuracy and timeliness of the automated testing for browser screen recording.

[0046] Furthermore, in the present invention, each test container is processed in layers and then encapsulated with the operation behavior parameters. The layered processing allows test containers at different levels to run independently. By utilizing the characteristics of containerization technologies such as Docker, multiple test containers can be easily executed in parallel. The environment construction of the basic layer, the business logic test of the professional layer, and the interaction test of the interface layer can be carried out at the same time, which greatly shortens the overall test time. In large projects, the tests of each part originally needed to be completed in sequence. Now, after parallel processing, the test cycle may be shortened from several days to several hours. After layered encapsulation, each test container can accurately allocate resources according to its own needs to avoid waste of resources. The basic layer container is mainly responsible for providing a stable operating environment, which is very important for C The requirements for PU and memory are relatively fixed, while professional-layer containers may require more computing resources when conducting complex business logic tests. By allocating resources reasonably, the system can run more efficiently and support the simultaneous execution of more test cases. Layered processing divides the test system into different functional modules. Each module has clear responsibilities. When problems occur during the test, the source of the fault can be quickly located according to the level where the problem occurs. Layered encapsulation facilitates reuse. After layered processing, the architecture of the test system is clearer, and the functions and responsibilities of each level are clear. This makes it easier for developers and testers to understand the overall structure of the system, facilitates subsequent maintenance and expansion, and further improves the accuracy and timeliness of automated testing for browser screen recording.

[0047] Further, in the present invention, several environment containers are built by simulating browsers in several different devices, and the running situation of the test container code is analyzed. By testing through the environment containers that simulate browsers of various devices, it can be ensured that the code can run normally on various mainstream devices and browsers, avoiding compatibility problems such as page layout disorder and function inaccessibility. Different browser and device environments may trigger potential vulnerabilities in the code. Some old versions of browsers may not support certain security mechanisms perfectly, or the special hardware characteristics of some mobile devices may cause abnormalities in the code when processing data. By testing through simulating multiple environments, these potential vulnerabilities can be discovered more comprehensively and repaired in advance, enhancing the security and stability of the product. With the popularization of mobile devices, users may access the product on various devices such as mobile phones, tablets, and computers. Simulating the browser environments of different devices for testing can ensure that the product can provide a consistent and good user experience on various devices. For example, when browsing the web on a mobile phone, the page layout should adapt to the size of the mobile phone screen, and the size and spacing of the operation buttons should be suitable for finger clicking; on a tablet, more rich interaction functions may be required. Through testing, the code can be adjusted in time to meet the needs of users of different devices. The performance and network environment of different devices vary greatly. Testing the running situation of the code in the simulated environment container can evaluate the response speed of the code on different devices, find out the performance bottlenecks and optimize them. Building the environment container can realize the reuse of the test environment, avoiding the need to manually configure different device and browser environments every time for testing. Developers and testers can conveniently run the test code in different environment containers, improving the efficiency of testing and further enhancing the accuracy and timeliness of the automated test for browser screen recording.

[0048] Furthermore, in the present invention, the stored environment container is applied to the next simulation run, and the environment container is adjusted according to the operation result to obtain a new environment container for storage. Each time a simulation run is performed, there is no need to rebuild a complex test or operation environment from scratch. Instead, the stored environment container can be directly used to quickly deploy the same or similar environment, significantly saving time. In the iterative cycle of software development, quickly verifying new functions or fixing problems is crucial. By using the stored environment container, simulation runs can be quickly carried out, and the operation results can be obtained in a timely manner, thereby accelerating the iterative process of development and testing. The stored environment container retains specific software versions, configuration parameters, and dependency relationships, ensuring that the environment for each simulation run remains consistent. This helps to eliminate the problem of inconsistent test results caused by environmental differences. According to the simulation run results, the resource configuration of the environment container can be adjusted, and the operation results can also reflect the rationality of certain configuration parameters in the environment container. As business requirements change continuously, software systems need to be updated and optimized continuously. The stored environment container can be used as a basis to be adjusted and expanded according to new requirements to generate new environment containers, further improving the accuracy and timeliness of the automated test for browser screen recording. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 is a flowchart of the automated test method for browser screen recording according to the present invention;

[0050] Figure 2 is a logic diagram for determining the running situation of the code in the test container in an embodiment of the present invention;

[0051] Figure 3 is a flowchart for calculating the effective value of the environment container in an embodiment of the present invention;

[0052] Figure 4 is a logic diagram for determining whether the environment container is qualified in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0053] In order to make the objectives and advantages of the present invention more clearly understood, the present invention will be further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0054] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present invention and do not limit the protection scope of the present invention.

[0055] It should be noted that in the description of the present invention, the terms indicating directions or positional relationships such as "upper", "lower", "left", "right", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings. This is only for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation to the present invention.

[0056] In addition, it should be noted that in the description of the present invention, unless otherwise clearly specified and defined, the terms "installation", "connection", and "coupling" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two elements. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.

[0057] Please refer to Figure 1 as shown in the figure, which is a flowchart of an automated test method for browser screen recording according to the present invention. An embodiment of the present invention provides an automated test method for browser screen recording, including:

[0058] Step S1, obtaining the operation behavior parameters of the user's operations on the browser and calculating the operation data;

[0059] Step S2, using the operation data to construct several test containers, performing hierarchical processing on each test container, and then encapsulating them with the operation behavior parameters;

[0060] Step S3, simulating browsers in several different devices to build several environment containers, putting each test container into the environment container for simulated operation to obtain the code coverage rate, and determining the running situation of the code in the test container by combining the code coverage rate with the screen change rate;

[0061] Step S4, determining the effective weighted value of each test container according to the result of the hierarchical processing, calculating the effective value of the environment container by combining the code coverage rate corresponding to each test container, and determining whether the environment container is qualified based on the effective value;

[0062] Step S5, storing the qualified environment containers, calling similar environment containers according to the similarity value for the next simulated operation, and adjusting the similar environment containers according to the result of the next simulated operation to generate new environment containers.

[0063] Specifically, in step S3, the process of obtaining the screen change parameters before and after putting each test container into the environment container for simulated operation and calculating the screen change rate includes:

[0064] Record the changes in window size and pixel density on the screen before and after each test container is placed in the environmental container for simulated operation;

[0065] Calculate the window size change rate based on the change in window size, and calculate the pixel density change rate based on the change in pixel density;

[0066] Calculate the screen change rate by combining the window size change rate and the pixel density change rate.

[0067] In a specific embodiment, the screen change rate = window size change rate + pixel density change rate;

[0068] In implementation, for example, after test container A is placed in environmental container N for simulated operation, the window size on the screen increases by 15%, then the window size change rate is 0.15, and the pixel density increases by 24%, then the pixel density change rate is 0.24. The screen change rate of test container A is 0.15 + 0.24 = 0.39.

[0069] Specifically, the present invention effectively records the user's operation process by collecting the operation behavior and screen changes when the user operates on the browser. By analyzing the recorded operation process, it is possible to clearly see the difficulties and obstacles encountered by the user during the use of the product, and it is also possible to discover the cumbersome links in the process. According to the user's operation sequence and path, the page layout can be optimized. Place the function buttons commonly used by the user in more prominent and easy-to-operate positions, reduce the user's operation steps and time, and at the same time intuitively and comprehensively record the operations performed by the user on the browser, providing comprehensive parameters for subsequent automated testing. At the same time, when there is a large deviation between the collected operation behavior and the baseline model, anomalies can be detected in a timely manner, and when the user reports problems with the product, the operation record can help developers quickly locate the problem. According to the screen changes and operation response times in the operation record, the performance of the product can be evaluated, improving the accuracy and timeliness of the automated testing for browser screen recording.

[0070] Specifically, in step S2, the process of converting operation data into a test container includes:

[0071] Clean the operation data to generate unit data;

[0072] Extract the key information in the unit data to construct an image;

[0073] Construct a test container based on the image;

[0074] Among them, the unit data is the smallest data set that the test container can run completely.

[0075] It is understandable that the operation data is cleaned and processed to generate unit data. The missing values, duplicate values, and outliers in the operation data are processed, and then data segmentation, data integration, and data verification are performed to obtain the unit data.

[0076] It is understandable that constructing an image by extracting key information from the data and constructing a test container based on the image are prior arts that are easily obtained by those skilled in the art and will not be elaborated herein.

[0077] Specifically, in step S2, the process of encapsulating each test container after hierarchical processing with operation behavior parameters includes:

[0078] Allocating according to the running results of each test container to the basic layer, professional layer, and interface layer;

[0079] Associating and mapping the operation behavior parameters with the corresponding test containers;

[0080] Configuring encapsulation parameters;

[0081] Among them, the basic layer is the general data layer for the operation of each system, the professional layer is the data layer for the operation of professional systems, and the interface layer is the data layer for connecting each system for interaction.

[0082] It is understandable that the basic layer contains those parts that provide basic support and general functions for the entire system, such as the underlying architecture of the system, basic data processing modules, public services, etc. If the running results of the test container show that its function is to implement basic data storage, reading, or provide basic capabilities such as general computing and communication, it is allocated to the basic layer.

[0083] It is understandable that the professional layer is involved in the implementation of specific fields or professional functions, with strong professionalism and pertinence. When the running results of the test container indicate that its function is related to a certain specific professional field, such as report generation and tax calculation in the financial field, medical record management and diagnostic assistance in the medical field, etc., it is classified into the professional layer.

[0084] It is understandable that the interface layer is mainly responsible for the interaction and data transmission between different systems, modules, or components, playing a role of connection and adaptation. If the running results of the test container show its functions in aspects such as interface call between test systems, data format conversion, and protocol adaptation, then it is allocated to the interface layer.

[0085] It is understandable that for those skilled in the art, associating and mapping the operation behavior parameters with the corresponding test containers and configuring the encapsulation parameters are obvious and will not be elaborated herein.

[0086] Specifically, in the present invention, after layering each test container and encapsulating it with operation behavior parameters, the layering process enables different levels of test containers to run independently. Utilizing the characteristics of containerization technologies such as Docker, parallel execution of multiple test containers can be easily achieved. The environment setup at the basic layer, the business logic testing at the professional layer, and the interaction testing at the interface layer can be carried out simultaneously, greatly shortening the overall testing time. In large projects, where each part of the test originally needed to be completed sequentially, now with parallel processing, the testing cycle can be shortened from several days to several hours. After layering and encapsulation, each test container can accurately allocate resources according to its own needs, avoiding waste of resources. The basic layer containers are mainly responsible for providing a stable operating environment, with relatively fixed requirements for CPU and memory, while the professional layer containers may require more computing resources when conducting complex business logic tests. By reasonably allocating resources, the system can operate more efficiently and support the execution of more test cases simultaneously. The layering process divides the test system into different functional modules, each with clear responsibilities. When problems occur during the testing process, the source of the failure can be quickly located according to the layer where the problem lies. Layering and encapsulation facilitate reuse. After layering, the architecture of the test system becomes clearer, with the functions and responsibilities of each layer clearly defined. This makes it easier for developers and testers to understand the overall structure of the system, facilitating subsequent maintenance and expansion, and further improving the accuracy and timeliness of the automated testing for browser screen recording.

[0087] Specifically, in step S3, the process of simulating the creation of several environment containers for browsers in several different devices includes:

[0088] Determine the device type and browser configuration;

[0089] Customize the environment image according to the device type and browser configuration;

[0090] Create an environment container based on the environment image.

[0091] Specifically, in step S3, the process of placing each test container into the environment container for simulated operation and analyzing the code coverage rate includes:

[0092] Deploy each test container to the environment container;

[0093] Start the environment container and record the code coverage rate of each test container.

[0094] Specifically, in the present invention, several environment containers are built by simulating browsers in several different devices, and the running situation of the test container code is analyzed. By testing through the environment containers that simulate browsers of various devices, it can be ensured that the code can run normally on various mainstream devices and browsers, avoiding compatibility problems such as page layout disorders and functions being unusable. Different browser and device environments may trigger potential vulnerabilities in the code. Some old versions of browsers may not support certain security mechanisms perfectly, or the special hardware characteristics of some mobile devices may cause abnormalities in the code when processing data. By testing through simulating various environments, these potential vulnerabilities can be discovered more comprehensively and repaired in advance, enhancing the security and stability of the product. With the popularization of mobile devices, users may access the product on various devices such as mobile phones, tablets, and computers. Simulating the browser environments of different devices for testing can ensure that the product can provide a consistent and good user experience on various devices. For example, when browsing a web page on a mobile phone, the page layout should be able to adapt to the size of the mobile phone screen, and the size and spacing of the operation buttons should be suitable for finger clicks; on a tablet, more rich interaction functions may be required. Through testing, the code can be adjusted in time to meet the needs of users of different devices. The performance and network environments of different devices vary greatly. Testing the running situation of the code in the simulated environment container can evaluate the response speed of the code on different devices, find out the performance bottlenecks and optimize them. Building the environment container can realize the reuse of the test environment, avoiding the need to manually configure different devices and browser environments every time for testing. Developers and testers can conveniently run the test code in different environment containers, improving the efficiency of testing and further improving the accuracy and timeliness of the automated testing for browser screen recording.

[0095] Please refer to Figure 2 as shown, which is the logic diagram for determining the running situation of the code in the test container in the embodiment of the present invention. In step S3, based on the code coverage rate and the screen change rate, it is determined whether the running situation of the code in the test container is normal, code error, code redundancy, or code missing.

[0096] Among them, if the code coverage rate is greater than the preset coverage rate and the screen change rate is less than or equal to the preset change rate, it is determined that the running situation of the code in the test container is normal;

[0097] if the code coverage rate is greater than the preset coverage rate and the screen change rate is greater than the preset change rate, it is determined that the running situation of the code in the test container is a code error;

[0098] if the code coverage rate is less than or equal to the preset coverage rate and the screen change rate is greater than the preset change rate, it is determined that the running situation of the code in the test container is code missing;

[0099] If the code coverage rate is less than or equal to the preset coverage rate and the screen change rate is less than or equal to the preset change rate, it is determined that the running situation of the code in the test container is code redundancy;

[0100] In implementation, usually the preset coverage rate can be 95% and the preset change rate can be 10%. If the code coverage rate is 98% which is greater than the preset coverage rate and the screen change rate is 5% which is less than the preset change rate, it is determined that the running situation of the code in the test container is normal;

[0101] If the code coverage rate is 98% which is greater than the preset coverage rate and the screen change rate is 17% which is greater than the preset change rate, it is determined that the running situation of the code in the test container is code error;

[0102] If the code coverage rate is 87% which is less than the preset coverage rate and the screen change rate is 17% which is greater than the preset change rate, it is determined that the running situation of the code in the test container is code missing;

[0103] If the code coverage rate is 87% which is less than the preset coverage rate and the screen change rate is 5% which is less than the preset change rate, it is determined that the running situation of the code in the test container is code redundancy;

[0104] The preset coverage rate is negatively correlated with the total number of test containers participating in the simulation run, and the preset change rate is positively correlated with the total number of test containers participating in the simulation run.

[0105] It can be understood that when the amount of code contained in a single test container is not much different, the more the total number of test containers participating in the simulation run, the more the total amount of code, the more complex the logic and conditional judgments between the codes, the increase in test difficulty, the decrease in code coverage rate, so the preset coverage rate decreases.

[0106] Optionally, the total number of test containers participating in the simulation run is 2, and the preset coverage rate is 95%;

[0107] The total number of test containers participating in the simulation run is 5, and the preset coverage rate is 85%;

[0108] The total number of test containers participating in the simulation run is 10, and the preset coverage rate is 70%.

[0109] It can be understood that when the amount of code contained in a single test container is not much different, the more the total number of test containers participating in the simulation run, the more the total amount of code, the more complex the logic and conditional judgments between the codes, the increase in test difficulty, and the need to process and update more pixel information, so the preset change rate increases.

[0110] Optionally, the total number of test containers participating in the simulation run is 2, and the preset change rate is 10%;

[0111] The total number of test containers participating in the simulation run is 5, and the preset change rate is 15%;

[0112] The total number of test containers participating in the simulation run is 10, and the preset change rate is 20%.

[0113] Please refer to Figure 3 As shown, it is a flowchart for calculating the effective value of the environment container in an embodiment of the present invention. In step S4, the process of determining the effective weighted value of each test container according to the result of hierarchical processing and calculating the effective value of the environment container in combination with the code coverage corresponding to each test container includes:

[0114] Step S41, select the environment containers in which the running status of the code in each test container is normal;

[0115] Step S42, determine the effective weighted value of each test container running in the environment container according to the result of hierarchical processing;

[0116] Step S43, calculate the effective value of the environment container in combination with the effective weighted value and code coverage of each test container.

[0117] The effective value of the environment container is the sum of the products of the effective weights and code coverages of each group of test containers contained therein.

[0118] In a specific implementation, the environment containers in which the running status of the code in each test container is normal include 3 groups of test containers. Test container A belongs to the basic layer, with a code coverage of 98% and a weighted value of 0.3. Test container B belongs to the professional layer, with a code coverage of 96% and a weighted value of 0.5. Test container C belongs to the basic layer, with a code coverage of 93% and a weighted value of 0.2. The effective value of the environment container is 0.98 * 0.3 + 0.96 * 0.5 + 0.93 * 0.2 = 0.294 + 0.48 + 0.186 = 0.96.

[0119] Please refer to Figure 4 As shown, it is a logic diagram for determining whether the environment container is qualified in an embodiment of the present invention. In step S4, compare the effective value of the environment container with the preset effective value, and determine whether the environment container is qualified according to the comparison result. Among them,

[0120] If the effective value of the environment container is greater than or equal to the preset effective value, it is determined that the environment container is qualified;

[0121] If the effective value of the environment container is less than the preset effective value, it is determined that the environment container is unqualified;

[0122] In the implementation, the preset effective value is 1.2. If the effective value of the environment container is 1.6, which is greater than the preset effective value, it is determined that the environment container is qualified;

[0123] If the effective value of the environment container is 0.8, which is less than the preset effective value, it is determined that the environment container is unqualified.

[0124] The preset valid value is positively correlated with the total number of test containers included in the environment container.

[0125] It can be understood that the larger the total number of test containers included in the environment container, the larger the corresponding code coverage quantity. According to the calculation method of the environment container valid value, the larger the environment valid value, so the preset valid value is positively correlated with the total number of test containers included in the environment container.

[0126] Specifically, in step S5, the process of calling a similar environment container for the next simulation run according to the similarity value and adjusting the similar environment container to generate a new environment container includes:

[0127] Obtaining the similarity value by comparing and calculating the existing environment container and the operation behavior parameters of the user's next operation;

[0128] Comparing the similarity value with the preset similarity value, and determining the similar environment container according to the comparison result;

[0129] Performing the next simulation run on the similar environment container, comparing it with the result of the user's next operation, and adjusting the similar environment container to generate a new environment container according to the comparison result.

[0130] Counting the number of operation behavior parameters of the user's next operation that are consistent with the stored environment container as the similarity value;

[0131] Selecting the one with the largest similarity value as the similar environment container;

[0132] Specifically, in the present invention, by applying the stored environment container to the next simulation run and adjusting the environment container according to the operation result to obtain a new environment container for storage, each time a simulation run is performed, there is no need to rebuild a complex test or operation environment from scratch. Directly using the stored environment container can quickly deploy the same or similar environments, saving 70% of the time compared to rebuilding the environment model. In the iterative cycle of software development, quickly verifying new functions or fixing problems is crucial. Utilizing the stored environment container can quickly carry out simulation runs and obtain operation results in a timely manner, thereby accelerating the iterative process of development and testing. The stored environment container retains specific software versions, configuration parameters, and dependencies, making the environment of each simulation run consistent. This helps to eliminate the problem of inconsistent test results caused by environmental differences. According to the simulation run results, the resource configuration of the environment container can be adjusted, and the operation results can also reflect the rationality of certain configuration parameters in the environment container. As business requirements change continuously, the software system needs to be updated and optimized continuously. The stored environment container can be used as a basis to be adjusted and expanded according to new requirements to generate new environment containers, further improving the accuracy and timeliness of the automated test for browser screen recording.

[0133] So far, the technical solution of the present invention has been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easily understood by those skilled in the art that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the protection scope of the present invention.

Claims

1. An automated testing method for browser screen recording, characterized in that: include: Obtain the operation behavior parameters of the user's operation on the browser and calculate the operation data; Using the operation data to construct a plurality of test containers, and encapsulating the test containers with the operation behavior parameters after layering; Simulate browsers in several different devices to build several environment containers, put each test container into the environment container for simulation operation to obtain code coverage, and combine the code coverage with the screen change rate to determine the operation status of the code in the test container; Determine the effective weighted value of each test container according to the result of the hierarchical processing, calculate the effective value of the environment container in combination with the code coverage rate corresponding to each test container, and determine whether the environment container is qualified based on the effective value; The qualified environment container is stored, a similar environment container is called according to the similarity value to perform the next simulation operation, and the similar environment container is adjusted according to the result of the next simulation operation to generate a new environment container; The process of packaging the test containers with the operation behavior parameters after layering includes: According to the operation results of each test container, the test containers are distributed to the basic layer, the professional layer and the interface layer. If the running result of the test container shows that the function of the test container is a general data processing function, the test container is allocated to the base layer, If the running result of the test container shows that the function of the test container is a professional data processing function, the test container is allocated to the professional layer, If the running result of the test container shows that the function of the test container is a function of connecting to a data system, the test container is allocated to the interface layer; Associating and mapping the operation behavior parameters with the corresponding test containers; Configure packaging parameters; The basic layer is a common data layer for the operation of various systems, the professional layer is a data layer for the operation of professional systems, and the interface layer is a data layer for connecting various systems for interaction; Determining, based on the code coverage and the screen change rate, whether the running status of the code in the test container is normal, a code error, code redundancy, or code missing; If the code coverage is greater than a preset coverage and the screen change rate is less than or equal to a preset change rate, it is determined that the running status of the code in the test container is normal. If the code coverage is greater than the preset coverage and the screen change rate is greater than the preset change rate, it is determined that the running status of the code in the test container is a code error. If the code coverage is less than or equal to the preset coverage and the screen change rate is greater than the preset change rate, it is determined that the running status of the code in the test container is code missing, If the code coverage is less than or equal to the preset coverage and the screen change rate is less than or equal to the preset change rate, it is determined that the running status of the code in the test container is code redundancy, The preset coverage rate is negatively correlated with the total number of test containers participating in the simulation run, and the preset change rate is positively correlated with the total number of test containers participating in the simulation run; The effective value of the environment container is the sum of the effective weights of each group of test containers contained therein and the product of the code coverage.

2. The automated testing method for browser screen recording according to claim 1, characterized in that: The process of obtaining the screen change parameters before and after each of the test containers is placed in the environmental container for the simulation operation and calculating the screen change rate includes: Recording the changes in the window size and pixel density on the screen before and after each of the test containers is placed in the environmental container for the simulation operation; Calculate the window size change rate according to the window size change, and calculate the pixel density change rate according to the pixel density change; The screen change rate is calculated by combining the window size change rate and the pixel density change rate.

3. The automated testing method for browser screen recording according to claim 2, characterized in that: The process of converting the operation data into the test container includes: Performing cleaning processing on the operation data to generate unit data; Extract key information from the unit data to build an image; Building the test container according to the image; The unit data is a minimum data set that can completely run the test container.

4. The automated testing method for browser screen recording according to claim 3, characterized in that: The process of simulating browsers in several different devices to build several environment containers includes: Determine device type and browser configuration; Customizing the environment image according to the device type and the browser configuration; The environment container is created based on the environment image.

5. The automated testing method for browser screen recording according to claim 4, characterized in that: The process of placing each of the test containers into the environment container for simulation operation and analyzing to obtain the code coverage rate includes: deploying each of the test containers to the environment container; The environment container is started, and the code coverage of each test container is recorded.

6. The automated testing method for browser screen recording according to claim 5, characterized in that: The process of determining the effective weighted value of each test container according to the result of the hierarchical processing and calculating the effective value of the environment container in combination with the code coverage rate corresponding to each test container includes: Selecting the environment container in which the code in each of the test containers runs normally; Determine an effective weighted value for each of the test containers running in the environmental container according to the result of the hierarchical processing; The effective value of the environment container is calculated by combining the effective weighted value and the code coverage of each test container.

7. The automated testing method for browser screen recording according to claim 6, characterized in that: The effective value of the environmental container is compared with a preset effective value, and whether the environmental container is qualified is determined according to the comparison result, wherein: The preset effective value is positively correlated with the total number of test containers contained in the environmental container.

8. The automated testing method for browser screen recording according to claim 7, characterized in that: The process of calling a similar environment container for the next simulation operation according to the similarity value, and adjusting the similar environment container to generate a new environment container according to the next simulation operation result includes: Obtaining a similarity value by comparing and calculating the operation behavior parameters of the existing environment container and the user's next operation; Comparing the similarity value with a preset similarity value, and determining a similar environment container according to the comparison result; The similar environment container is subjected to the next simulation operation, and compared with the result of the next operation of the user, and the similar environment container is adjusted according to the comparison result to generate a new environment container.

Citation Information

Patent Citations

  • Information system based on visual programming technology and construction method thereof

    CN113703749A

  • Grid-based cross-terminal responsive design system and method

    CN118760420A

  • Multi-browser testing method and device, equipment, medium and program product

    CN116756016A

  • Visualization test method and device, electronic equipment and storage medium

    CN116841865A