Automated test script execution method and device, processor and electronic equipment
By building and executing the automated test script task set, the test process is optimized according to the normal or abnormal relationship of the script, the problem of excessive time-consuming automated test scripts is solved, and the efficiency of automated tests is improved.
Patent Information
- Application Number
- CN202411996282.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-11
AI Technical Summary
When executing automated test scripts, the prior art causes excessive time-consuming and inefficient automation testing.
By obtaining the set of automated test scripts to be executed and determining the relationship between each automated test script and normal or exception script, build an automated test script task set and execute automated test scripts in the task set to obtain test results.
It effectively avoids the time-consuming and long-term use of automated test scripts, improves the efficiency of automated tests, and solves the problem of low efficiency of automated tests.
Smart Images

Figure CN119807068A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a method, device, processor and electronic device for executing an automated test script. Background Art
[0002] In the process of executing automated test scripts, automated testing is often performed on a single function or a single service. Alternatively, multiple functions or multiple services are connected in series by writing codes, so that the test case data is executed serially in sequence to complete automated testing of multiple functions or multiple services.
[0003] However, the above-mentioned testing method may cause the execution of the automated testing script to take too long, thereby resulting in a technical problem of low efficiency of the automated testing.
[0004] Currently, no effective solution has been proposed for the technical problem of low efficiency of the above-mentioned automated testing. Summary of the invention
[0005] The embodiments of the present invention provide a method, device, processor and electronic device for executing an automated test script, so as to at least solve the technical problem of low efficiency in locating abnormal information.
[0006] According to one aspect of an embodiment of the present invention, a method for executing an automated test script is provided, the method comprising: obtaining an automated test script set to be executed, wherein the automated test script set includes at least one automated test script; determining the relationship between the automated test scripts and normal automated test scripts and abnormal automated test scripts, respectively; based on the relationship, constructing an automated test script task set to be executed; and executing the automated test scripts in the automated test script task set to obtain test results.
[0007] Optionally, based on the relationship, an automated test script task set to be executed is constructed, including: in response to the relationship indicating that each automated test script in the automated test script set is a normal automated test script, constructing the automated test script set into an automated test script task set; in response to the relationship indicating that at least one automated test script in the automated test script set is an abnormal automated test script, deleting the abnormal automated test script from the automated test script set, and constructing the deleted automated test script set into an automated test script task set.
[0008] Optionally, in response to the relationship indicating that each automated test script in the automated test script set is a normal automated test script, the automated test script set is constructed into an automated test script task set, including: in response to the relationship indicating that each automated test script in the automated test script set is a normal automated test script, each automated test script is concatenated according to its position in the automated test script set to obtain an automated test script task set.
[0009] Optionally, the deleted automated test script set is constructed as an automated test script task set, including: determining each automated test script in the deleted automated test script set; and concatenating each automated test script in the deleted automated test script set according to the position of each automated test script in the deleted automated test script set to obtain an automated test script task set.
[0010] Optionally, executing the automated test scripts in the automated test script task set to obtain test results includes: determining identification information of the automated test scripts in the automated test script task set, wherein the identification information is used to identify the automated test scripts in the automated test script task set; and executing the automated test scripts in the automated test script task set under the identification information to obtain test results.
[0011] Optionally, obtaining the automated test script set to be executed includes: scanning at least one automated test script to be executed according to a target interval to obtain the automated test script set.
[0012] According to one aspect of an embodiment of the present invention, there is provided an execution device for automated test scripts, which may include: an acquisition unit, used to acquire an automated test script set to be executed, wherein the automated test script set includes at least one automated test script; a determination unit, used to determine the relationship between the automated test scripts and normal automated test scripts and abnormal automated test scripts, respectively; a construction unit, used to construct an automated test script task set to be executed based on the relationship; and an execution unit, used to execute the automated test scripts in the automated test script task set to obtain test results.
[0013] According to another aspect of an embodiment of the present invention, a processor is provided, which is used to run a program, wherein when the program is run by the processor, the method for executing the automated test script in the embodiment of the present invention is executed.
[0014] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein when the program is running, the execution method of the automated test script in each embodiment of the present invention is executed.
[0015] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for executing the automated test script in the present invention.
[0016] According to another aspect of an embodiment of the present invention, a computer program product is further provided. The computer program product includes a computer program. When the computer program is executed by a processor, the method for executing the automated test script in the embodiment of the present invention is implemented.
[0017] According to another aspect of an embodiment of the present invention, a computer program product is also provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the execution method of the automated test script in the embodiment of the present invention is implemented.
[0018] According to another aspect of an embodiment of the present invention, an embodiment of the present application further provides a computer program, which, when executed by a processor, implements the execution method of the automated test script in the above-mentioned embodiment of the present invention.
[0019] In an embodiment of the present invention, when executing an automated test script, a set of automated test scripts to be executed can be obtained, and the relationship between the automated test scripts in the automated test script set and the normal automated test scripts and abnormal automated test scripts can be determined. According to the determined above relationship, a set of automated test script tasks to be executed can be constructed, and the automated test scripts in the constructed automated test script task set can be executed to obtain test results, thereby achieving the purpose of avoiding the time-consuming execution of automated test scripts, thereby solving the technical problem of low efficiency of automated testing, and further achieving the technical effect of improving the efficiency of automated testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0021] Figure 1 It is a hardware structure block diagram of a computer terminal for implementing an execution method of an automated test script according to an embodiment of the present invention;
[0022] Figure 2 is a flow chart of a method for executing an automated test script according to an embodiment of the present invention;
[0023] FIG3( a ) is a schematic diagram of a distributed service system based on serial connection of automated test scripts according to an embodiment of the present invention;
[0024] FIG3( b ) is a flow chart of a distributed service method based on automated test script concatenation according to an embodiment of the present invention;
[0025] Figure 4 is a schematic diagram of an execution device for an automated test script according to an embodiment of the present invention;
[0026] Figure 5 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only embodiments of a part of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] According to an embodiment of the present invention, a method for executing an automated test script is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0030] The method for executing the automated test script provided in the embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 1 is a hardware structure block diagram of a computer terminal for implementing an automated test script execution method according to an embodiment of the present invention. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0031] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0032] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the execution method of the automated test script in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the execution method of the automated test script described above is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0033] The transmission device 106 can be used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0034] The display may be, for example, a touch screen liquid crystal display (LCD), which enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0035] Under the above operating environment, this application provides Figure 2 The execution method of the automated test script is shown. Figure 2 1 is a flowchart of a method for executing an automated test script according to an embodiment of the present invention. The method may include the following steps:
[0036] Step S201, obtaining a set of automated test scripts to be executed.
[0037] In the technical solution provided in the above step S201 of the present invention, the above automated test script set may include at least one automated test script.
[0038] In this embodiment, the above-mentioned automated test script can be used to simulate the interaction between the user and the software or service, thereby automatically executing the test of the software function or service. For example, the automated test script can be a predefined instruction sequence, and the automated test script can be an instruction sequence obtained by writing using a scripting language or a specific automated test tool. This is only an example and is not specifically limited.
[0039] In this embodiment, an automated test script set to be executed is obtained. Optionally, this embodiment scans at least one automated test script in the automated test scheduling platform to obtain an automated test script set including at least one automated test script. The above scanning method may include at least one of the following methods or a combination thereof: timed scanning, sequential scanning, and reverse scanning, etc., which are only used as examples and are not specifically limited.
[0040] Step S202, determining the relationship between the automated test script and the normal automated test script and the abnormal automated test script.
[0041] In the technical solution provided in the above step S202 of the present invention, the above relationship can indicate that the automated test script is a normal automated test script, or it can indicate that the automated test script is an abnormal automated test script, which is only used as an example and is not specifically limited. The specific content represented by the above relationship needs to be determined according to the situation of the automated test sample itself.
[0042] In this embodiment, after obtaining the set of automated test scripts to be executed, the relationship between the automated test scripts, respectively, and the normal automated test scripts and the abnormal automated test scripts is determined. Optionally, on the basis of obtaining the set of automated test scripts to be executed, this embodiment compares the obtained set of automated test scripts with the normal automated test scripts and the abnormal automated test scripts, respectively, to obtain a comparison result, that is, the relationship between the automated test scripts, respectively, and the normal automated test scripts and the abnormal automated test scripts can be obtained.
[0043] Step S203: construct an automated test script task set to be executed based on the relationship.
[0044] In the technical solution provided in the above step S203 of the present invention, the above automated test script task set may include different automated test scripts. For example, the different automated test scripts may include: a first automated test script, a second automated test script, and a third automated test script, etc. The first automated test script may be used for automated testing of the transfer service of the application program, the second automated test script may be used for automated testing of the conversation service of the application program, and the third automated test script may be used for automated testing of the secret setting service of the application program, which is only an example and is not specifically limited.
[0045] In this embodiment, after determining the relationship between the automated test script and the normal automated test script and the abnormal automated test script, respectively, an automated test script task set to be executed is constructed based on the relationship. Optionally, this embodiment identifies the above-determined relationship based on the relationship between the automated test script and the normal automated test script and the abnormal automated test script, respectively, and can construct an automated test script task set to be executed based on the identified content. That is to say, if the identified content indicates that the automated test script is a normal automated test script, the automated test script set where the automated test script is located is directly constructed as an automated test script task set; if the identified content indicates that the automated test script is an abnormal automated test script, it is necessary to delete the automated test script from the automated test script set where the automated test script is located, thereby constructing an automated test script task set.
[0046] Step S204, executing the automated test script in the automated test script task set to obtain a test result.
[0047] In the technical solution provided in the above step S204 of the present invention, the above test result can be used to indicate whether the function or service of the software needs to be modified.
[0048] In this embodiment, after constructing the automated test script task set to be executed based on the relationship, the automated test script in the automated test script task set is executed to obtain the test result. Optionally, based on the construction of the automated test script task set to be executed, according to the software service currently to be tested, the embodiment can read the test data required by the automated test script corresponding to the software service from the data pool, load the test data into the automated test script corresponding to the software service in the automated test script task set, and then execute the automated test script corresponding to the software service to obtain the test result. For example, if the software service currently to be tested is a transfer service, the test result can be obtained by executing the first automated test script corresponding to the transfer service in the automated test script task set, that is, whether the transfer service needs to be revised can be obtained. This is only an example and is not specifically limited.
[0049] In the above steps S201 to S204 of the present application, when executing the automated test script, the set of automated test scripts to be executed can be obtained, and the relationship between the automated test scripts in the automated test script set and the normal automated test scripts and abnormal automated test scripts can be determined. According to the above relationships determined, a set of automated test script tasks to be executed can be constructed, and the automated test scripts in the constructed automated test script task set can be executed to obtain test results, thereby achieving the purpose of avoiding the time-consuming execution of automated test scripts, thereby solving the technical problem of low efficiency of automated testing, and further achieving the technical effect of improving the efficiency of automated testing.
[0050] The above method of this embodiment is further introduced below.
[0051] As an optional implementation method, step S203, based on the relationship, constructs an automated test script task set to be executed, including: in response to the relationship indicating that each automated test script in the automated test script set is a normal automated test script, constructing the automated test script set into an automated test script task set; in response to the relationship indicating that at least one automated test script in the automated test script set is an abnormal automated test script, deleting the abnormal automated test script from the automated test script set, and constructing the deleted automated test script set into an automated test script task set.
[0052] In this embodiment, after determining the relationship between the automated test scripts and the normal automated test scripts and the abnormal automated test scripts, respectively, in response to the relationship indicating that each automated test script in the automated test script set is a normal automated test script, the automated test script set is constructed as an automated test script task set. Optionally, this embodiment identifies the determined relationship based on the relationship between the automated test scripts and the normal automated test scripts and the abnormal automated test scripts, respectively, and can construct an automated test script task set to be executed based on the identified content. That is, if the identified content indicates that each automated test script in the automated test script set is a normal automated test script, the automated test script set in which the automated test script is located is directly constructed as an automated test script task set.
[0053] In this embodiment, after determining the relationship between the automated test scripts and the normal automated test scripts and the abnormal automated test scripts, respectively, in response to the relationship indicating that at least one automated test script in the automated test script set is an abnormal automated test script, the abnormal automated test script is deleted from the automated test script set, and the deleted automated test script set is constructed as an automated test script task set. Optionally, this embodiment identifies the determined relationship based on the relationship between the automated test scripts and the normal automated test scripts and the abnormal automated test scripts, respectively, and can construct an automated test script task set to be executed based on the identified content. That is, if the identified content indicates that at least one automated test script in the automated test script set is an abnormal automated test script, it is necessary to delete the abnormal automated test script from the automated test script set where the automated test script is located, that is, delete the automated test script that is an abnormal automated test script, and construct the automated test sample set after deleting the abnormal automated test script as an automated test script task set.
[0054] As an optional implementation method, in response to the relationship indicating that each automated test script in the automated test script set is a normal automated test script, the automated test script set is constructed as an automated test script task set, including: in response to the relationship indicating that each automated test script in the automated test script set is a normal automated test script, each automated test script is concatenated according to the position of each automated test script in the automated test script set to obtain an automated test script task set.
[0055] In this embodiment, after determining the relationship between the automated test scripts and the normal automated test scripts and the abnormal automated test scripts, in response to the relationship indicating that each automated test script in the automated test script set is a normal automated test script, each automated test script is connected in series according to the position of each automated test script in the automated test script set to obtain an automated test script task set. Optionally, this embodiment identifies the determined relationship based on the relationship between the automated test scripts and the normal automated test scripts and the abnormal automated test scripts, and can construct an automated test script task set to be executed based on the identified content. That is, if the identified content indicates that each automated test script in the automated test script set is a normal automated test script, the position of each automated test script in the automated test script set is first determined, and each automated test script is connected in series in sequence with reference to the determined position, so as to obtain an automated test script task set.
[0056] As an optional implementation method, the deleted automated test script set is constructed as an automated test script task set, including: determining each automated test script in the deleted automated test script set; concatenating each automated test script in the deleted automated test script set according to the position of each automated test script in the deleted automated test script set to obtain an automated test script task set.
[0057] In this embodiment, after determining the relationship between the automated test scripts, respectively, and the normal automated test scripts and the abnormal automated test scripts, each automated test script in the automated test script set after deletion is determined. Optionally, this embodiment identifies the determined relationship based on the relationship between the automated test scripts, respectively, and the normal automated test scripts and the abnormal automated test scripts. If the identified content indicates that at least one automated test script in the automated test script set is an abnormal automated test script, each automated test sample in the automated test sample set after the abnormal automated test script is deleted can be determined.
[0058] In this embodiment, after determining each automated test script in the automated test script set after deletion, each automated test script in the automated test script set after deletion is connected in series according to the position of each automated test script in the automated test script set after deletion, to obtain an automated test script task set. Optionally, this embodiment can determine the position of each automated test script in the automated test script set after deletion on the basis of determining each automated test script in the automated test script set after deletion. With reference to the determined position of each automated test script in the automated test script set after deletion, each automated test script in the automated test script set after deletion is connected in series in sequence, to obtain an automated test script task set.
[0059] As an optional implementation method, step S204, executing the automated test script in the automated test script task set to obtain the test result, includes: determining the identification information of the automated test script in the automated test script task set; and executing the automated test script in the automated test script task set under the identification information to obtain the test result.
[0060] In this embodiment, the above identification information can be used to identify the automated test script in the automated test script task set.
[0061] In this embodiment, after constructing the automated test script task set to be executed based on the relationship, the identification information of the automated test script in the automated test script task set is determined. Optionally, based on the construction of the automated test script task set to be executed, according to the software service currently to be tested, from the constructed automated test script task set, the automated test script corresponding to the software service can be determined, and the identification information of the automated test script corresponding to the software service can be determined. At the same time, the test data required for the automated test script corresponding to the software service can be read from the data pool. For example, if the software service currently to be tested is a transfer service, then from the constructed automated test script task set, the first automated test script corresponding to the transfer service can be determined, and the identification information of the first automated test script can be determined. At the same time, the test data required for the first automated test script corresponding to the transfer service can be read from the data pool. This is only an example and is not specifically limited.
[0062] In this embodiment, after determining the identification information of the automated test script in the automated test script task set, the automated test script in the automated test script task set is executed under the identification information to obtain the test result. Optionally, based on the determination of the identification information, under the identification information of the automated test script corresponding to the software service, the test data required by the automated test script corresponding to the software service is loaded into the automated test script corresponding to the software service in the automated test script task set, and then the automated test script corresponding to the software service is executed to obtain the test result. For example, if the software service currently to be tested is a transfer service, under the identification information of the first automated test script corresponding to the transfer service, the test data required by the first automated test script corresponding to the transfer service is loaded into the first automated test script corresponding to the transfer service in the automated test script task set, and then the first automated test script is executed to obtain the test result, that is, whether the transfer service needs to be corrected can be obtained. This is only an example and is not specifically limited.
[0063] As an optional implementation manner, step S201, obtaining an automated test script set to be executed, includes: scanning at least one automated test script to be executed according to a target interval to obtain an automated test script set.
[0064] In this embodiment, the target interval may be an initialization set scanning interval, or may be a scanning interval adjusted according to the application type to be tested. For example, the target interval may be, but is not limited to, the following durations: 5 minutes, 5.5 minutes, 6 minutes, etc.
[0065] In this embodiment, at least one automated test script to be executed is scanned according to the target interval to obtain an automated test script set. Optionally, this embodiment sequentially scans at least one automated test script to be executed according to a set scan interval to obtain an automated test script set. Alternatively, at least one automated test script to be executed is reversely scanned according to a set scan interval to obtain an automated test script set.
[0066] In an embodiment of the present invention, when executing an automated test script, a set of automated test scripts to be executed can be obtained, and the relationship between the automated test scripts in the automated test script set and the normal automated test scripts and abnormal automated test scripts can be determined. According to the determined above relationship, a set of automated test script tasks to be executed can be constructed, and the automated test scripts in the constructed automated test script task set can be executed to obtain test results, thereby achieving the purpose of avoiding the time-consuming execution of automated test scripts, thereby solving the technical problem of low efficiency of automated testing, and further achieving the technical effect of improving the efficiency of automated testing.
[0067] The technical solution of the embodiment of the present invention is illustrated below in conjunction with preferred implementation modes.
[0068] In the process of executing automated test scripts, automated testing is often performed on a single function or a single service. Alternatively, multiple functions or multiple services are connected in series by writing codes, so that the test case data is executed serially in sequence to complete automated testing of multiple functions or multiple services.
[0069] However, the above-mentioned testing method may cause the execution of the automated testing script to take too long, thereby resulting in a technical problem of low efficiency of the automated testing.
[0070] In order to solve the above technical problems, an embodiment of the present invention proposes a method for executing an automated test script. When executing an automated test script, a set of automated test scripts to be executed can be obtained, and the relationship between the automated test scripts in the automated test script set and the normal automated test scripts and abnormal automated test scripts can be determined. According to the above relationship determined, a set of automated test script tasks to be executed can be constructed, and the automated test scripts in the constructed automated test script task set can be executed to obtain test results, thereby achieving the purpose of avoiding the time-consuming execution of automated test scripts, thereby solving the technical problem of low efficiency of automated testing, and further achieving the technical effect of improving the efficiency of automated testing.
[0071] In this embodiment, the distributed service system based on the serial connection of automated test scripts can be used to implement the execution method of the automated test script in this application, thereby completing automated testing for multiple functions or multiple services. For example, Figure 3 (a) is a schematic diagram of a distributed service system based on the serial connection of automated test scripts according to an embodiment of the present invention. As shown in Figure 3 (a), the system may include: an automated test scheduling platform 301, an automated script serial connection platform 302 and a data pool 303, wherein the automated test scheduling platform 301 can be used to schedule and execute each automated test script (for example, automated test script A, B, C, etc.), the automated script serial connection platform 302 can be used to configure each automated test script, serialize each automated test script, and display the serialized automated test script, for example, display, serial connection task 1 and / or serial connection task 2, and the data pool 303 can be used to provide a number-checking and number-making platform for test data with characteristics (for example, debit cards, current passbooks, credit cards).
[0072] In this embodiment, the above-mentioned automated test scheduling platform 301 and the above-mentioned automated script serial connection platform 302 can read the test data required for executing the automated test script by accessing the data pool 303. The above-mentioned automated script serial connection platform 302 can read the private communication area variables configured by the automated test script and the global variables of the automated test script task set by accessing the data pool 303, wherein the automated test script task set is the serial connection task. The above-mentioned automated script serial connection platform 302 can be used to serialize and configure multiple automated test scripts into a list, wherein each automated test script in the list needs to submit an instruction to initiate scheduling to the above-mentioned automated test scheduling platform 301 one by one, and the above-mentioned automated test scheduling platform 301 runs the automated test script. The above-mentioned automated test scheduling platform 301 can be used to store atomic automated test scripts and cases, and provide scheduling functions at the same time. The above-mentioned data pool 303 also includes the following functions: data modeling, number scooping / number making, data entry into the pool, data refresh and data refresh / use, etc.
[0073] In this embodiment, when a user logs in to the automated script concatenation platform 302, if the configuration function is turned on, multiple automated test scripts can be concatenated by the automated script concatenation platform 302. The scheduler of the automated test scheduling platform 301 responds to the scheduling requests initiated by the automated test scripts to the scheduler one by one, and can execute the automated test scripts corresponding to the scheduling requests in sequence, and return the obtained test results to the automated script concatenation platform 302.
[0074] In this embodiment, the distributed service method based on the serial connection of automated test scripts in this application is executed to complete automated testing of multiple functions or multiple services. For example, FIG3(b) is a flow chart of a distributed service method based on the serial connection of automated test scripts according to an embodiment of the present invention. As shown in FIG3(b), the method may include the following steps:
[0075] Step S311, determining whether the automated test script is a new script.
[0076] If it is determined that the automated test script is an old script, the process proceeds to step S312 to obtain a list of concatenated scripts. If it is determined that the automated test script is a new script, the process proceeds to step S313 to add a new script template.
[0077] In the technical solution provided by the above step S312 of the present invention, the platform periodically scans all single automated test scripts of the automated test scheduling platform, and registers the single automated test scripts that meet the conditions into the script_info table. If the data already exists and the communication area has changed (addition and subtraction fields), the communication area field of the corresponding script in the script_linking_info table is synchronously updated.
[0078] In this embodiment, the main fields in the above-mentioned script_info table may include: script identification (ID), script name, method name, case name, public communication area, private communication area, creation time, number of modifications, last modification time and modification content, etc., which are only used as examples here and are not specifically limited.
[0079] In this embodiment, the above script_linking_info is used to register the information of each of the above concatenation tables, and then the script_linking table is used to register the ID list of the concatenated scripts. Among them, the main fields in script_linking_info may include: concatenation ID, script name, method name, case name, serial number, creation user, public communication area, private communication area, creation time and interruption and continuation flag, etc. The main fields in script_linking may include: concatenation ID, script ID list (script name, method name, case name, serial number), creation user, whether it is effective and template name, etc., which are only given as examples and are not specifically limited.
[0080] In the technical solution provided in the above step S313 of the present invention, the interface of the automated script concatenation platform can provide three drop-down boxes. The script name can support searching the existing script information in the script_info table. In other drop-down boxes, select the script name, method name, and case name to be concatenated in turn. It can also be filled in manually by developers or testers.
[0081] In this embodiment, in the interface of the automated script concatenation platform, click the "Add" button in the interface to configure the next service that needs to be concatenated. At the same time, in the interface of the automated script concatenation platform, relevant service attributes and relevant label definitions can be set. For example, in the interface of the automated script concatenation platform, the template name can be displayed as test query service concatenation, the script name can be displayed as ATSDepositBookLifeCycle_open_ current deposit book opening, the method name can be displayed as route 7 branch, and the case name can also be displayed as local currency.
[0082] After the script template is added, the process proceeds to step S314 and step S315 to modify the private communication area and determine whether to continue to connect the script.
[0083] In the technical solution provided in the above step S315 of the present invention, the private communication area of the automated test script is read from the script_info table and displayed in the interface "Request Parameters" input box in the object representation (JavaScript Object Notation, abbreviated as JSON) format. The field assignment of the private communication area may include the following writing methods: Writing method 1, fixed writing method: writing hard data; Writing method 2: writing method of referencing system dynamic variables: at least introducing the following variables system date ({systemDate}), contact phone number ({tellerno}) and zone number ({zoneno}), etc.; Writing method 3: writing method of referencing the input and output of the upstream interface: referencing the field value of the upstream input: working date
[0084] ({input.infoCommV10.workdate}), references the field value of the upstream output: account number ({output.accountNo}), where the reference rule is to search from the direct upstream first, then from the indirect upstream, and if neither is found, do not replace; Writing method 4: Writing method for referencing data in the data pool: reference user information, for example, introduce user name: $dp{personal customer basic information.NAME}.
[0085] In this embodiment, in the public communication area, each sub-area has its own label. The system supports the import of new labels, and the following categories of labels are imported by default (each label has multiple sub-input fields): channel element information (chanCommV10), transaction basic information (infoCommV10) and page query category (inqCommV10).
[0086] If it is determined that the scripts are to be continued to be serialized, the process proceeds to step S313. If it is determined that the scripts are not to be continued to be serialized, the process proceeds to steps S316, S317 and S318, the public communication area is selected, the automated test scripts initiate scheduling requests to the scheduler one by one, and the scheduler is used to execute the automated test scripts one by one.
[0087] In the technical solution provided in the above step S317 of the present invention, a call request is initiated to the scheduler of the automated test scheduling platform based on information such as the script name, method name, case name and input parameters (public communication area + private communication area), thereby obtaining the execution result of the automated test script.
[0088] In the technical solution provided in step S318 of the present invention, according to the script_linking and script_linking_info tables, a concatenation list can be obtained, and then the scheduler is requested in sequence to execute the concatenated automated test scripts, thereby obtaining the execution results of the automated test scripts, the input data used for the execution, and the output data generated by the execution to the script_linking_info_result result table. Among them, the main fields in script_linking_info_result may include: concatenation ID, script ID list (script name, method name, case name, serial number), template name, and running results (for example, error information).
[0089] After the scheduler is used to execute the automated test scripts one by one, the process proceeds to step S319 to determine whether the automated test scripts are executed successfully.
[0090] If it is determined that the automated test script is not executed successfully, the process proceeds to step S320 to determine whether to continue to execute the automated test script. If it is determined that the automated test script is to continue to execute, the process proceeds to step S318. If it is determined that the automated test script is not to continue to execute, the process proceeds to step S321 to return an error message.
[0091] If it is determined that the automated test script is executed successfully, the process proceeds to step S322 and step S323 to return the test result and determine whether there is any unautomated test script.
[0092] If it is determined that there is no unautomated test script, the process proceeds to step S318; if it is determined that there is no unautomated test script, the process ends.
[0093] In this embodiment, when executing an automated test script, a set of automated test scripts to be executed can be obtained, and the relationship between the automated test scripts in the automated test script set and the normal automated test scripts and abnormal automated test scripts can be determined. According to the determined above relationship, a set of automated test script tasks to be executed can be constructed, and the automated test scripts in the constructed automated test script task set can be executed to obtain test results, thereby achieving the purpose of avoiding the time-consuming execution of automated test scripts, thereby solving the technical problem of low efficiency of automated testing, and further achieving the technical effect of improving the efficiency of automated testing.
[0094] According to an embodiment of the present invention, there is also provided an execution device for an automated test script. It should be noted that the execution device for an automated test script can be used to execute an execution method for an automated test script in an embodiment.
[0095] Figure 4 Schematic diagram of an execution device of an automated test script according to an embodiment of the present invention. Figure 4 As shown, the execution device 400 of the automated test script may include: an acquisition unit 401 , a determination unit 402 , a construction unit 403 and an execution unit 404 .
[0096] The acquisition unit 401 is used to acquire an automated test script set to be executed, wherein the automated test script set includes at least one automated test script.
[0097] The determination unit 402 is used to determine the relationship between the automated test script and the normal automated test script and the abnormal automated test script.
[0098] The construction unit 403 is used to construct an automated test script task set to be executed based on the relationship.
[0099] The execution unit 404 is used to execute the automated test script in the automated test script task set to obtain a test result.
[0100] Optionally, the construction unit 403 may include: a first construction module, used to construct the automated test script set into an automated test script task set in response to the relationship indicating that each automated test script in the automated test script set is a normal automated test script; a second construction module, used to delete the abnormal automated test script from the automated test script set in response to the relationship indicating that at least one automated test script in the automated test script set is an abnormal automated test script, and construct the deleted automated test script set into an automated test script task set.
[0101] Optionally, the first construction module may include: a first concatenation sub-module, used to concatenate each automated test script in the automated test script set according to the position of each automated test script in the automated test script set in response to the relationship indicating that each automated test script in the automated test script set is a normal automated test script, so as to obtain an automated test script task set.
[0102] Optionally, the second construction module may include: a determination sub-module, used to determine each automated test script in the automated test script set after deletion; a second concatenation sub-module, used to concatenate each automated test script in the automated test script set after deletion according to the position of each automated test script in the automated test script set after deletion to obtain an automated test script task set.
[0103] Optionally, the execution unit 404 may include: a determination module, used to determine the identification information of the automated test script in the automated test script task set, wherein the identification information is used to identify the automated test script in the automated test script task set; an execution module, used to execute the automated test script in the automated test script task set under the identification information to obtain a test result.
[0104] Optionally, the acquisition unit 401 may include: a scanning module, configured to scan at least one automated test script to be executed according to a target interval to obtain an automated test script set.
[0105] In this embodiment, the following units are deployed in the execution device of the automated test script: an acquisition unit, used to acquire a set of automated test scripts to be executed, wherein the automated test script set includes at least one automated test script; a determination unit, used to determine the relationship between the automated test script and the normal automated test script and the abnormal automated test script, respectively; a construction unit, used to construct a set of automated test script tasks to be executed based on the relationship; and an execution unit, used to execute the automated test scripts in the automated test script task set to obtain test results, thereby achieving the purpose of avoiding the time-consuming execution of the automated test scripts, thereby solving the technical problem of low efficiency of automated testing, and further achieving the technical effect of improving the efficiency of automated testing.
[0106] It should be noted that the acquisition unit 401, the determination unit 402, the construction unit 403 and the execution unit 404 correspond to steps S201 to S204 in the embodiment, and the four units are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the contents disclosed in the above embodiment. It should be noted that the above modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the above modules can also be part of the device and can be run in the computer terminal 10 provided in the first embodiment.
[0107] An embodiment of the present application may provide an electronic device, Figure 5 is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 5 As shown, the electronic device 500 may include: one or more ( Figure 5 (only one is shown) processor 502, memory 504, storage controller 506, and peripheral interface 508, wherein the peripheral interface 508 is connected to the RF module 5101, the audio module 5102 and the display 5103.
[0108] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0109] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: obtain a set of automated test scripts to be executed, wherein the automated test script set includes at least one automated test script; determine the relationship between the automated test scripts and the normal automated test scripts and the abnormal automated test scripts respectively; based on the relationship, construct a set of automated test script tasks to be executed; execute the automated test scripts in the automated test script task set to obtain test results.
[0110] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: in response to the relationship indicating that each automated test script in the automated test script set is a normal automated test script, constructing the automated test script set into an automated test script task set; in response to the relationship indicating that at least one automated test script in the automated test script set is an abnormal automated test script, deleting the abnormal automated test script from the automated test script set, and constructing the deleted automated test script set into an automated test script task set.
[0111] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: in response to the relationship indicating that each automated test script in the automated test script set is a normal automated test script, each automated test script is concatenated according to the position of each automated test script in the automated test script set to obtain an automated test script task set.
[0112] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: determine each automated test script in the automated test script set after deletion; concatenate each automated test script in the automated test script set after deletion according to the position of each automated test script in the automated test script set after deletion to obtain an automated test script task set.
[0113] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: determine the identification information of the automated test script in the automated test script task set, wherein the identification information is used to identify the automated test script in the automated test script task set; under the identification information, execute the automated test script in the automated test script task set to obtain the test results.
[0114] The processor may also call the information and application programs stored in the memory through the transmission device to perform the following steps: scanning at least one automated test script to be executed according to the target interval to obtain an automated test script set.
[0115] In an embodiment of the present invention, when executing an automated test script, a set of automated test scripts to be executed can be obtained, and the relationship between the automated test scripts in the automated test script set and the normal automated test scripts and abnormal automated test scripts can be determined. According to the determined above relationship, a set of automated test script tasks to be executed can be constructed, and the automated test scripts in the constructed automated test script task set can be executed to obtain test results, thereby achieving the purpose of avoiding the time-consuming execution of automated test scripts, thereby solving the technical problem of low efficiency of automated testing, and further achieving the technical effect of improving the efficiency of automated testing.
[0116] Figure 5 is a structural block diagram of an electronic device according to an embodiment of the present application. A person skilled in the art can understand that Figure 5 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, or other terminal devices. Figure 5 The structure of the electronic device is not limited. Figure 5 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 5 Different configurations shown.
[0117] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0118] According to an embodiment of the present invention, a processor is further provided, the processor being used to run a program, wherein when the program is run by the processor, the method for executing the automated test script in the embodiment is executed.
[0119] According to an embodiment of the present invention, there is also provided an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the execution method of the automated test script in the embodiment is executed when the program is running.
[0120] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for executing the automated test script in the embodiment.
[0121] According to an embodiment of the present invention, a computer program product is further provided. The computer program product includes a computer program. When the computer program is executed by a processor, the method for executing the automated test script in the embodiment is implemented.
[0122] According to an embodiment of the present invention, a computer program product is also provided, including a non-volatile computer-readable storage medium, the non-volatile computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the execution method of the automated test script in the embodiment is implemented.
[0123] According to an embodiment of the present invention, a computer program is also provided. When the computer program is executed by a processor, the method for executing the automated test script in the embodiment is implemented.
[0124] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0125] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0126] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0127] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0128] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0129] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the relevant technology, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, ROM, RAM, mobile hard disk, disk or optical disk and other media that can store program codes.
[0130] The above are only preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for executing an automated test script, characterized in that: include: Obtaining an automated test script set to be executed, wherein the automated test script set includes at least one automated test script; Determine the relationship between the automated test script and the normal automated test script and the abnormal automated test script; Based on the relationship, construct an automated test script task set to be executed; Execute the automated test script in the automated test script task set to obtain a test result.
2. The method according to claim 1, characterized in that Based on the relationship, a set of automated test script tasks is constructed and executed, including: In response to the relationship indicating that each automated test script in the automated test script set is the normal automated test script, constructing the automated test script set into the automated test script task set; In response to the relationship indicating that at least one of the automated test scripts in the automated test script set is the abnormal automated test script, the abnormal automated test script is deleted from the automated test script set, and the deleted automated test script set is constructed as the automated test script task set.
3. The method according to claim 2, characterized in that In response to the relationship indicating that each automated test script in the automated test script set is the normal automated test script, the automated test script set is constructed as the automated test script task set, including: In response to the relationship indicating that each of the automated test scripts in the automated test script set is the normal automated test script, each of the automated test scripts is concatenated according to its position in the automated test script set to obtain the automated test script task set.
4. The method according to claim 2, characterized in that: The deleted automated test script set is constructed into the automated test script task set, including: Determine each of the automated test scripts in the automated test script set after deletion; According to the position of each automated test script in the automated test script set after deletion, each automated test script in the automated test script set after deletion is concatenated to obtain the automated test script task set.
5. The method according to claim 1, characterized in that Executing the automated test script in the automated test script task set to obtain a test result includes: Determine identification information of the automated test script in the automated test script task set, wherein the identification information is used to identify the automated test script in the automated test script task set; Under the identification information, the automated test script in the automated test script task set is executed to obtain the test result.
6. The method according to claim 1, characterized in that Get the set of automated test scripts to be executed, including: At least one automated test script to be executed is scanned according to the target interval to obtain the automated test script set.
7. An execution device for an automated test script, characterized in that: include: An acquisition unit, configured to acquire an automated test script set to be executed, wherein the automated test script set includes at least one automated test script; A determination unit, used to determine the relationship between the automated test script and the normal automated test script and the abnormal automated test script; A construction unit, used to construct an automated test script task set to be executed based on the relationship; The execution unit is used to execute the automated test script in the automated test script task set to obtain a test result.
8. A processor, characterized in that: The processor is used to run a program, wherein the program, when run by the processor, executes the method for executing the automated test script according to any one of claims 1 to 6.
9. An electronic device, characterized in that: include: A memory storing an executable program; A processor is used to run the program, wherein the program, when running, executes the method for executing the automated test script described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the storage medium is located is controlled to execute the method for executing the automated test script described in any one of claims 1 to 6.