Front-end dotting automated testing method, device, equipment and storage medium
By using a pre-defined automated testing method with a point-tracking tool, the problem of low efficiency in browser front-end point-tracking testing is solved, and efficient automated test result determination is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING QIHOOD TECHNOLOGY CO LTD
- Filing Date
- 2022-01-07
- Publication Date
- 2026-07-03
AI Technical Summary
Current technologies require manual verification for browser front-end point testing, which is inefficient.
This paper provides a front-end automated testing method that communicates with the browser through a preset testing tool, automatically determines the target test cases, obtains and saves network request data, and determines whether there is response data for the fields to be tested, so as to determine the test results.
Automated testing was achieved, avoiding the inefficiency of manual testing and improving testing efficiency.
Smart Images

Figure CN116450491B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of testing technology, and in particular to a front-end automated testing method, apparatus, equipment, and storage medium. Background Technology
[0002] User engagement data refers to data on user browsing, clicking, and purchasing activities on browser front-end products. This data reflects user intent and is therefore an important source of data for user behavior analysis and data mining. It is also crucial for measuring product revenue and can promote product iteration, optimization, and improvement.
[0003] Due to the importance of tracking data, ensuring the accuracy of the browser front-end tracking function (collecting tracking data) is crucial. Currently, there are many tracking points for various services on the browser front-end. However, when testing the tracking of these points (by determining whether the browser can accurately send request data to the browser server), manual verification is required (manually determining whether the browser sends request data to the browser server). Manual verification is costly and inefficient. Summary of the Invention
[0004] The main purpose of this application is to provide a method, apparatus, device and storage medium for automated front-end point-marking testing, which aims to solve the technical problem of low efficiency in manual point-marking testing and verification of browser front-ends in the prior art.
[0005] This application provides a front-end automated testing method for point marking, applied to a preset point marking tool, which is connected to a browser. The front-end automated testing method includes:
[0006] Upon receiving a test task for the browser service's tracking function, the target test cases for the test task are determined.
[0007] Based on the dot operation field in the target test case, perform dot operation interaction with the browser, obtain the network request data corresponding to the dot operation interaction, and save the network request data and the corresponding dot operation in the database of the preset dot tool;
[0008] Identify the fields to be judged in the target test case, and determine whether the network request data contains response data corresponding to the fields to be judged.
[0009] If the network request data contains response data corresponding to the field to be judged, the test result of the task to be tested is determined to be a successful test.
[0010] In one possible implementation of this application, the step of determining whether the network request data contains response data corresponding to the field to be determined includes:
[0011] Filter the network request data to be tested for the service from the database;
[0012] Determine whether the network request data to be tested contains response data corresponding to the field to be determined;
[0013] The step of determining the test result of the task to be tested as successful if the network request data contains response data corresponding to the field to be judged includes:
[0014] If the network request data to be tested contains response data corresponding to the field to be judged, the test result of the task to be tested is determined to be a successful test.
[0015] In one possible implementation of this application, the step of filtering the network request data to be tested for the service from the database includes:
[0016] Based on the filtering scope field in the target test case, the network request data to be tested for the service is filtered from the database. The filtering scope field includes a global filtering scope field or a single-step filtering scope field.
[0017] In one possible implementation of this application, the step of filtering the network request data to be tested for the service from the database includes:
[0018] Determine the filtering logic for the point marking function;
[0019] Based on the filtering logic of the point-marking function, the network request data to be tested for the service is filtered from the database.
[0020] In one possible implementation of this application, the step of determining the dot-mapping function filtering logic includes:
[0021] Determine the calling function in the preset dot tool;
[0022] Based on the call logic field in the target test case, the call function is nested in a first way to obtain the point-marking function filtering logic, wherein the call logic field includes a first function expression.
[0023] In one possible implementation of this application, the step of determining the field to be judged in the target test case includes:
[0024] Determine the function to be judged in the preset dot tool;
[0025] Based on the judgment logic field in the target test case, the function to be judged is combined in a second nested manner to obtain the field to be judged in the target test case, wherein the judgment logic field includes a second function expression.
[0026] In one possible implementation of this application, the step of storing the network request data and corresponding interactive operations in the database of the preset tracking tool includes:
[0027] Filter the static resource data in the network request data to obtain filtered request data;
[0028] The filtered request data and corresponding interactive operations are stored in the database of the preset marking tool.
[0029] This application also provides a front-end auto-testing device for use with a preset auto-testing tool, wherein the preset auto-testing tool is communicatively connected to a browser, and the front-end auto-testing device includes:
[0030] The first determining module is used to determine the target test cases for the test task when it receives the test task for the logging function of the browser service.
[0031] The acquisition module is used to interact with the browser to perform a point-based operation based on the point-based operation field in the target test case, acquire the network request data corresponding to the point-based operation interaction, and store the network request data and the corresponding point-based operation in the database of the preset point-based tool.
[0032] The second determining module is used to determine the field to be judged in the target test case and to determine whether the network request data contains response data corresponding to the field to be judged.
[0033] The third determining module is used to determine that the test result of the task to be tested is successful if the network request data contains response data corresponding to the field to be judged.
[0034] Optionally, the second determining module includes:
[0035] A filtering unit is used to filter network request data to be tested for the service from the database;
[0036] The judgment unit is used to determine whether the network request data to be tested contains response data corresponding to the field to be judged.
[0037] The step of determining the test result of the task to be tested as successful if the network request data contains response data corresponding to the field to be judged includes:
[0038] The first determining unit is used to determine that the test result of the task to be tested is successful if the network request data to be tested contains response data corresponding to the field to be judged.
[0039] Optionally, the filtering unit includes:
[0040] The first filtering subunit is used to filter the network request data to be tested for the service from the database based on the filtering range field in the target test case. The filtering range field includes a global filtering range field or a single-step filtering range field.
[0041] Optionally, the filtering unit includes:
[0042] The first determining subunit is used to determine the filtering logic for the dot-mapping function;
[0043] The second filtering subunit is used to filter the network request data to be tested for the service from the database based on the filtering logic of the point-marking function.
[0044] Optionally, the first determining subunit is used to implement:
[0045] Determine the calling function in the preset dot tool;
[0046] Based on the call logic field in the target test case, the call function is nested in a first way to obtain the point-marking function filtering logic, wherein the call logic field includes a first function expression.
[0047] Optionally, the second determining module includes:
[0048] The second determining unit is used to determine the function to be judged in the preset dotting tool;
[0049] The first combination unit is used to perform a second nested combination of the function to be judged based on the judgment logic field in the target test case to obtain the field to be judged in the target test case, wherein the judgment logic field includes a second function expression.
[0050] Optionally, the acquisition module includes:
[0051] The filtering module is used to filter static resource data in the network request data to obtain filtered request data;
[0052] The storage module is used to store the filtered request data and corresponding interactive operations in the database of the preset point-marking tool.
[0053] This application also provides a front-end point-marking automated testing device, which is a physical node device. The front-end point-marking automated testing device includes: a memory, a processor, and a program of the front-end point-marking automated testing method stored in the memory and executable on the processor. When the program of the front-end point-marking automated testing method is executed by the processor, it can implement the steps of the front-end point-marking automated testing method as described above.
[0054] To achieve the above objectives, a storage medium is also provided, on which a front-end point-marking automated testing program is stored, wherein when the front-end point-marking automated testing program is executed by a processor, the steps of any of the front-end point-marking automated testing methods described above are implemented.
[0055] This application provides an automated testing method, apparatus, device, and storage medium for front-end event tracking. Compared with the prior art, which involves manual event tracking testing of the browser front-end, resulting in low testing efficiency, this application, upon receiving a test task for the event tracking function of a browser service, determines the target test case for the test task; based on the event tracking operation fields in the target test case, interacts with the browser to perform event tracking operations, obtains the network request data corresponding to the event tracking operation interaction, and stores the network request data and the corresponding event tracking interaction operations in the database of the preset event tracking tool; determines the field to be judged in the target test case, and judges whether the network request data contains the response data corresponding to the field to be judged; if the network request data contains the response data corresponding to the field to be judged, the test result of the test task is determined to be successful. In this application, a pre-set tracking tool is used to automatically test the tracking function of a business task. Specifically, the target test case of the task is first obtained. Then, based on the tracking operation field in the target test case, the network request data corresponding to the tracking operation interaction is determined (if the tracking function is normal, the network request data is complete, so the required network request data can be determined from the network request data according to the function field). After saving the network request data corresponding to the tracking operation interaction, the field to be judged in the target test case is determined, and it is judged whether the network request data has the response data corresponding to the field to be judged. If the network request data has the response data corresponding to the field to be judged, the test result of the task is determined to be a successful test. That is, in this application, the test result can be automatically determined based on the target test case, avoiding the reduction in test efficiency caused by manual testing. Attached Figure Description
[0056] Figure 1 This is a flowchart illustrating the first embodiment of the front-end point-marking automated testing method of this application;
[0057] Figure 2 This is a detailed flowchart of step S30 in the first embodiment of the front-end point-marking automated testing method of this application;
[0058] Figure 3 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application. Detailed Implementation
[0059] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0060] This application provides a front-end automated testing method for point-of-sight (POS) testing. In the first embodiment of this front-end automated testing method, refer to... Figure 1 The method is applied to a preset point-marking tool, which communicates with a browser. The front-end point-marking automated testing method includes:
[0061] Step S10: Upon receiving the test task for the browser service's tracking function, determine the target test cases for the test task.
[0062] Step S20: Based on the dot operation field in the target test case, perform dot operation interaction with the browser, obtain the network request data corresponding to the dot operation interaction, and save the network request data and the corresponding dot operation in the database of the preset dot tool;
[0063] Step S30: Determine the field to be judged in the target test case, and determine whether the network request data contains response data corresponding to the field to be judged;
[0064] Step S40: If the network request data contains response data corresponding to the field to be judged, the test result of the task to be tested is determined to be a successful test.
[0065] In this embodiment, the research and development background is as follows:
[0066] Currently, there are many data points for various services in the browser front-end. When testing these data points (by determining whether the browser can accurately send request data to the browser server), manual verification is required (manually determining whether the browser sends request data to the browser server). However, manual verification is costly and inefficient.
[0067] In this embodiment, the test results can be automatically determined based on the target test cases, avoiding the reduction in test efficiency caused by manual testing.
[0068] The specific steps are as follows:
[0069] Step S10: Upon receiving the test task for the browser service's tracking function, determine the target test cases for the test task.
[0070] As an example, the front-end point-marking automated testing method can be applied to a preset point-marking tool, which belongs to the front-end point-marking automated testing system, which belongs to the front-end point-marking automated testing equipment.
[0071] As an example, a front-end automated testing system includes a browser in addition to a preset tracking tool, which communicates with the preset tracking tool.
[0072] In this embodiment, when the preset marking tool receives a test task for the marking function of the browser service, it determines the target test cases for the test task.
[0073] To trigger the test task, the user triggers it on the front end corresponding to the preset tracking tool. The front end corresponding to the preset tracking tool can refer to a front end that can call the preset tracking tool for testing. Specifically, it refers to a front end that can call the preset tracking tool for business function testing. In this embodiment, the front end can be the Teipe front end.
[0074] In this embodiment, the Teipe front-end can provide testers with the option to write test cases online, or it can provide testers with the option to select pre-written test cases.
[0075] In this embodiment, if a tester needs to create a new test task, the tester selects the test case to be run on the Teipe front-end page and confirms the run.
[0076] Before the step of determining the target test cases for the browser service's tracking function upon receiving the task to be tested, the method includes:
[0077] Step S01: Receive the target Docker container determined by the preset interface service and run it in the target Docker container;
[0078] The target Docker container is an independent container that runs the preset tracking tool, which is started by the backend after the backend writes the JSON string corresponding to the target test case into the preset interface service.
[0079] In this embodiment, the preset tracking tool receives the target Docker container determined by the preset interface service and starts running it in the target Docker container.
[0080] Specifically, the Teipe frontend selects the test case to be run and confirms the run, then sends the confirmation information to the Teipe backend. Upon receiving the confirmation information, the Teipe backend calls the dotserver service interface (starts the preset interface service). The purpose of calling the dotserver service interface is to use the functionality of the dotserver service (the functionality of the preset interface service) to write the test cases to the preset location of the preset interface service. Since the test cases are JSON strings, writing the test cases to the preset location of the preset interface service is equivalent to writing the JSON strings to the preset location of the preset interface service. Then, based on the preset location (text) after writing, the preset interface service generates a Docker container (an open-source application container engine) suitable for the current test case.
[0081] After the Docker container for the test cases is determined, the preset tracking tool will run automatically in that Docker container.
[0082] Specifically, in this embodiment, as soon as a new Docker container is detected to be generated, the preset tracking tool starts and runs in the new Docker container.
[0083] Alternatively, in this embodiment, the preset tracking tool to be run and the corresponding new Docker container have been determined in the Teipe front end. Therefore, the preset tracking tool to be run is prepared directly, and when the corresponding new Docker container is generated, the preset tracking tool is started and run directly.
[0084] In this embodiment, it should be noted that each test task will run in an independent Docker container to prevent test tasks from affecting each other.
[0085] Step S20: Based on the dot operation field in the target test case, perform dot operation interaction with the browser, obtain the network request data corresponding to the dot operation interaction, and save the network request data and the corresponding dot operation in the database of the preset dot tool;
[0086] In this embodiment, the target test case includes data such as various request parameters, various operation parameters, and the request content corresponding to each request parameter.
[0087] In this embodiment, each request parameter, each operation parameter, and the request content corresponding to each request parameter are all stored in the preset marking tool in the form of fields.
[0088] In other words, in this embodiment, the preset tracking tool parses the JSON-formatted test cases to generate instance objects and saves them to the database. Specifically, the preset tracking tool obtains the test cases from a preset interface service.
[0089] In this embodiment, the fields of the target test case include the dot operation field and the field to be judged.
[0090] In this embodiment, based on the dot operation field in the target test case, interacting with the browser to perform dot operation and obtaining the network request data corresponding to the dot operation interaction can specifically be as follows:
[0091] Based on the first dot operation field in the target test case, perform image dot operation interaction with the browser to obtain the first network request data corresponding to the dot operation interaction.
[0092] Based on the second dot operation field in the target test case, perform URL dot operation interaction with the browser to obtain the second network request data corresponding to the dot operation interaction;
[0093] Based on the third dot operation field in the target test case, interact with the browser to perform text content dot operation, and obtain the third network request data corresponding to the dot operation interaction, etc.
[0094] Specifically, during execution, the browser operation function (operation field) encapsulated in Handle.js is called according to the motion in the target test case to perform browser operations, obtain the browser's network request data, and save the network request data and the corresponding point-marking interaction operation in the database of the preset point-marking tool.
[0095] After saving, based on other fields in the test case, it is determined whether the corresponding response data can be obtained from the database of the preset tracking tool, and then it is determined whether the browser can accurately send the request data to the browser server.
[0096] In other words, in this embodiment, the test cases are test cases that apply to the browser's business functions.
[0097] In this embodiment, the preset tracking tool tests the browser's business functions based on test cases.
[0098] Step S30: Determine the field to be judged in the target test case, and determine whether the network request data contains response data corresponding to the field to be judged;
[0099] In this embodiment, the field to be judged in the target test case is determined directly through the attribute information of the field, and it is determined whether the network request data contains response data corresponding to the field to be judged.
[0100] Specifically, the field to be judged may include functions, regular expressions, etc., without any specific restrictions.
[0101] Specifically, the field to be evaluated can include a function expression: for example, ${function A(parameter 1; parameter 2)}. This function expression indicates that function A needs to be called, and parameter 1 and parameter 2 need to be passed to function A. Then, request headers, etc., can be obtained based on function A.
[0102] In this embodiment, the fields to be judged directly include: url (address), method (request method, such as: get, post), request_headers (request headers), request_post_data (request data), response_status (response code), response_headers (response headers), and response_body (response body).
[0103] Since the fields to be judged include response data (response code, response headers, and response body, etc.), the test passes if data consistent with the required response data can be obtained from the network request data stored in the database of the preset tracking tool, based on the URL (address), method (request method, such as GET, POST), and request headers; otherwise, the test fails.
[0104] Among them, reference Figure 2 The step of determining the field to be judged in the target test case includes:
[0105] Step S31: Determine the function to be judged in the preset dot tool;
[0106] In this embodiment, the preset dot tool has one or more functions to be judged.
[0107] Step S32: Based on the judgment logic field in the target test case, perform a second nested combination on the function to be judged to obtain the field to be judged in the target test case, wherein the judgment logic field includes a second function expression.
[0108] In this embodiment, the multiple functions to be judged can be combined.
[0109] Based on the judgment logic fields (logic such as which functions to combine and how to combine them) in the target test case, the function to be judged is subjected to a second nested combination to obtain the field to be judged in the target test case, wherein the judgment logic fields include the second function expression.
[0110] The function to be judged is nested in a second way to obtain the field to be judged in the target test case. A specific example is: ${function A(${function B(parameter 1;; parameter 2)};; ${function C(parameter 3;; parameter 4)})}.
[0111] The field to be judged indicates that function B is first called and its return value is used as the first parameter of function A, and then function C is executed and its return value is used as the second parameter of function A.
[0112] In this embodiment, since the judgment logic field in the target test case is used to perform a second nested combination on the function to be judged to obtain the judgment field in the target test case, the preset point-based testing tool can be used to test various business functions of the browser, that is, it can be used to test various functions without the need for frequent development, thus improving testing efficiency.
[0113] The step of determining whether the network request data contains response data corresponding to the field to be determined includes:
[0114] Step S33: Filter the network request data to be tested for the service from the database;
[0115] Step S34: Determine whether the network request data to be tested contains response data corresponding to the field to be determined;
[0116] In this embodiment, the network request data to be tested for the service is filtered from the database, and it is determined whether the network request data to be tested contains response data corresponding to the field to be judged. That is, in this embodiment, the preset tracking tool can test different services and different test functions of each service.
[0117] Step S40: If the network request data contains response data corresponding to the field to be judged, the test result of the task to be tested is determined to be a successful test.
[0118] In this embodiment, if the network request data contains response data corresponding to the field to be judged, the test result of the task to be tested is determined to be a successful test result. If the network request data does not contain response data corresponding to the field to be judged, the test result of the task to be tested is determined to be a failed test result.
[0119] The step of determining the test result of the task to be tested as successful if the network request data contains response data corresponding to the field to be judged includes:
[0120] Step S41: If the network request data to be tested contains response data corresponding to the field to be judged, the test result of the task to be tested is determined to be successful.
[0121] After the step of determining that the test result of the task to be tested is successful if the network request data contains response data corresponding to the field to be judged, the method includes:
[0122] Step S50: The result of the successful test is returned to the front end.
[0123] In this embodiment, the result of the successful test is returned to the front end for the tester to read.
[0124] This application provides an automated testing method, apparatus, device, and storage medium for front-end event tracking. Compared with the prior art, which involves manual event tracking testing of the browser front-end, resulting in low testing efficiency, this application, upon receiving a test task for the event tracking function of a browser service, determines the target test case for the test task; based on the event tracking operation fields in the target test case, interacts with the browser to perform event tracking operations, obtains the network request data corresponding to the event tracking operation interaction, and stores the network request data and the corresponding event tracking interaction operations in the database of the preset event tracking tool; determines the field to be judged in the target test case, and judges whether the network request data contains the response data corresponding to the field to be judged; if the network request data contains the response data corresponding to the field to be judged, the test result of the test task is determined to be successful. In this application, a pre-set tracking tool is used to automatically test the tracking function of a business task. Specifically, the target test case of the task is first obtained. Then, based on the tracking operation field in the target test case, the network request data corresponding to the tracking operation interaction is determined (if the tracking function is normal, the network request data is complete, so the required network request data can be determined from the network request data according to the function field). After saving the network request data corresponding to the tracking operation interaction, the field to be judged in the target test case is determined, and it is judged whether the network request data has the response data corresponding to the field to be judged. If the network request data has the response data corresponding to the field to be judged, the test result of the task is determined to be a successful test. That is, in this application, the test result can be automatically determined based on the target test case, avoiding the reduction in test efficiency caused by manual testing.
[0125] Furthermore, based on the first embodiment of this application, another embodiment of this application is provided. In this embodiment, the step of filtering the network request data to be tested for the service from the database includes:
[0126] Step A1: Based on the filtering scope field in the target test case, filter the network request data to be tested for the service from the database. The filtering scope field includes a global filtering scope field or a single-step filtering scope field.
[0127] In this embodiment, the data search range is determined based on the scope field (filtering range field) in the target test case. If the preset value is "overall", the network request data is queried globally. If the value is "single", the network request data is queried in a single step. That is, in this embodiment, the browser's database also divides the network request data into single-step and global categories. Single-step means that only one network request is judged at a time to obtain a single network request data, while global means that multiple network requests are judged at a time to obtain multiple network request data.
[0128] In this embodiment, network request data for the service to be tested is filtered from the database based on the filtering scope field in the target test case. The filtering scope field includes a global filtering scope field or a single-step filtering scope field. In this embodiment, different filtering methods can be used to improve the breadth of testing.
[0129] Furthermore, based on the first and second embodiments of this application, another embodiment of this application is provided. In this embodiment, the step of storing the network request data and corresponding interactive operations in the database of the preset tracking tool includes:
[0130] Step B1: Filter the static resource data in the network request data to obtain filtered request data;
[0131] Step B2: Save the filtered request data and corresponding interactive operations in the database of the preset point-marking tool.
[0132] In this embodiment, filter.js is called to filter unnecessary network requests, such as static resource data ending with js, png, .jpg, css, or ico, to obtain filtered request data. The filtered request data and corresponding interactive operations are then stored in the database of the preset tracking tool.
[0133] Based on this, in this embodiment, the overall testing process is as follows: the preset testing tool starts the point-tracking testing process -> the browser is operated and network interaction data is obtained -> irrelevant data is filtered out -> the network interaction data is saved to the database -> the range of query data is determined -> the data to be tested is selected according to the function expression -> the data is asserted according to the function expression -> the test results are obtained.
[0134] In this embodiment, static resource data is filtered from the network request data to obtain filtered request data; the filtered request data and corresponding interactive operations are then stored in the database of the preset tracking tool. In this embodiment, instead of storing all request data and corresponding interactive operations in the database of the preset tracking tool, the filtered request data and corresponding interactive operations are stored in the database of the preset tracking tool. This facilitates quick retrieval of the corresponding request data and improves testing efficiency.
[0135] Furthermore, based on the first, second, and third embodiments of this application, another embodiment of this application is provided. In this embodiment, the step of filtering the network request data to be tested for the service from the database includes:
[0136] Step C1: Determine the filtering logic for the dot-mapping function;
[0137] Step C2: Based on the point-marking function filtering logic, filter the network request data to be tested for the service from the database.
[0138] In this embodiment, the target test case also includes a point-marking function filtering logic, such as whether to test the first point-marking function or the second point-marking function, and then, based on the point-marking function filtering logic, the network request data to be tested for the service is filtered from the database.
[0139] The steps for determining the filtering logic of the dot-mapping function include:
[0140] Step D1: Determine the calling function in the preset dot tool;
[0141] Step D2: Based on the call logic field in the target test case, the call function is nested in a first way to obtain the point-marking function filtering logic, wherein the call logic field includes a first function expression.
[0142] In this embodiment, the calling function is nested and combined in a first way based on the calling logic field in the target test case to obtain the point-marking function filtering logic. The calling logic field includes a first function expression. That is, in this embodiment, the calling logic can be obtained by combining functions, which is convenient for testing complex functions.
[0143] Reference Figure 3 , Figure 3 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application.
[0144] like Figure 3 As shown, the front-end automated testing device may include: a processor 1001, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005.
[0145] Optionally, the front-end automated testing equipment may also include a user interface, a network interface, a camera, RF (Radio Frequency) circuitry, sensors, a WiFi module, etc. The user interface may include a display screen and an input submodule such as a keyboard; optional user interfaces may also include standard wired or wireless interfaces. The network interface may include standard wired or wireless interfaces (such as a Wi-Fi interface).
[0146] Those skilled in the art will understand that Figure 3 The structure of the front-end marking automated test equipment shown does not constitute a limitation on the front-end marking automated test equipment. It may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0147] like Figure 3 As shown, the memory 1005, serving as a storage medium, may include an operating system, a network communication module, and a front-end automated testing program. The operating system is a program that manages and controls the hardware and software resources of the front-end automated testing equipment, supporting the operation of the front-end automated testing program and other software and / or programs. The network communication module is used to enable communication between the various components within the memory 1005, as well as communication with other hardware and software in the front-end automated testing system.
[0148] exist Figure 3 In the front-end dotting automated testing device shown, the processor 1001 is used to execute the front-end dotting automated testing program stored in the memory 1005 to implement the steps of the front-end dotting automated testing method described above.
[0149] The specific implementation of the front-end dotting automated testing device in this application is basically the same as the embodiments of the front-end dotting automated testing method described above, and will not be repeated here.
[0150] This application also provides a front-end auto-testing device for use with a preset auto-testing tool, wherein the preset auto-testing tool is communicatively connected to a browser, and the front-end auto-testing device includes:
[0151] The first determining module is used to determine the target test cases for the test task when it receives the test task for the logging function of the browser service.
[0152] The acquisition module is used to interact with the browser to perform a point-based operation based on the point-based operation field in the target test case, acquire the network request data corresponding to the point-based operation interaction, and store the network request data and the corresponding point-based operation in the database of the preset point-based tool.
[0153] The second determining module is used to determine the field to be judged in the target test case and to determine whether the network request data contains response data corresponding to the field to be judged.
[0154] The third determining module is used to determine that the test result of the task to be tested is successful if the network request data contains response data corresponding to the field to be judged.
[0155] Optionally, the second determining module includes:
[0156] A filtering unit is used to filter network request data to be tested for the service from the database;
[0157] The judgment unit is used to determine whether the network request data to be tested contains response data corresponding to the field to be judged.
[0158] The step of determining the test result of the task to be tested as successful if the network request data contains response data corresponding to the field to be judged includes:
[0159] The first determining unit is used to determine that the test result of the task to be tested is successful if the network request data to be tested contains response data corresponding to the field to be judged.
[0160] Optionally, the filtering unit includes:
[0161] The first filtering subunit is used to filter the network request data to be tested for the service from the database based on the filtering range field in the target test case. The filtering range field includes a global filtering range field or a single-step filtering range field.
[0162] Optionally, the filtering unit includes:
[0163] The first determining subunit is used to determine the filtering logic for the dot-mapping function;
[0164] The second filtering subunit is used to filter the network request data to be tested for the service from the database based on the filtering logic of the point-marking function.
[0165] Optionally, the first determining subunit is used to implement:
[0166] Determine the calling function in the preset dot tool;
[0167] Based on the call logic field in the target test case, the call function is nested in a first way to obtain the point-marking function filtering logic, wherein the call logic field includes a first function expression.
[0168] Optionally, the second determining module includes:
[0169] The second determining unit is used to determine the function to be judged in the preset dotting tool;
[0170] The first combination unit is used to perform a second nested combination of the function to be judged based on the judgment logic field in the target test case to obtain the field to be judged in the target test case, wherein the judgment logic field includes a second function expression.
[0171] Optionally, the acquisition module includes:
[0172] The filtering module is used to filter static resource data in the network request data to obtain filtered request data;
[0173] The storage module is used to store the filtered request data and corresponding interactive operations in the database of the preset point-marking tool.
[0174] The specific implementation of the front-end dotting automated testing device in this application is basically the same as the embodiments of the front-end dotting automated testing method described above, and will not be repeated here.
[0175] This application provides a storage medium that stores one or more programs, which can be executed by one or more processors to implement the steps of the front-end point-marking automated testing method described in any of the above claims.
[0176] The specific implementation of the storage medium in this application is basically the same as the embodiments of the above-described front-end point-marking automated testing method, and will not be repeated here.
[0177] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0178] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0179] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of a software plus hardware platform, or by hardware, but in many cases the former is a better implementation. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0180] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
[0181] This invention also discloses M1, an automated testing method for front-end point marking, applied to a preset point marking tool, wherein the preset point marking tool is connected to a browser for communication, and the automated testing method for front-end point marking includes:
[0182] Upon receiving a test task for the browser service's tracking function, the target test cases for the test task are determined.
[0183] Based on the dot operation field in the target test case, perform dot operation interaction with the browser, obtain the network request data corresponding to the dot operation interaction, and save the network request data and the corresponding dot operation in the database of the preset dot tool;
[0184] Identify the fields to be judged in the target test case, and determine whether the network request data contains response data corresponding to the fields to be judged.
[0185] If the network request data contains response data corresponding to the field to be judged, the test result of the task to be tested is determined to be a successful test; the field to be judged includes the request address, request method, request header, request data, response encoding, response header, and response body.
[0186] M2, the front-end event tracking automated testing method as described in M1, prior to the step of determining the target test cases for the event tracking function of the browser service upon receiving the event tracking task, the method includes:
[0187] Receive the target Docker container determined by the preset interface service and run it in the target Docker container;
[0188] The target Docker container is an independent container that runs the preset tracking tool, which is started by the backend after the backend writes the JSON string corresponding to the target test case into the preset interface service.
[0189] This invention also discloses M3, the front-end point-tracking automated testing method as described in M1, wherein after the step of determining that the test result of the task to be tested is successful if the network request data contains response data corresponding to the field to be judged, the method includes:
[0190] The result of the successful test is returned to the front end.
[0191] This invention also discloses B12, an automated front-end point marking test device, applied to a preset point marking tool, wherein the preset point marking tool is communicatively connected to a browser, and the automated front-end point marking test device includes:
[0192] The first determining module is used to determine the target test cases for the test task when it receives the test task for the logging function of the browser service.
[0193] The acquisition module is used to interact with the browser to perform a point-based operation based on the point-based operation field in the target test case, acquire the network request data corresponding to the point-based operation interaction, and store the network request data and the corresponding point-based operation in the database of the preset point-based tool.
[0194] The second determining module is used to determine the field to be judged in the target test case and to determine whether the network request data contains response data corresponding to the field to be judged.
[0195] The third determining module is used to determine that the test result of the task to be tested is successful if the network request data contains response data corresponding to the field to be judged; the field to be judged includes the request address, request method, request header, request data, response encoding, response header, and response body.
[0196] B13. The apparatus as described in B12, further comprising:
[0197] The receiving module is used to receive the target Docker container determined by the preset interface service and run it in the target Docker container;
[0198] The target Docker container is an independent container that runs the preset tracking tool, which is started by the backend after the backend writes the JSON string corresponding to the target test case into the preset interface service.
[0199] B14. The apparatus as described in B12, further comprising:
[0200] The return module is used to return the successful test result to the front end.
[0201] The present invention also discloses C19, a terminal privacy protection device, characterized in that the device includes: a memory, a processor, and a terminal privacy protection program stored in the memory and executable on the processor, the terminal privacy protection program being configured to implement the steps of the terminal privacy protection method described above.
[0202] The present invention also discloses D20 and a storage medium, characterized in that the storage medium stores a terminal privacy protection program, and when the terminal privacy protection program is executed by a processor, it implements the steps of the terminal privacy protection method described above.
Claims
1. A front-end automated testing method, characterized in that, The method for automated front-end point-marking testing, which is applied to a preset point-marking tool and communicates with a browser, includes: Upon receiving a test task for the logging function of the browser front-end business, determine the target test cases for the test task. Based on the dot operation field in the target test case, perform dot operation interaction with the browser, obtain the network request data corresponding to the dot operation interaction, and save the network request data and the corresponding dot operation in the database of the preset dot tool; Determine the function to be judged in the preset dot tool; Based on the judgment logic field in the target test case, the function to be judged is combined in a second nested manner to obtain the field to be judged in the target test case, wherein the judgment logic field includes a second function expression; Filter the network request data to be tested for the front-end business from the database; determine whether the network request data to be tested contains response data corresponding to the field to be determined; If the network request data contains response data corresponding to the field to be judged, the test result of the task to be tested is determined to be a successful test. The step of filtering the network request data to be tested for the service from the database includes: Determine the calling function in the preset dot tool; Based on the call logic field in the target test case, the call function is nested in a first way to obtain the point-marking function filtering logic, wherein the call logic field includes a first function expression; Based on the filtering logic of the point-marking function, the network request data to be tested for the service is filtered from the database.
2. The front-end automated testing method according to claim 1, characterized in that, If the network request data contains response data corresponding to the field to be judged, the step of determining the test result of the task to be tested as a successful test includes: If the network request data to be tested contains response data corresponding to the field to be judged, the test result of the task to be tested is determined to be a successful test.
3. The front-end automated testing method according to claim 1, characterized in that, The step of filtering the network request data to be tested for the service from the database includes: Based on the filtering scope field in the target test case, the network request data to be tested for the service is filtered from the database. The filtering scope field includes a global filtering scope field or a single-step filtering scope field.
4. The front-end automated testing method as described in claim 1, characterized in that, The step of storing the network request data and corresponding point-tracking interaction operations in the database of the preset point-tracking tool includes: Filter the static resource data in the network request data to obtain filtered request data; The filtered request data and the corresponding point-marking interaction operations are stored in the database of the preset point-marking tool.
5. The front-end automated testing method as described in claim 1, characterized in that, Before the step of determining the target test cases for the task to be tested when receiving the task to be tested for the logging function of the browser front-end business, the method includes: Determine the target Docker container where the preset marking tool runs, and run the preset marking tool in the target Docker container; The target Docker container is an independent container that runs the preset tracking tool, which is started by the backend after the backend writes the JSON string corresponding to the target test case into the preset interface service.
6. The front-end automated testing method as described in claim 1, characterized in that, After the step of determining that the test result of the task to be tested is successful if the network request data contains response data corresponding to the field to be judged, the method includes: The result of the successful test is returned to the front end.
7. A front-end automated testing device, characterized in that, The device is applied to a preset dot-mapping tool, which communicates with a browser. The front-end automated dot-mapping testing device includes: The first determining module is used to determine the target test cases of the test task when it receives the test task of the logging function of the browser front-end business. The acquisition module is used to interact with the browser to perform a point-based operation based on the point-based operation field in the target test case, acquire the network request data corresponding to the point-based operation interaction, and store the network request data and the corresponding point-based operation in the database of the preset point-based tool. The second determining module is used to determine the function to be judged in the preset marking tool; based on the judgment logic field in the target test case, the function to be judged is subjected to a second nested combination to obtain the field to be judged in the target test case, wherein the judgment logic field includes a second function expression; The second determining module further includes a filtering unit and a judging unit, wherein the filtering unit includes a first determining subunit and a second filtering subunit. The first determining subunit is used to determine the calling function in the preset marking tool; based on the calling logic field in the target test case, the calling function is combined in a first nested manner to obtain the marking function filtering logic, wherein the calling logic field includes a first function expression; The second filtering subunit is used to filter the network request data to be tested for the service from the database based on the filtering logic of the point-marking function; The judgment unit is used to determine whether the network request data to be tested contains response data corresponding to the field to be judged; The third determining module is used to determine that the test result of the task to be tested is successful if the network request data contains response data corresponding to the field to be judged.
8. The front-end marking automated testing device according to claim 7, characterized in that, The step of determining the test result of the task to be tested as successful if the network request data contains response data corresponding to the field to be judged includes: The first determining unit is used to determine that the test result of the task to be tested is successful if the network request data to be tested contains response data corresponding to the field to be judged.
9. The front-end marking automated testing device according to claim 8, characterized in that, The filtering unit includes: The first filtering subunit is used to filter the network request data to be tested for the service from the database based on the filtering range field in the target test case. The filtering range field includes a global filtering range field or a single-step filtering range field.
10. The front-end marking automated testing device as described in claim 7, characterized in that, The step of storing the network request data and corresponding point-tracking interaction operations in the database of the preset point-tracking tool includes: Filter the static resource data in the network request data to obtain filtered request data; The filtered request data and the corresponding point-marking interaction operations are stored in the database of the preset point-marking tool.
11. An electronic device, characterized in that, The electronic device includes: a memory, a processor, and a program stored in the memory for implementing the front-end automated testing method. The memory is used to store the program that implements the front-end automated testing method; The processor is used to execute a program that implements the front-end point-marking automated testing method, so as to implement the steps of the front-end point-marking automated testing method as described in any one of claims 1 to 6.
12. A storage medium, characterized in that, The storage medium stores a program that implements the front-end point-marking automated testing method, and the program that implements the front-end point-marking automated testing method is executed by a processor to implement the steps of the front-end point-marking automated testing method as described in any one of claims 1 to 6.
13. A product, said product being a computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the front-end point-marking automated testing method as described in any one of claims 1 to 6.