Test methods, apparatus, equipment, and computer-readable storage media

By using configuration attribute information and identification information based on object test requests, the page to be filled in and form parameters are obtained. The target is matched and the script is executed, which solves the problems of long tool development time and language compatibility in existing technologies and enables rapid test result acquisition.

CN115269285BActive Publication Date: 2026-04-03SHENZHEN FUTU NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-08
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing technologies require the development of multiple tools for different objects under test, which is time-consuming and incompatible with multiple programming languages, resulting in low testing efficiency.

Method used

By determining the page to be filled in based on the configuration attribute information of the object test request, obtaining the form parameters and identification information, matching the target to execute the script, and achieving rapid test result acquisition.

Benefits of technology

It enables a fast and convenient testing process, overcomes the technical barriers of the development language, and improves testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269285B_ABST
    Figure CN115269285B_ABST
Patent Text Reader

Abstract

This application discloses a testing method, apparatus, device, and computer-readable storage medium. The method includes: determining a page to be filled in based on the configuration attribute information of the object to be tested contained in an object test request; obtaining form parameters of the object to be tested through the page to be filled in; obtaining a target execution script based on the form parameters and the identification information of the object to be tested; and executing the target execution script to obtain the test result corresponding to the object to be tested. This method obtains the form parameters of the object to be tested through the page to be filled in, eliminating the need to adjust the form parameters to different types of development languages, overcoming the technical barriers of development languages. Furthermore, it can quickly match the corresponding target execution script, eliminating the need to execute scripts in different types of development languages ​​separately, only requiring the execution of the target execution script, thus overcoming the technical barriers of development languages; thereby obtaining the test result corresponding to the object to be tested, making the entire testing process convenient and fast.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, specifically to a testing method, apparatus, device, and computer-readable storage medium. Background Technology

[0002] To test different objects, tool developers need to develop multiple tools for each object and build dedicated testing tool platforms for each object. This process is time-consuming and inefficient.

[0003] In addition, existing testing tool platforms are not compatible with tools that use multiple programming languages, making it impossible to test objects in different programming languages ​​and thus preventing the rapid acquisition of test results for the corresponding objects.

[0004] Therefore, a testing method is urgently needed to solve the above-mentioned technical problems. Summary of the Invention

[0005] To address the aforementioned technical problems, embodiments of this application provide a testing method, apparatus, device, and computer-readable storage medium to quickly obtain test results for the object under test.

[0006] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.

[0007] According to one aspect of the embodiments of this application, a testing method is provided, comprising: determining a page for filling in information based on configuration attribute information of the object to be tested contained in an object test request; obtaining form parameters of the object to be tested through the page for filling in information; obtaining a target execution script based on the form parameters and the identification information of the object to be tested; and executing the target execution script to obtain a test result corresponding to the object to be tested.

[0008] In another embodiment, determining the information page to be filled based on the configuration attribute information of the test object contained in the object test request includes: detecting the configuration attribute type of the test object based on the configuration attribute information; if the configuration attribute type is a code configuration attribute type, then rendering the page according to the preset page code file corresponding to the test object to obtain the information page to be filled; if the configuration attribute type is an editor configuration attribute type, then rendering the page according to the preset open source component to obtain the information page to be filled.

[0009] In another embodiment, obtaining the target execution script based on the form parameters and the identification information of the object to be tested includes: determining a preset execution script for the object to be tested based on the identification information; encapsulating the identification information and the form parameters to obtain request parameters corresponding to the object to be tested; and obtaining the target execution script according to the preset execution script and the request parameters.

[0010] In another embodiment, determining the preset execution script of the object to be tested based on the identification information includes: detecting the configuration attribute type of the object to be tested based on the configuration attribute information; if the configuration attribute type is an editor configuration attribute type, then determining the preset execution script of the object to be tested based on the identification information; if the configuration attribute type is a code configuration attribute type, then determining the execution script type corresponding to the target code corresponding to the object to be tested based on the target code, and determining the preset execution script of the object to be tested based on the execution script type and the identification information.

[0011] In another embodiment, the execution script type includes multiple preset execution scripts with identification information; determining the preset execution script of the test object based on the execution script type and the identification information of the test object includes: matching the identification information of the test object with the identification information corresponding to the multiple preset execution scripts contained in the execution script type; if the matching is successful, the preset execution script corresponding to the successfully matched identification information is taken as the preset execution script of the test object.

[0012] In another embodiment, obtaining the target execution script based on the preset execution script and the request parameters includes: obtaining the execution command parameters of the preset execution script; and adding the form parameters to the execution command parameters to obtain the target execution script.

[0013] In another embodiment, if the configuration attribute type is a code configuration attribute type, the method further includes: detecting whether the test result is normal, obtaining a detection result; if the detection result indicates that the test is normal, updating the test result to the information to be filled page and displaying the updated information to be filled page; if the detection result indicates that the test is abnormal, determining the cause of the abnormality and the abnormal location in the target execution script, and updating the cause of the abnormality, the abnormal location, and the test result to the information to be filled page and displaying the updated information to be filled page.

[0014] According to one aspect of the embodiments of this application, a testing apparatus is provided, comprising: a determining module configured to determine a page of information to be filled in based on configuration attribute information of the object to be tested contained in an object test request; an obtaining module configured to obtain form parameters of the object to be tested through the page of information to be filled in; and an execution module configured to obtain a target execution script based on the form parameters and the identification information of the object to be tested; and to execute the target execution script to obtain a test result corresponding to the object to be tested.

[0015] According to one aspect of the embodiments of this application, an electronic device is provided, including: a controller; and a memory for storing one or more programs, which, when executed by the controller, perform the test method described above.

[0016] According to one aspect of the embodiments of this application, a computer-readable storage medium is also provided, on which computer-readable instructions are stored, which, when executed by a computer's processor, cause the computer to perform the above-described test method.

[0017] According to one aspect of the embodiments of this application, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the above-described test method.

[0018] In the technical solution provided by the embodiments of this application, the information page to be filled in is determined based on the configuration attribute information of the object to be tested contained in the object test request, and the corresponding information page to be filled in is accurately determined; the form parameters of the object to be tested are obtained through the information page to be filled in, and the target execution script is obtained based on the form parameters and the identification information of the object to be tested, so that the corresponding target execution script can be quickly matched, without the need to execute scripts of different types of development languages ​​separately, only the target execution script needs to be executed, overcoming the technical barriers of development languages; thus, the test results corresponding to the object to be tested are obtained, and the whole testing process is convenient and fast.

[0019] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this application. Attached Figure Description

[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:

[0021] Figure 1 This is a schematic diagram illustrating the usage process of a tool based on a testing tool platform, as described in this application.

[0022] Figure 2 This is a flowchart illustrating a testing method in an exemplary embodiment of this application;

[0023] Figure 3 Based on Figure 2 A flowchart of another testing method proposed in the illustrated embodiment;

[0024] Figure 4 Based on Figure 2 A flowchart of another testing method proposed in the illustrated embodiment;

[0025] Figure 5 Based on Figure 4 A flowchart of another testing method proposed in the illustrated embodiment;

[0026] Figure 6 based on Figure 5 A flowchart of another testing method proposed in the illustrated embodiment;

[0027] Figure 7 based on Figure 4 A flowchart of another testing method proposed in the illustrated embodiment;

[0028] Figure 8 based on Figure 3 A flowchart of another testing method proposed in the illustrated embodiment;

[0029] Figure 9 This is a schematic diagram of the structure of a test tool platform shown in an exemplary embodiment of this application;

[0030] Figure 10 This is a schematic diagram of the structure of a test apparatus shown in an exemplary embodiment of this application;

[0031] Figure 11 An exemplary embodiment of this application illustrates a schematic diagram of the structure of a computer system for an electronic device. Detailed Implementation

[0032] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0033] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0034] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0035] In this application, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0036] Please refer to the following first. Figure 1 , Figure 1 This is a schematic diagram illustrating the usage process of a tool based on a testing tool platform, as described in this application. The testing platform includes a tool front-end 100, a platform front-end 200, a platform back-end 300, and a script pool 400. The tool front-end 100, platform front-end 200, platform back-end 300, and script pool 400 communicate with each other via a network.

[0037] Tool front-end 100 is the tool used by the user on the tool platform front-end; platform front-end 200 connects tool front-end 100 and platform back-end 300, receives object test requests from tool front-end 100 and forwards them to platform back-end 300, renders tool front-end 100 pages, etc.; platform back-end 300 provides platform services, mainly including querying tool configurations, executing scripts, etc.; script pool 400 stores multiple preset execution scripts.

[0038] The platform front-end 200 receives an object test request; the object test request contains configuration attribute information of the object to be tested, the object to be tested can be the source program to be tested, and the test object has identification information; the platform front-end 200 transmits the object test request to the platform back-end 300, and the platform back-end 300 determines whether the configuration attribute type of the object to be tested is a code configuration attribute type or an editor configuration attribute type based on the configuration attribute information of the object to be tested contained in the object test request.

[0039] If the configuration attribute type result is a code configuration attribute type, the platform backend 300 returns the preset page code file corresponding to the object under test to the platform frontend 200. The platform frontend 200 renders the page according to the preset page code file corresponding to the object under test and returns it to the tool frontend 100 to obtain the information to be filled page. This information to be filled page is then displayed to the user, who fills in the form parameters of the object under test. The platform frontend 200 retrieves these form parameters, and the platform backend 300 retrieves the preset execution script of the object under test from the script pool 400 based on the identification information. The backend 300 then encapsulates the identification information and the form parameters to obtain... The request parameters corresponding to the object to be tested are used by the platform backend 300 to obtain the target execution script based on the preset execution script and the request parameters. After executing the target script, the test result corresponding to the object to be tested is obtained and returned to the platform frontend 200. If the test result indicates that the test is normal, the test result is updated to the information to be filled page and the updated information to be filled page is displayed. If the test result indicates that the test is abnormal, the cause of the abnormality and the abnormal position in the target execution script are determined, and the cause of the abnormality, the abnormal position, and the test result are updated to the information to be filled page and the updated information to be filled page is displayed.

[0040] If the configuration attribute type result is the editor configuration attribute type, the platform backend 300 returns the preset open-source component corresponding to the object to be tested to the platform frontend 200. The platform frontend 200 renders the page according to the preset open-source component and returns it to the tool frontend 100 to obtain the information to be filled page. This information to be filled page is then displayed to the user. The user fills in the form parameters of the object to be tested. The platform frontend 200 obtains these form parameters. The platform backend 300 obtains the preset execution script of the object to be tested from the script pool 400 based on the identification information. It then encapsulates the identification information and form parameters to obtain the request parameters corresponding to the object to be tested. The request platform backend 300 obtains the target execution script based on the preset execution script and the request parameters. After executing the target script, it obtains the test result corresponding to the object to be tested and returns the test result to the platform frontend 200, displaying the updated information to be filled page.

[0041] Please see Figure 2 , Figure 2This is a flowchart illustrating a testing method in an exemplary embodiment of this application. The method can be performed by… Figure 1 The tool shown is tested on a specific platform. Of course, this method can also be applied to other implementation environments and executed by server devices in those environments; this embodiment does not limit this. For example... Figure 2 As shown, the method includes at least S210 to S240, which are described in detail below:

[0042] S210: Determine the information page to be filled based on the configuration attribute information of the object to be tested contained in the object test request.

[0043] An object test request is a request sent by the user to test an object, which can be the source code. The object test request submitted by the user is transmitted to the platform front-end 200 in the aforementioned testing platform. Based on the object test request received from the platform front-end 200, the platform back-end 300 determines the page of information to be filled in and finally displays the page of information to be filled in to the user.

[0044] S220: Obtain the form parameters of the object to be tested through the information to be filled page.

[0045] Form data is used to test the relevant parameters of the object under test, such as input and / or output values. Form parameters can be simple numeric characters, such as 10, 100, 500, etc.

[0046] The user enters the form parameters of the object to be tested on the information to be filled page, and the platform front-end 200 obtains the form parameters.

[0047] S230: Obtain the target execution script based on the form parameters and the identification information of the object to be tested.

[0048] Each test object has corresponding identification information, which can be numbers, such as 1, 2, 3, 4, etc., or English letters such as A, B, C, etc. Generally, the identification information corresponds one-to-one with the test object. However, in some embodiments, the same identification information can represent multiple different test objects. For example, the identification information is 8, which can be the identification information of both test object A and test object B.

[0049] The target execution script is the script that will ultimately execute the test; that is, the execution script with complete running conditions.

[0050] S240: Execute the target script to obtain the test results for the object under test.

[0051] The test results indicate whether the test is normal or abnormal. Users can know whether the test object is normal based on the corresponding test results. If the test results are abnormal, the corresponding test object will be debugged or modified.

[0052] In this embodiment, the information page to be filled in is determined based on the configuration attribute information of the object to be tested contained in the object test request, thus accurately identifying the corresponding information page to be filled in. The form parameters of the object to be tested are obtained through the information page to be filled in, and the target execution script is obtained based on the form parameters and the identification information of the object to be tested. This allows for quick matching of the corresponding target execution script, eliminating the need to execute scripts in different types of development languages ​​separately, and only requiring the execution of the target execution script, thus overcoming the technical barriers of development languages. As a result, the test results corresponding to the object to be tested are obtained, making the entire testing process convenient and fast.

[0053] Please see Figure 3 , Figure 3 Based on Figure 2 A flowchart of another testing method proposed in the illustrated embodiment.

[0054] This method is in Figure 2 The S210 shown also includes S310 to S330, which will be described in detail below:

[0055] S310: Detect the configuration attribute type of the object under test based on configuration attribute information.

[0056] The configuration attribute information includes the relevant preset configuration information of the object to be tested, that is, the preset information stored in the test platform, including the configuration attribute type. In this embodiment, the configuration attribute type includes the code configuration attribute type and the editor configuration attribute type.

[0057] S320: If the configuration attribute type is a code configuration attribute type, then the page is rendered according to the preset page code file corresponding to the object to be tested to obtain the information to be filled page.

[0058] When the platform lacks sufficient front-end components, it is difficult to support the assembly of the testing tool's front-end. Developers can write their own code to configure the testing tool, thereby completing the assembly of the testing tool's front-end, obtaining the pre-written preset page, and storing the corresponding preset page code file in the testing tool platform.

[0059] If the configuration attribute type of the object to be tested is a code configuration attribute type, then the preset page code file corresponding to the object to be tested is obtained from the test platform for page rendering, thereby obtaining the page for information to be filled.

[0060] S330: If the configuration attribute type is the editor configuration attribute type, then the page will be rendered according to the preset open source component to obtain the page of information to be filled.

[0061] If the configuration attribute type of the object to be tested is the editor configuration attribute type, that is, the preset page is configured by the front-end component in the platform editor, then the page is rendered according to the preset open source component to obtain the information to be filled page.

[0062] This embodiment further illustrates how to determine the information page to be filled in based on the configuration attribute information of the object to be tested contained in the object test request. Specifically, different page rendering methods are selected according to the configuration attribute type of the object to be tested to obtain different information pages to be filled in, so as to accurately obtain the form parameters of the object to be tested.

[0063] Figure 4 Based on Figure 2 A flowchart of another testing method proposed in the illustrated embodiment. This method, in... Figure 3 The S130 shown also includes S410 to S420, which will be described in detail below:

[0064] S410: Determine the preset execution script of the object to be tested based on the identification information; and encapsulate the identification information and form parameters to obtain the request parameters corresponding to the object to be tested.

[0065] The default execution script is a script that cannot be run directly because it lacks the corresponding parameters, such as input or output values. When the missing parameters are given, it can run normally.

[0066] The encapsulation in this embodiment can be understood as associating and binding the identification information with the form parameters to obtain the request parameters corresponding to the object to be tested. These request parameters are the corresponding parameters for normal operation that are lacking in the preset execution script, thereby enabling the form parameters to better match the preset execution script.

[0067] S420: Obtain the target execution script based on the preset execution script and request parameters.

[0068] S420 is illustrated by example. When the request parameter 1 is input into the preset execution script A, the preset execution script A can be executed normally. That is, the preset execution script that is assigned the request parameter is used as the target execution script.

[0069] This embodiment illustrates how to obtain the target execution script based on form parameters and the identification information of the object to be tested. First, the preset execution script of the object to be tested is accurately determined through the identification information. Then, the identification information and form parameters are encapsulated so that the form parameters can better match the preset execution script, thereby obtaining the request parameters corresponding to the object to be tested. Finally, the target execution script is obtained based on the preset execution script and the request parameters.

[0070] Figure 5 Based on Figure 4A flowchart of another testing method proposed in the illustrated embodiment. This method, in... Figure 4 The S410 shown includes at least S510 to S530, which are described in detail below:

[0071] S510: Detect the configuration attribute type of the object under test based on configuration attribute information.

[0072] The test detects whether the configuration property type of the object under test is an editor configuration property type or a code configuration property type, and then determines the preset execution script of the object under test based on the configuration property type.

[0073] S520: If the configuration attribute type is the editor configuration attribute type, then the preset execution script of the object to be tested is determined according to the identification information.

[0074] Specifically, if the configuration attribute type of the object to be tested A is the editor configuration attribute type and the identification information is a, then the preset execution script of the object to be tested A is directly determined from the test platform based on the identification information a.

[0075] S530: If the configuration attribute type is a code configuration attribute type, then determine the execution script type corresponding to the target code based on the target code of the object to be tested, and determine the preset execution script of the object to be tested based on the execution script type and identification information.

[0076] The target code is the preset code stored on the test platform, which is the code related to storing the object to be tested on the test platform. The code type includes C language type, JS (JavaScript, a lightweight, interpreted or just-in-time compiled programming language with function priority), etc. Each code type corresponds to a different execution script type. For example, C language type code corresponds to C language execution script type, and JS language type code corresponds to JS language execution script type.

[0077] In this embodiment, the target code type of the object to be tested is JS language type, that is, the corresponding execution script type is JS language execution script type. Then, the preset execution script of the object to be tested is determined according to the JS language execution script type and the identification information.

[0078] For example, if the configuration attribute type of the object to be tested A is code configuration attribute type and the identification information is a, then the execution script type I corresponding to the target code of the object to be tested A is obtained, and finally the preset execution script of the object to be tested A is determined from the test platform based on the identification information a and the execution script type I.

[0079] This embodiment illustrates how to accurately determine the preset execution script of the object under test based on identification information. If the configuration attribute type is an editor configuration attribute type, the preset execution script of the object under test is directly determined based on the identification information; if the configuration attribute type is a code configuration attribute type, the execution script type corresponding to the target code is determined based on the target code corresponding to the object under test, and the preset execution script of the object under test is determined based on the execution script type and the identification information.

[0080] Figure 6 based on Figure 5 The flowchart of another testing method proposed in the illustrated embodiment is shown. The execution script type includes multiple preset execution scripts with identification information. This method is used in... Figure 5 The S510 shown includes at least S610 to S620, which will be described in detail below:

[0081] S610: Match the identification information of the object to be tested with the identification information corresponding to multiple preset execution scripts contained in the execution script type.

[0082] This embodiment clarifies the case where the configuration attribute type of the object under test is a code configuration attribute type. Because each execution script type includes multiple preset execution scripts with identification information, it is necessary to use the identification information of the object under test to match and obtain the preset execution script of the object under test from the multiple preset execution scripts contained in the corresponding execution script type.

[0083] In the specific matching process, this embodiment uses text matching between the identification information of the object under test and the identification information corresponding to multiple preset execution scripts. The correlation Rae(Ide_tes, Ide_scr) between the identification information Ide_tes of the object under test and the identification information Ide_scr corresponding to the multiple preset execution scripts is calculated as follows:

[0084]

[0085] Here, α represents a preset identification factor. In this embodiment, it is assumed that all identification information contains text of the same type and has the same number of characters to facilitate accurate relevance calculation. Then, the preset execution script corresponding to the highest relevance is selected as the preset execution script for the test object.

[0086] S620: If a match is successful, the preset execution script corresponding to the successfully matched identifier information will be used as the preset execution script for the object to be tested.

[0087] For example, the identifier information of the object to be tested is 2, and the code type of the target code corresponding to the object to be tested is JS language type, that is, the corresponding execution script type is JS language execution script type. Among them, the JS language execution script type includes the preset execution script A corresponding to identifier information 1, the preset execution script B corresponding to identifier information 2, and the preset execution script C corresponding to identifier information 3. Therefore, it can be determined that the preset execution script of the object to be tested is B.

[0088] This embodiment further illustrates how to accurately determine the preset execution script of the test object based on the identification information when the configuration attribute type of the test object is a code configuration attribute type. Since each execution script type includes multiple preset execution scripts with identification information, the preset execution script of the test object can be accurately determined by matching the identification information of the test object with the multiple preset execution scripts contained in the execution script type.

[0089] Figure 7 based on Figure 4 A flowchart of another testing method proposed in the illustrated embodiment. This method, in... Figure 4 The S420 shown includes S710 to S720, which will be described in detail below:

[0090] S710: Get the execution command parameters of the preset execution script.

[0091] The command parameters are preset to include relevant parameters for the script execution. However, because the preset script lacks the corresponding parameters, it cannot execute normally. The above form parameters need to be added before it can execute normally.

[0092] S720: Add form parameters to the execution command parameters to obtain the target execution script.

[0093] By appending the form parameters to the execution command parameters, we obtain a script that can be executed normally, which is the target execution script.

[0094] This embodiment further clarifies how to obtain the target execution script based on the preset execution script and request parameters. That is, by adding form parameters to the execution command parameters, the target execution script can be obtained. The whole process does not require much modification or adjustment to the preset execution script to obtain the target execution script, which is more convenient and faster.

[0095] Figure 8 based on Figure 3 The flowchart illustrates another testing method proposed in the illustrated embodiment. If the configuration attribute type is a code configuration attribute type, the method further includes steps S810 to S830, which will be described in detail below:

[0096] S810: Check whether the test results are normal and obtain the test results.

[0097] After the target script is executed, the corresponding test results are obtained. By indicating whether the test results are normal or not, users can more intuitively judge whether the object under test is normal.

[0098] In another exemplary embodiment, if the configuration attribute type result of the object to be tested is the editor configuration attribute type, regardless of whether the test result is normal, the test result is directly returned to the platform front-end 200, and the updated information to be filled page is displayed.

[0099] S820: If the test result indicates that the test is normal, the test result will be updated to the information to be filled page, and the updated information to be filled page will be displayed.

[0100] After the platform backend 300 executes the target script, it obtains the test results corresponding to the test object and returns the test results to the platform frontend 200. If the test results indicate that the test is normal, the platform frontend 200 updates the test results to the information to be filled page and displays the updated information to be filled page. Specifically, it can be displayed on the information to be filled page in the form of a pop-up window.

[0101] S830: If the test result indicates an abnormality, determine the cause of the abnormality and the location of the abnormality in the target execution script, and update the cause of the abnormality, the location of the abnormality, and the test result to the information to be filled page, and display the updated information to be filled page.

[0102] If the test results indicate an anomaly, the platform front-end 200 determines the cause of the anomaly and the location of the anomaly in the target execution script, and updates the test results to the information to be filled page, displaying the updated information to be filled page.

[0103] This embodiment clarifies the steps for updating the information to be filled page when the configuration attribute type of the object under test is a code configuration attribute type. In particular, when the detection result indicates a test anomaly, the cause of the anomaly and the location of the anomaly in the target execution script can be determined, so that the user can intuitively understand the problem of the code in the target execution script and make it convenient for the user to modify and debug it.

[0104] In another exemplary embodiment, in conjunction with the above... Figure 1 The tool testing platform and the above Figures 2 to 8 The illustrated embodiment provides a detailed description of the construction and structure of the testing tool platform and the process of using the testing tools. The testing platform is mainly divided into a developer front-end, a platform back-end, and a platform front-end, such as... Figure 9 As shown, Figure 9This is a schematic diagram illustrating the structure of a testing tool platform according to an exemplary embodiment of this application. The developer front-end includes a script upload module for uploading scripts; and a front-end component editor that can upload configuration parameters to the configuration pool in the platform back-end, and also combine tool front-end pages and add them to the system access path for display on the platform front-end.

[0105] The platform backend includes a script pool, a control center, and a configuration pool. The control center manages the retrieval of preset execution scripts from the script pool and configuration parameters from the configuration pool. The configuration pool can store form parameters, and the control center can manage the encapsulation of these form parameters and identification information to obtain request parameters. The platform frontend includes a directory navigation module and a tool page module.

[0106] Specifically, test tool developers need to create a new code repository and write their business logic script according to a specific input / output format to ensure the script can correctly perform the test tool's functions. Then, the developer opens the developer frontend, enters their newly created code repository, and the platform automatically loads the script code from the developer's repository. Afterward, the developer can go to the frontend component editor to select and edit the frontend components of the tool they want to create, and complete the creation of the frontend UI (User Interface). After completing the above operations, the developer can use the preview function to preview and debug the newly created tool. The entire process is roughly as follows: create tool script (git) → write business logic script → create tool → enter repository address → select frontend components → complete creation.

[0107] Developers have two options when creating front-end pages:

[0108] 1) Upload your own pre-written front-end pages via a code repository. This method is suitable for front-end interaction logic that is very complex, and where the variety of front-end components is insufficient to fully support the assembly of the testing tool's front-end.

[0109] 2) Using the front-end component editor, select the required components and add interactive associations to them. Set the output values ​​for each component; after saving, you can preview and debug. This method is relatively simple for front-end interactions and allows for quick creation and debugging of front-end pages.

[0110] Once the platform is built, users can use this tool to test it and execute the above-mentioned tasks. Figures 2 to 8The testing method in this paper determines the information page to be filled in based on the configuration attribute information of the test object contained in the test request, accurately identifying the corresponding information page to be filled in. The form parameters of the test object are obtained through the information page to be filled in, without the need to adjust the form parameters to different types of development languages, thus overcoming the technical barriers of development languages. The target execution script is obtained based on the form parameters and the identification information of the test object, which can quickly match the corresponding target execution script and execute it to obtain the test results corresponding to the test object, making the entire testing process convenient and fast.

[0111] Another aspect of this application provides a testing apparatus, such as... Figure 10 As shown, Figure 10 This is a schematic diagram illustrating the structure of a testing apparatus according to an exemplary embodiment of this application. The testing apparatus includes:

[0112] Module 1010 is configured to determine the information page to be filled in based on the configuration attribute information of the object to be tested contained in the object test request.

[0113] Module 1030 is configured to retrieve form parameters of the object to be tested from the page containing the information to be filled.

[0114] The execution module 1050 is configured to obtain the target execution script based on the form parameters and the identification information of the object to be tested; and execute the target execution script to obtain the test results corresponding to the object to be tested.

[0115] In another exemplary embodiment, the determining module 1010 is specifically configured to detect the configuration attribute type of the object to be tested based on the configuration attribute information; if the configuration attribute type is a code configuration attribute type, then the page is rendered according to the preset page code file corresponding to the object to be tested to obtain the information to be filled page; if the configuration attribute type is an editor configuration attribute type, then the page is rendered according to the preset open source component to obtain the information to be filled page.

[0116] In another exemplary embodiment, the execution module 1050 is specifically configured to determine a preset execution script for the object to be tested based on the identification information; and to encapsulate the identification information and form parameters to obtain the request parameters corresponding to the object to be tested; and to obtain the target execution script based on the preset execution script and the request parameters.

[0117] In another exemplary embodiment, the execution module 1050 includes:

[0118] The configuration attribute type detection unit is configured to detect the configuration attribute type of the object under test based on the configuration attribute information.

[0119] The first detection unit is configured to determine the preset execution script of the object to be tested based on the identification information if the configuration attribute type is the editor configuration attribute type.

[0120] The second detection unit is configured to determine the execution script type corresponding to the target code based on the target code of the object under test if the configuration attribute type is the code configuration attribute type, and determine the preset execution script of the object under test based on the execution script type and the identification information.

[0121] In another exemplary embodiment, the execution script type includes multiple preset execution scripts with identification information, and the second detection unit includes:

[0122] The matching module is configured to match the identification information of the object to be tested with the identification information corresponding to multiple preset execution scripts contained in the execution script type; if the match is successful, the preset execution script corresponding to the successfully matched identification information is used as the preset execution script of the object to be tested.

[0123] In another exemplary embodiment, the execution module 1050 includes:

[0124] The target execution script unit is configured to obtain the execution command parameters of the preset execution script; and add the form parameters to the execution command parameters to obtain the target execution script.

[0125] In another exemplary embodiment, if the configuration attribute type is a code configuration attribute type, the testing apparatus further includes:

[0126] The test result display module is configured to detect whether the test results are normal and obtain the test results; if the test results indicate that the test is normal, the test results are updated to the information to be filled page and the updated information to be filled page is displayed; if the test results indicate that the test is abnormal, the cause of the abnormality and the abnormal location in the target execution script are determined, and the cause of the abnormality, the abnormal location, and the test results are updated to the information to be filled page and the updated information to be filled page is displayed.

[0127] It should be noted that the testing apparatus provided in the above embodiments and the testing method provided in the foregoing embodiments belong to the same concept. The specific way in which each module and unit performs operations has been described in detail in the method embodiments, and will not be repeated here.

[0128] Another aspect of this application provides an electronic device, including: a controller; and a memory for storing one or more programs, which, when executed by the controller, perform the methods described above.

[0129] Please see Figure 11 , Figure 11This is a schematic diagram of the structure of a computer system for an electronic device, illustrating an exemplary embodiment of this application. It shows a schematic diagram of the structure of a computer system suitable for implementing the embodiments of this application.

[0130] It should be noted that, Figure 11 The computer system 1100 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0131] like Figure 11 As shown, the computer system 1100 includes a Central Processing Unit (CPU) 1101, which can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, based on programs stored in Read-Only Memory (ROM) 1102 or programs loaded from storage portion 1108 into Random Access Memory (RAM) 1103. The RAM 1103 also stores various programs and data required for system operation. The CPU 1101, ROM 1102, and RAM 1103 are interconnected via a bus 1104. An Input / Output (I / O) interface 1105 is also connected to the bus 1104.

[0132] The following components are connected to I / O interface 1105: an input section 1106 including a keyboard, mouse, etc.; an output section 1107 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to I / O interface 1105 as needed. Removable media 1111, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1110 as needed so that computer programs read from them can be installed into storage section 1108 as needed.

[0133] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1109, and / or installed from removable medium 1111. When the computer program is executed by central processing unit (CPU) 1101, it performs various functions defined in the system of this application.

[0134] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. The transmitted data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0135] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0136] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.

[0137] Another aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the aforementioned test method. This computer-readable storage medium may be included in the electronic device described in the above embodiments, or it may exist independently and not assembled into the electronic device.

[0138] Another aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the test methods provided in the various embodiments described above.

[0139] According to one aspect of the embodiments of this application, a computer system is also provided, including a Central Processing Unit (CPU), which can perform various appropriate actions and processes based on a program stored in read-only memory (ROM) or a program loaded from storage into random access memory (RAM), such as performing the methods described above. Various programs and data required for system operation are also stored in the RAM. The CPU, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.

[0140] The following components are connected to the I / O interface: input components including keyboards, mice, etc.; output components including cathode ray tubes (CRTs), liquid crystal displays (LCDs), and speakers; storage components including hard drives; and communication components including network interface cards such as LAN (Local Area Network) cards and modems. The communication components perform communication processing via networks such as the Internet. Drives are also connected to the I / O interface as needed. Removable media, such as disks, optical discs, magneto-optical discs, semiconductor memories, etc., are installed on the drive as needed so that computer programs read from them can be installed into the storage components as required.

[0141] The above description is merely a preferred exemplary embodiment of this application and is not intended to limit the implementation of this application. Those skilled in the art can easily make corresponding modifications or alterations based on the main concept and spirit of this application. Therefore, the scope of protection of this application should be determined by the scope of protection claimed in the claims.

Claims

1. A testing method, characterized in that, The method includes: Detect the configuration attribute type of the object under test based on configuration attribute information; If the configuration attribute type is a code configuration attribute type, then the page is rendered according to the preset page code file corresponding to the object to be tested, so as to obtain the information to be filled page; If the configuration attribute type is an editor configuration attribute type, then the page is rendered according to the preset open source component to obtain the page of information to be filled; The form parameters of the object to be tested are obtained through the page containing the information to be filled in. If the configuration attribute type is an editor configuration attribute type, then the preset execution script of the test object is determined according to the identification information of the test object; If the configuration attribute type is a code configuration attribute type, then the execution script type corresponding to the target code is determined based on the target code corresponding to the object under test, and the preset execution script of the object under test is determined based on the execution script type and the identification information; and The identification information and the form parameters are encapsulated to obtain the request parameters corresponding to the object to be tested; The target execution script is obtained based on the preset execution script and the request parameters; Execute the target execution script to obtain the test results corresponding to the object to be tested.

2. The method according to claim 1, characterized in that, The execution script type includes multiple preset execution scripts with identification information; The step of determining the preset execution script of the test object based on the execution script type and the identification information of the test object includes: The identification information of the object to be tested is matched with the identification information corresponding to multiple preset execution scripts contained in the execution script type; If a match is successful, the preset execution script corresponding to the successfully matched identifier information will be used as the preset execution script for the object to be tested.

3. The method according to claim 1, characterized in that, The step of obtaining the target execution script based on the preset execution script and the request parameters includes: Obtain the execution command parameters of the preset execution script; The form parameters are added to the execution command parameters to obtain the target execution script.

4. The method according to claim 1, characterized in that, If the configuration attribute type is a code configuration attribute type, the method further includes: Check whether the test results are normal, and obtain the test results; If the test result indicates that the test is normal, the test result will be updated to the information to be filled page, and the updated information to be filled page will be displayed. If the detection result indicates a test anomaly, the cause of the anomaly and the location of the anomaly in the target execution script are determined, and the cause of the anomaly, the location of the anomaly, and the test result are updated in the information to be filled page, and the updated information to be filled page is displayed.

5. A testing apparatus, characterized in that, include: The determination module is configured to detect the configuration attribute type of the object under test based on configuration attribute information. If the configuration attribute type is a code configuration attribute type, then the page is rendered according to the preset page code file corresponding to the test object to obtain the information to be filled page; if the configuration attribute type is an editor configuration attribute type, then the page is rendered according to the preset open source component to obtain the information to be filled page. The acquisition module is configured to acquire the form parameters of the object to be tested through the page containing the information to be filled in. The execution module is configured to, if the configuration attribute type is an editor configuration attribute type, determine the preset execution script of the test object based on the identification information of the test object; if the configuration attribute type is a code configuration attribute type, determine the execution script type corresponding to the target code based on the target code corresponding to the test object, and determine the preset execution script of the test object based on the execution script type and the identification information. And the identification information and the form parameters are encapsulated to obtain the request parameters corresponding to the object to be tested; The target execution script is obtained based on the preset execution script and the request parameters; Execute the target execution script to obtain the test results corresponding to the object to be tested.

6. An electronic device, characterized in that, include: Controller; A memory for storing one or more programs, which, when executed by the controller, cause the controller to implement the test method as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, It stores computer-readable instructions that, when executed by the computer's processor, cause the computer to perform the test method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Automatic test method and device, computer equipment and storage medium

    CN111459796A

  • Interface test and tool configuration method and device, electronic equipment and storage medium

    CN113886216A