Test script processing method and device, storage medium and electronic device
By collecting behavioral instructions and execution parameters through a cloud testing platform, test scripts are automatically generated, solving the problems of lack of universality and low efficiency in existing test script recording methods, and realizing efficient and accurate automated test script generation.
Patent Information
- Application Number
- CN202111342530.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-12
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2041-11-12
AI Technical Summary
Existing test script recording methods require instrumentation for the specific execution code of each application, which lacks universality, and manual recording is labor-intensive, with difficulty in guaranteeing efficiency and accuracy.
The cloud testing platform collects behavioral commands and execution parameters to generate test scripts, including collecting command parameters and execution attributes for click, input, and swipe commands, and automatically generating test scripts.
It improves the efficiency and accuracy of test script generation, realizes automated test script generation without the need for manual coding, and enhances the versatility of test scripts.
Smart Images

Figure CN114035781B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of electronic information processing, and in particular, to a test script processing method and device, a storage medium and an electronic device. BACKGROUND
[0002] With the continuous development of computer technology and software development technology, users can achieve different needs through various application programs. During the design and development of the application program, a large amount of testing needs to be performed to ensure the quality of the application program. Generally, before writing a test script, behavior data needs to be collected through a method of burying points to record a test script according to the behavior data. This method needs to bury points for the specific execution code of each application program, and is only applicable to the application program, which does not have universality. Moreover, the workload of manually recording a test script according to behavior data is large, and the efficiency and accuracy are difficult to guarantee. SUMMARY
[0003] The purpose of the present disclosure is to provide a test script processing method, device, storage medium and electronic device to solve the related problems in the prior art.
[0004] To achieve the above purpose, according to a first aspect of an embodiment of the present disclosure, a test script processing method applied to a cloud test platform is provided, and the method comprises:
[0005] Collecting a behavior instruction issued by the cloud test platform for controlling a terminal under test, an instruction parameter corresponding to the behavior instruction, and an execution parameter when the terminal under test executes the behavior instruction; the instruction parameter comprises a user identifier for issuing the behavior instruction and / or a time period for issuing the behavior instruction;
[0006] According to a plurality of behavior instructions and an execution parameter corresponding to each behavior instruction, a behavior feature corresponding to each behavior instruction is determined to obtain a plurality of groups of behavior feature sequences, each group of behavior feature sequences comprises a plurality of behavior features belonging to the same instruction parameter arranged in time sequence;
[0007] From the plurality of groups of behavior feature sequences, a target behavior feature sub-sequence matching at least a specified number of groups of behavior feature sequences is determined;
[0008] Generating a test script according to the target behavior feature sub-sequence.
[0009] Optionally, the behavior instruction comprises a click instruction, an input instruction and a sliding instruction; the collecting of the behavior instruction issued by the cloud test platform for controlling the terminal under test, the instruction parameter corresponding to the behavior instruction, and the execution parameter when the terminal under test executes the behavior instruction comprises:
[0010] collecting a click instruction, instruction parameters corresponding to the click instruction, and a click attribute and an interface image when the click instruction is executed by the terminal under test;
[0011] collecting an input instruction, instruction parameters corresponding to the input instruction, and an input position and input information when the input instruction is executed by the terminal under test; and taking the input position and the input information as the execution parameters corresponding to the input instruction;
[0012] collecting a sliding instruction, instruction parameters corresponding to the sliding instruction, and a sliding position when the sliding instruction is executed by the terminal under test; and taking the sliding position as the execution parameters corresponding to the sliding instruction.
[0013] Optionally, the determining of the execution parameters corresponding to the click instruction according to the click attribute and the interface image comprises:
[0014] identifying a region indicated by the click position in the interface image to obtain a click object corresponding to the click instruction, the click object comprising a click image and / or a click text;
[0015] taking the click attribute and the click object as the execution parameters corresponding to the click instruction.
[0016] Optionally, the determining of the behavior feature corresponding to each behavior instruction according to a plurality of behavior instructions and the execution parameters corresponding to each behavior instruction comprises:
[0017] if the behavior instruction is a click instruction, determining a target button according to the click object to generate a behavior feature for representing a behavior of clicking the target button according to the click attribute;
[0018] if the behavior instruction is an input instruction, determining a target input box according to the input position to generate a behavior feature for representing a behavior of inputting the input information into the target input box;
[0019] if the behavior instruction is a sliding instruction, generating a behavior feature for representing a behavior of sliding from a start position to an end position according to the start position and the end position included in the sliding position.
[0020] Optionally, the determining of the target behavior feature sub-sequence matching at least a specified number of behavior feature sequences from a plurality of behavior feature sequences comprises:
[0021] dividing each of the behavior feature sequences into a plurality of behavior feature subsequences, the behavior feature subsequences including behavior features in time sequence;
[0022] For each of the behavior feature sequences, if the behavior feature sequence includes a behavior feature subsequence matching the first behavior feature subsequence, the first behavior feature subsequence is determined to match the behavior feature sequence, the first behavior feature subsequence being any of the behavior feature subsequences;
[0023] If the number of behavior feature sequences matching the first behavior feature subsequence is greater than or equal to the specified number, the first behavior feature subsequence is determined to be the target behavior feature subsequence.
[0024] Optionally, if the behavior feature sequence includes a behavior feature subsequence matching the first behavior feature subsequence, the first behavior feature subsequence is determined to match the behavior feature sequence, including:
[0025] If the second behavior feature subsequence included in the behavior feature sequence includes a plurality of behavior features corresponding one-to-one to a plurality of behavior features included in the first behavior feature subsequence, the first behavior feature subsequence is determined to match the behavior feature sequence;
[0026] The second behavior feature subsequence being any of the behavior feature subsequences included in the behavior feature sequence.
[0027] Optionally, the method further includes:
[0028] According to the plurality of behavior features included in the target behavior feature subsequence, determining an execution logic corresponding to each of the behavior features;
[0029] According to the order of each of the behavior features in the target behavior feature subsequence, the execution logic corresponding to each of the behavior features is composed into the test script.
[0030] Optionally, the method further includes:
[0031] Sending the test script to the terminal under test through the cloud test platform, so that the terminal under test executes the test script;
[0032] If the execution result of the terminal under test executing the test script is passed, storing the test script;
[0033] If the execution result of the terminal under test executing the test script is failed, updating the test script.
[0034] According to a second aspect of the embodiments of the present disclosure, a processing device for testing scripts is provided, applied to a cloud test platform, and the device comprises:
[0035] a collection module, configured to collect behavior instructions for controlling a terminal under test, instruction parameters corresponding to the behavior instructions, and execution parameters when the terminal under test executes the behavior instructions, the instruction parameters comprising a user identifier for issuing the behavior instructions and / or a time period for issuing the behavior instructions;
[0036] a sequence determination module, configured to determine, according to the behavior instructions and the execution parameters corresponding to each of the behavior instructions, a behavior feature corresponding to each of the behavior instructions, to obtain a plurality of groups of behavior feature sequences, each group of behavior feature sequences comprising a plurality of behavior features belonging to the same instruction parameter arranged in time sequence;
[0037] a sub-sequence determination module, configured to determine, from the plurality of groups of behavior feature sequences, a target behavior feature sub-sequence matching at least a specified number of groups of behavior feature sequences;
[0038] a generation module, configured to generate a test script according to the target behavior feature sub-sequence.
[0039] Optionally, the behavior instructions comprise click instructions, input instructions and sliding instructions, and the collection module comprises:
[0040] a first collection sub-module, configured to collect click instructions, instruction parameters corresponding to the click instructions, and click attributes and interface images when the terminal under test executes the click instructions, to determine execution parameters corresponding to the click instructions according to the click attributes and the interface images, the click attributes comprising a click position and / or a click number;
[0041] a second collection sub-module, configured to collect input instructions, instruction parameters corresponding to the input instructions, and input positions and input information when the terminal under test executes the input instructions, and to take the input positions and the input information as the execution parameters corresponding to the input instructions;
[0042] a third collection sub-module, configured to collect sliding instructions, instruction parameters corresponding to the sliding instructions, and sliding positions when the terminal under test executes the sliding instructions, and to take the sliding positions as the execution parameters corresponding to the sliding instructions.
[0043] Optionally, the first collection sub-module is configured to:
[0044] identify a region in the interface image indicated by the click position, to obtain a click object corresponding to the click instruction, the click object comprising a click image and / or click text;
[0045] The click attribute and the click object are taken as execution parameters corresponding to the click instruction.
[0046] Optionally, the sequence determining module is configured to:
[0047] If the behavior instruction is a click instruction, a target button is determined according to the click object, so as to generate a behavior feature for representing clicking the target button according to the click attribute;
[0048] If the behavior instruction is an input instruction, a target input box is determined according to the input position, so as to generate a behavior feature for representing inputting the input information in the target input box;
[0049] If the behavior instruction is a sliding instruction, a starting position and an ending position included in the sliding position are taken, so as to generate a behavior feature for representing sliding from the starting position to the ending position.
[0050] Optionally, the sub-sequence determining module comprises:
[0051] A division sub-module is configured to divide each group of the behavior feature sequence into a plurality of behavior feature subsequences, and the behavior features included in the behavior feature subsequences are time-sequentially continuous.
[0052] A matching sub-module is configured to, for each group of the behavior feature sequence, if the group of behavior feature sequences includes a behavior feature subsequence matching a first behavior feature subsequence, determine that the first behavior feature subsequence matches the group of behavior feature sequences, the first behavior feature subsequence being any of the behavior feature subsequences.
[0053] A determination sub-module is configured to, if the number of the groups of behavior feature sequences matching the first behavior feature subsequence is greater than or equal to the specified number, determine that the first behavior feature subsequence is the target behavior feature subsequence.
[0054] Optionally, the matching sub-module is configured to:
[0055] If a second behavior feature subsequence included in the group of behavior feature sequences includes a plurality of behavior features corresponding one-to-one to a plurality of behavior features included in the first behavior feature subsequence, it is determined that the first behavior feature subsequence matches the group of behavior feature sequences.
[0056] The second behavior feature subsequence is any of the behavior feature subsequences included in the group of behavior feature sequences.
[0057] Optionally, the generation module is configured to:
[0058] According to the behavior characteristics included in the target behavior characteristic subsequence, the execution logic corresponding to each behavior characteristic is determined; and the execution logic corresponding to each behavior characteristic is composed into the test script according to the order of each behavior characteristic in the target behavior characteristic subsequence.
[0059] Optionally, the apparatus further comprises:
[0060] The execution module is configured to send the test script to the terminal under test through the cloud test platform, so that the terminal under test executes the test script; if the execution result of the terminal under test executing the test script is pass, the test script is stored; and if the execution result of the terminal under test executing the test script is fail, the test script is updated.
[0061] According to a third aspect of the embodiments of the present disclosure, a computer readable storage medium is provided, which stores a computer program. The program is executed by a processor to implement the steps of the method of the first aspect of the embodiments of the present disclosure.
[0062] According to a fourth aspect of the embodiments of the present disclosure, an electronic device is provided, which comprises:
[0063] A memory storing a computer program;
[0064] A processor configured to execute the computer program in the memory to implement the steps of the method of the first aspect of the embodiments of the present disclosure.
[0065] According to the above technical solution, the present disclosure first collects the behavior instructions issued by the cloud test platform for controlling the terminal under test, the instruction parameters corresponding to the behavior instructions, and the execution parameters when the terminal under test executes the behavior instructions. Then, according to the plurality of behavior instructions and the execution parameters corresponding to each behavior instruction, the behavior characteristics corresponding to each behavior instruction are determined, and the behavior characteristics corresponding to the plurality of behavior instructions are divided into a plurality of behavior characteristic sequences. Then, the target behavior characteristic subsequence matching at least a specified number of behavior characteristic sequences is determined from the plurality of behavior characteristic sequences, and finally the test script is generated according to the target behavior characteristic subsequence. The present disclosure collects the behavior instructions and the instruction parameters and the execution parameters, obtains a plurality of behavior characteristic sequences, extracts a representative target behavior characteristic subsequence from the plurality of behavior characteristic sequences, to automatically generate a test script, without manually writing code, thereby improving the generation efficiency and accuracy of the test script.
[0066] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF DRAWINGS
[0067] The accompanying drawings are included to provide a further understanding of the disclosure and constitute a part of the specification, illustrate embodiments of the present disclosure and are used to explain the present disclosure together with the specific embodiments described below, but do not constitute a limitation on the present disclosure. In the drawings:
[0068] Figure 1 is a deployment schematic diagram of a cloud test platform and a terminal under test according to an exemplary embodiment;
[0069] Figure 2 is a flowchart of a test script processing method according to an exemplary embodiment;
[0070] Figure 3 is a flowchart of another test script processing method according to an exemplary embodiment;
[0071] Figure 4 is a flowchart of another test script processing method according to an exemplary embodiment;
[0072] Figure 5 is a flowchart of another test script processing method according to an exemplary embodiment;
[0073] Figure 6 is a flowchart of another test script processing method according to an exemplary embodiment;
[0074] Figure 7 is a flowchart of another test script processing method according to an exemplary embodiment;
[0075] Figure 8 is a block diagram of a test script processing apparatus according to an exemplary embodiment;
[0076] Figure 9 is a block diagram of another test script processing apparatus according to an exemplary embodiment;
[0077] Figure 10 is a block diagram of another test script processing apparatus according to an exemplary embodiment;
[0078] Figure 11 is a block diagram of another test script processing apparatus according to an exemplary embodiment;
[0079] Figure 12 is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0080] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The following description is made with reference to the accompanying drawings in which like reference numerals refer to like elements, unless the context of use indicates otherwise. The following description of exemplary embodiments is not representative of all embodiments consistent with the present disclosure. Rather, it is merely an example of apparatus and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0081] Before introducing the test script processing method, device, storage medium and electronic device provided by the present disclosure, first introduce the application scenario involved in each embodiment of the present disclosure, which can be a test scenario, including: a cloud test platform and one or more tested terminals, as shown in Figure 1 The user can issue a behavior instruction through the cloud test platform to control the tested terminal to execute the behavior instruction, and the cloud test platform can also display the execution information generated during the execution of the behavior instruction by the tested terminal (such as image information displayed on the interface during the execution of the behavior instruction by the tested terminal) to the user. The cloud test platform can be in the form of an application program or a web page, and the present disclosure does not make specific limitations thereon. The tested terminal can include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers.
[0082] Figure 2 is a flowchart of a test script processing method according to an exemplary embodiment, as shown in Figure 2 The method is applied to a cloud test platform and includes the following steps:
[0083] Step 101, collect the behavior instruction for controlling the tested terminal, the instruction parameter corresponding to the behavior instruction, and the execution parameter of the tested terminal when executing the behavior instruction, which are issued through the cloud test platform. The instruction parameter includes the user identifier of issuing the behavior instruction and / or the time period of issuing the behavior instruction.
[0084] For example, the cloud measurement platform can collect each time the behavior instruction is issued, and record the corresponding instruction parameters each time the behavior instruction is issued. The instruction parameters may, for example, include a user identifier for issuing the behavior instruction, and / or a time period for issuing the behavior instruction, wherein the user identifier is used to indicate the identity of the user issuing the behavior instruction, which may, for example, be a user account, and the time period can be understood as a time range to which the time for issuing the behavior instruction belongs, for example, the time for issuing the behavior instruction is 18:05 on July 12, 2021, and the time period is divided according to 24 hours, so the time period to which the time for issuing the behavior instruction belongs is July 12, 2021. Further, the cloud measurement platform will also collect the execution parameters of the measured terminal when executing the behavior instruction after sending the behavior instruction to the measured terminal. The execution parameters can be understood as the parameters when executing the behavior instruction. The execution parameters can be directly collected by the cloud measurement platform, or can be extracted by the cloud measurement platform from the execution information generated during the execution of the behavior instruction by the measured terminal. For example, if the behavior instruction is an input instruction, the execution parameters can include the input information input by the user through the cloud measurement platform, and if the behavior instruction is a click instruction, the execution parameters can include a click button extracted by the cloud measurement platform from the image information displayed on the display interface of the measured terminal.
[0085] In step 102, according to the plurality of behavior instructions and the execution parameters corresponding to each behavior instruction, the behavior characteristics corresponding to each behavior instruction are determined to obtain a plurality of behavior characteristic sequences, each behavior characteristic sequence including a plurality of behavior characteristics belonging to the same instruction parameters arranged in time sequence.
[0086] For example, the cloud measurement platform can collect a large number of behavior instructions, as well as corresponding instruction parameters and execution parameters. Then, according to the instruction parameters, the large number of behavior instructions are divided into a plurality of instruction groups, each instruction group including a plurality of behavior instructions arranged in time sequence and belonging to the same instruction parameters. It can be understood that the behavior instructions included in each instruction group have relevance. For example, the plurality of behavior instructions included in an instruction group correspond to the same user identifier (i.e., the behavior instructions included in the instruction group are all issued by the same user). For another example, the plurality of behavior instructions included in an instruction group correspond to the same time period (i.e., the behavior instructions included in the instruction group are all issued in the same time period).
[0087] Then, for the plurality of behavior instructions included in each instruction group, the behavior characteristics corresponding to each behavior instruction and the corresponding execution parameters can be determined, so as to form a behavior characteristic sequence including the plurality of behavior characteristics corresponding to the plurality of behavior instructions included in the instruction group. The behavior characteristics can represent the corresponding behavior instructions and the execution parameters.
[0088] Step 103, determining a target behavior characteristic sub-sequence matching at least a specified number of groups of behavior characteristic sequences from the groups of behavior characteristic sequences.
[0089] For example, after obtaining the groups of behavior characteristic sequences, the groups of behavior characteristic sequences can be analyzed to extract a target characteristic sub-sequence. The target characteristic sub-sequence can be understood as a part of a group of behavior characteristic sequences, which includes a plurality of behavior characteristics arranged in time sequence. The number of behavior characteristics included in the target characteristic sub-sequence is less than or equal to the number of behavior characteristics included in the group of behavior characteristic sequences. The target behavior characteristic sub-sequence matching at least a specified number of groups of behavior characteristic sequences can be understood as that the target behavior characteristic sub-sequence includes a plurality of behavior characteristics that are representative and regularly appear. For example, when each user controls a terminal under test to run an application through a cloud test platform, the user often needs to log in to the application and then perform specific operations. Therefore, a group of behavior instructions included in the login process is representative and regularly appears, and a plurality of corresponding behavior characteristics can form a target behavior characteristic sub-sequence. The target behavior characteristic sub-sequence can be one or more groups, which is not limited in the present disclosure. Specifically, if a group of behavior characteristic sequences includes a target behavior characteristic sub-sequence, it means that the group of behavior characteristic sequences matches the target behavior characteristic sub-sequence. If a group of behavior characteristic sequences includes a plurality of continuous behavior characteristics matching the behavior characteristics included in the target behavior characteristic sub-sequence, it means that the group of behavior characteristic sequences matches the target behavior characteristic sub-sequence. The matching behavior characteristics can be understood as that the behavior instructions represented by the behavior characteristics are the same, and the execution parameters are similar.
[0090] For example, a behavior characteristic sequence includes three behavior characteristics A, B, and C. A target behavior characteristic sub-sequence includes two behavior characteristics B and C. It can be determined that the behavior characteristic sequence matches the target behavior characteristic sub-sequence. For another example, a behavior characteristic sequence includes three behavior characteristics A1, B1, and C1. A target behavior characteristic sub-sequence includes two behavior characteristics B1 and C2. B1 represents a click instruction with a click “enter” button, C1 represents an input instruction with an input “admin”, and C2 represents an input instruction with an input “user”. C1 and C2 represent the same behavior instruction and similar execution parameters. It can be determined that the behavior characteristic sequence matches the target behavior characteristic sub-sequence.
[0091] Step 104, generating a test script according to the target behavior characteristic sub-sequence.
[0092] For example, after a representative and regularly occurring target behavior characteristic sub-sequence is determined from the multiple groups of behavior characteristic sequences, a test script can be generated according to the multiple behavior characteristics included in the target behavior characteristic sub-sequence. Specifically, a code segment that can implement a behavior instruction represented by each behavior characteristic and a corresponding execution parameter can be found in a preset code library, and then multiple code segments can be spliced according to the order of each behavior characteristic in the target behavior characteristic sub-sequence, so that a test script that can implement multiple behavior instructions can be obtained. In this way, the multiple groups of behavior characteristic sequences collected by the cloud test platform can automatically generate a test script without manual code writing, thereby improving the generation efficiency and accuracy of the test script. Meanwhile, the cloud test platform can collect various behavior instructions without the need for application-specific point embedding, thereby improving the universality of test script generation.
[0093] To sum up, the present disclosure first collects behavior instructions issued by a cloud test platform for controlling a terminal under test, instruction parameters corresponding to the behavior instructions, and execution parameters of the terminal under test when executing the behavior instructions. Then, according to the multiple behavior instructions and the execution parameters corresponding to each behavior instruction, the behavior characteristic corresponding to each behavior instruction is determined, and the behavior characteristics corresponding to the multiple behavior instructions are divided into multiple groups of behavior characteristic sequences. Then, a target behavior characteristic sub-sequence that matches at least a specified number of groups of behavior characteristic sequences is determined from the multiple groups of behavior characteristic sequences, and finally a test script is generated according to the target behavior characteristic sub-sequence. The present disclosure collects behavior instructions and instruction parameters and execution parameters to obtain multiple groups of behavior characteristic sequences, and extracts a representative target behavior characteristic sub-sequence from the multiple groups of behavior characteristic sequences to automatically generate a test script without manual code writing, thereby improving the generation efficiency and accuracy of the test script.
[0094] Figure 3 is a flowchart of another test script processing method according to an example embodiment, as shown in Figure 3 The behavior instructions include click instructions, input instructions, and swipe instructions. The implementation of step 101 can include:
[0095] In step 1011, the click instruction, the instruction parameter corresponding to the click instruction, and the click attribute and interface image of the terminal under test when executing the click instruction are collected. The execution parameter corresponding to the click instruction is determined according to the click attribute and the interface image, and the click attribute includes the click position and / or the click times.
[0096] In step 1012, the input instruction, the instruction parameter corresponding to the input instruction, and the input position and input information of the terminal under test when executing the input instruction are collected. The input position and input information are used as the execution parameter corresponding to the input instruction.
[0097] At step 1013, the sliding instruction, the instruction parameter corresponding to the sliding instruction, and the sliding position when the terminal under test executes the sliding instruction are collected. The sliding position is taken as the execution parameter corresponding to the sliding instruction.
[0098] For example, the behavior instruction can be divided into three types, i.e., a click instruction, an input instruction, and a sliding instruction. The cloud measurement platform can collect the corresponding execution parameters in different manners according to different behavior instructions.
[0099] Specifically, for the click instruction, the cloud measurement platform collects the click instruction and the corresponding instruction parameter, and simultaneously collects the click attribute and the interface image when the terminal under test executes the click instruction. The click attribute can include the click position (for example, the position coordinate) and / or the click times (for example, single click, double click, etc.). Then, the execution parameter corresponding to the click instruction can be determined according to the click attribute and the interface image. The execution parameter can be understood as the click object of the click instruction, and can include the click image and / or the click text. According to the click image and the click text, the button clicked by the click instruction can be determined.
[0100] For the input instruction, the cloud measurement platform collects the input instruction and the corresponding instruction parameter, and simultaneously collects the input position and the input information when the terminal under test executes the input instruction, so as to take the input position and the input information as the execution parameter corresponding to the input instruction. The input position can be the position coordinate, which is used to indicate the input box corresponding to the input instruction. The input information can be understood as the input string.
[0101] For the sliding instruction, the cloud measurement platform collects the sliding instruction and the corresponding instruction parameter, and simultaneously collects the sliding position when the terminal under test executes the sliding instruction, so as to take the sliding position as the execution parameter corresponding to the sliding instruction. The sliding position can include the start position and the end position of the sliding instruction.
[0102] In an implementation manner, step 1011 can be implemented by the following steps.
[0103] Step 1), the region indicated by the click position in the interface image is recognized, so as to obtain the click object corresponding to the click instruction. The click object includes the click image and / or the click text.
[0104] Step 2), the click attribute and the click object are taken as the execution parameter corresponding to the click instruction.
[0105] For example, when the behavior instruction is a click instruction, the cloud test platform can determine the click object of the click instruction by collecting the click attribute and the interface image when the terminal under test executes the click instruction. For example, the target region for executing the click instruction can be determined in the interface image according to the click position, and then the target region in the interface image is identified to obtain the click object included in the target region. The click object can include a click image and / or a click text. For example, the target region can be identified by a preset image recognition algorithm to obtain the click image. The target region can also be identified by an OCR (Optical Character Recognition) algorithm to obtain the click text.
[0106] Figure 4 is a flowchart of another method for processing a test script according to an example embodiment, as shown in Figure 4 Step 102 can be implemented by the following steps:
[0107] In step 1021, if the behavior instruction is a click instruction, a target button is determined according to the click object to generate a behavior feature for representing clicking the target button according to the click attribute.
[0108] In step 1022, if the behavior instruction is an input instruction, a target input box is determined according to the input position to generate a behavior feature for representing inputting input information in the target input box.
[0109] In step 1023, if the behavior instruction is a sliding instruction, a behavior feature for representing sliding from a start position to an end position is generated according to the start position and the end position included in the sliding position.
[0110] For example, the behavior feature can represent a behavior instruction and a corresponding execution parameter. In the same way, the cloud test platform can determine the behavior feature in different ways for different behavior instructions. Specifically, for a click instruction, the cloud test platform can determine a target button according to a click object, so as to obtain a behavior feature representing clicking the target button according to a click attribute. For example, if the click object is a text "login", the target button can be determined as a login button, and if the click times is 1, the behavior feature can represent a single click on the login button. For an input instruction, the cloud test platform can determine a target input box according to an input position, so as to obtain a behavior feature representing inputting input information in the target input box. For example, if the target input box indicated by the input position is a username input box, and the input information is "user", the behavior feature can represent inputting "user" in the username input box. For a sliding instruction, the cloud test platform can determine a start position and an end position included in a sliding position, so as to obtain a behavior feature representing sliding from the start position to the end position. The cloud test platform can also determine a sliding distance and a sliding direction indicated by the sliding position, so as to obtain a behavior feature representing sliding the sliding distance according to the sliding direction.
[0111] Figure 5 FIG. 10 is a flowchart illustrating another method for processing a test script according to an example embodiment. Figure 5 As shown in FIG. 10, step 103 can include:
[0112] Step 1031, dividing each group of behavior feature sequences into a plurality of behavior feature subsequences, the behavior features included in the behavior feature subsequences being continuous in time sequence.
[0113] For example, in determining the target behavior feature subsequence, each group of behavior feature sequences can be divided into a plurality of behavior feature subsequences, the behavior features included in the behavior feature subsequences being continuous in time sequence. A plurality of sliding windows can be set to take a plurality of behavior feature subsequences from each group of behavior feature sequences. The plurality of behavior feature subsequences taken from each group of behavior feature sequences can overlap with each other. For example, a behavior feature sequence includes six behavior features A, B, C, D, E and F. A sliding window with a length of 3 can be selected first to obtain four behavior feature subsequences with a length of 3: {A, B, C}, {B, C, D}, {C, D, E} and {D, E, F}. Then a sliding window with a length of 4 can be selected to obtain three behavior feature subsequences with a length of 4: {A, B, C, D}, {B, C, D, E} and {C, D, E, F}. Then a sliding window with a length of 5 can be selected to obtain two behavior feature subsequences with a length of 5: {A, B, C, D, E} and {B, C, D, E, F}. In this way, the behavior feature sequence is divided into nine behavior feature subsequences.
[0114] Step 1032, for each group of behavior feature sequences, if the group of behavior feature sequences includes a behavior feature sub-sequence matching the first behavior feature sub-sequence, determine that the first behavior feature sub-sequence matches the group of behavior feature sequences, and the first behavior feature sub-sequence is any behavior feature sub-sequence.
[0115] Step 1033, if the number of groups of behavior feature sequences matching the first behavior feature sub-sequence is greater than or equal to a specified number, determine that the first behavior feature sub-sequence is the target behavior feature sub-sequence.
[0116] For example, any behavior feature sub-sequence can be taken as the first behavior feature sub-sequence, and then the first behavior feature sub-sequence is compared with the plurality of behavior feature sub-sequences included in each group of behavior feature sequences. If the group of behavior feature sequences includes a behavior feature sub-sequence matching the first behavior feature sub-sequence, it is determined that the first behavior feature sub-sequence matches the group of behavior feature sequences. If each behavior feature sub-sequence included in the group of behavior feature sequences does not match the first behavior feature sub-sequence, it is determined that the first behavior feature sub-sequence does not match the group of behavior feature sequences. The number of groups of behavior feature sequences matching the first behavior feature sub-sequence can be counted. If the number is greater than or equal to a specified number, the first behavior feature sub-sequence can be determined as the target behavior feature sub-sequence. The specified number can be pre-set, or can be determined according to the number of groups of behavior feature sequences. For example, if there are 100 groups of behavior feature sequences obtained in step 102, the specified number can be 100*20% = 20 groups.
[0117] In an implementation, the implementation of step 1032 can include:
[0118] If the plurality of behavior features included in the second behavior feature sub-sequence included in the group of behavior feature sequences one-to-one correspond to the plurality of behavior features included in the first behavior feature sub-sequence, it is determined that the first behavior feature sub-sequence matches the group of behavior feature sequences.
[0119] The second behavior feature sub-sequence is any behavior feature sub-sequence included in the group of behavior feature sequences.
[0120] For example, the determination of whether the first behavior feature sub-sequence matches a group of behavior feature sequences can be achieved by taking any behavior feature sub-sequence in the group of behavior feature sequences as a second behavior feature sub-sequence, and then comparing the behavior features included in the first behavior feature sub-sequence with the behavior features included in the second behavior feature sub-sequence. If the behavior features included in the second behavior feature sub-sequence correspond to the behavior features included in the first behavior feature sub-sequence one by one, it can be determined that the first behavior feature sub-sequence matches the group of behavior feature sequences. The one-to-one correspondence of the behavior features means that the behavior instructions represented by the behavior features are the same, and the order of the behavior instructions represented by the behavior features in the first behavior feature sub-sequence and the second behavior feature sub-sequence is the same, and the execution parameters represented by the behavior features match. The rule of execution parameter matching can be determined according to the type of the corresponding behavior instruction.
[0121] For example, if the behavior instruction is a click instruction, the rule of execution parameter matching can be that the click object is the same. If the behavior instruction is an input instruction, the rule of execution parameter matching can be that the input position is the same and the input information is similar (for example, the input information is a mobile phone number or the input information is a city name, etc.). If the behavior instruction is a sliding instruction, the rule of execution parameter matching can be that the sliding position is similar (for example, the starting position is close, the ending position is close, etc.). Taking the first behavior feature sub-sequence including X1, Y1, and Z1, and the second behavior feature sub-sequence including X2, Y1, and Z2 as an example, X1 represents an input instruction, the input position is a telephone input box, and the input information is “12345”. X2 represents an input instruction, the input position is a telephone input box, and the input information is “56789”. Y1 represents a click instruction, and the click object is a “login” button. Z1 represents a sliding instruction, and the sliding position is from point a to point b. Z2 represents a sliding instruction, and the sliding position is from point c to point b. The distance between c and a is close. It can be determined that the first behavior feature sub-sequence and the second behavior feature sub-sequence correspond to each other.
[0122] Figure 6 is a flowchart of another method for processing a test script according to an example embodiment, as shown in Figure 6 Step 104 can be implemented by the following steps:
[0123] Step 1041, determining the execution logic corresponding to each behavior feature according to the behavior features included in the target behavior feature sub-sequence.
[0124] Step 1042, composing the execution logic corresponding to each behavior feature into a test script according to the order of each behavior feature in the target behavior feature sub-sequence.
[0125] For example, a code library can be established in advance, including code segments capable of implementing various behavior instructions, and then according to the multiple behavior characteristics included in the target behavior characteristic subsequence, the code segment corresponding to the behavior instruction represented by each behavior characteristic is determined, and then the execution parameter represented by the behavior characteristic is taken as the input parameter of the code segment to obtain the execution logic corresponding to the behavior characteristic. Then according to the order of each behavior characteristic in the target behavior characteristic subsequence, the execution logic corresponding to each behavior characteristic is composed into a test script. Taking the behavior instruction represented by the behavior characteristic as the input instruction and the execution parameter as the input "admin" as an example, the code segment capable of implementing the input instruction can be searched in the code library, and "admin" is taken as the input parameter to obtain the execution logic capable of implementing the input "admin".
[0126] Figure 7 is a flowchart of another method for processing a test script according to an example embodiment, as shown in Figure 7 The method can further include:
[0127] In step 105, the test script is sent to the terminal under test through the cloud test platform to enable the terminal under test to execute the test script.
[0128] In step 106, if the execution result of the terminal under test executing the test script is pass, the test script is stored. If the execution result of the terminal under test executing the test script is fail, the test script is updated.
[0129] For example, after the test script is generated, the cloud test platform can send the test script to the terminal under test to control the terminal under test to execute the test script. If the execution result of the terminal under test executing the test script is pass, indicating that the test script can be executed normally, the test script can be saved, for example, the test script can be saved to a script library. If the execution result of the terminal under test executing the test script is fail, indicating that the test script cannot be executed normally, the test script can be updated according to the target behavior characteristic subsequence and the multiple groups of behavior characteristic sequences, and then the updated test script is sent to the terminal under test, and the above steps are repeated until the test script can be executed normally.
[0130] Specifically, the rule for updating the test script can be, for example, to correct the behavior characteristic included in the target behavior characteristic subsequence according to the multiple groups of behavior characteristic sequences. For example, the behavior instruction represented by a behavior characteristic included in the target behavior characteristic subsequence is an input instruction, and the execution parameter is an input "admin", and the behavior instruction represented by the corresponding behavior characteristic in the behavior characteristic sequence matched with the target behavior characteristic subsequence is an input instruction, and the execution parameter is an input "user", then the execution parameter represented by the behavior characteristic in the target behavior characteristic subsequence can be corrected to an input "user".
[0131] According to the above, the disclosure first collects the behavior instructions issued by the cloud test platform for controlling the measured terminal, the instruction parameters corresponding to the behavior instructions, and the execution parameters when the measured terminal executes the behavior instructions. Then, according to the multiple behavior instructions and the execution parameters corresponding to each behavior instruction, the behavior characteristics corresponding to each behavior instruction are determined, and the behavior characteristics corresponding to the multiple behavior instructions are divided into multiple groups of behavior characteristic sequences. Then, the target behavior characteristic sub-sequence matching at least a specified number of groups of behavior characteristic sequences is determined from the multiple groups of behavior characteristic sequences, and finally the test script is generated according to the target behavior characteristic sub-sequence. The disclosure collects the behavior instructions and the instruction parameters and the execution parameters, obtains multiple groups of behavior characteristic sequences, and extracts the representative target behavior characteristic sub-sequence from the multiple groups of behavior characteristic sequences, to automatically generate the test script without manually writing the code, thereby improving the generation efficiency and accuracy of the test script.
[0132] Figure 8 is a block diagram of a test script processing device according to an exemplary embodiment, as shown in Figure 8 applied to the cloud test platform, the device 200 can include:
[0133] The acquisition module 201 is configured to acquire the behavior instructions issued by the cloud test platform for controlling the measured terminal, the instruction parameters corresponding to the behavior instructions, and the execution parameters when the measured terminal executes the behavior instructions. The instruction parameters include the user identifier of the user issuing the behavior instruction, and / or the time period of issuing the behavior instruction.
[0134] The sequence determination module 202 is configured to determine the behavior characteristics corresponding to each behavior instruction according to the multiple behavior instructions and the execution parameters corresponding to each behavior instruction, to obtain multiple groups of behavior characteristic sequences. Each group of behavior characteristic sequences includes multiple behavior characteristics belonging to the same instruction parameter arranged in time sequence.
[0135] The sub-sequence determination module 203 is configured to determine the target behavior characteristic sub-sequence matching at least a specified number of groups of behavior characteristic sequences from the multiple groups of behavior characteristic sequences.
[0136] The generation module 204 is configured to generate the test script according to the target behavior characteristic sub-sequence.
[0137] Figure 9 is a block diagram of another test script processing device according to an exemplary embodiment, as shown in Figure 9 The behavior instructions include click instructions, input instructions, and sliding instructions. The acquisition module 201 can include:
[0138] The first acquisition submodule 2011 is configured to acquire a click instruction, instruction parameters corresponding to the click instruction, and a click attribute and an interface image when the click instruction is executed by the terminal under test. The execution parameters corresponding to the click instruction are determined according to the click attribute and the interface image. The click attribute includes a click position and / or a click frequency.
[0139] The second acquisition submodule 2012 is configured to acquire an input instruction, instruction parameters corresponding to the input instruction, and an input position and input information when the input instruction is executed by the terminal under test. The input position and the input information are taken as the execution parameters corresponding to the input instruction.
[0140] The third acquisition submodule 2013 is configured to acquire a sliding instruction, instruction parameters corresponding to the sliding instruction, and a sliding position when the sliding instruction is executed by the terminal under test. The sliding position is taken as the execution parameters corresponding to the sliding instruction.
[0141] In an implementation manner, the first acquisition submodule 2011 can be configured to perform the following steps:
[0142] Step 1) identifying a region indicated by the click position in the interface image to obtain a click object corresponding to the click instruction. The click object includes a click image and / or a click text.
[0143] Step 2) taking the click attribute and the click object as the execution parameters corresponding to the click instruction.
[0144] In another implementation manner, the sequence determination module can be configured to:
[0145] If the behavior instruction is a click instruction, a target button is determined according to the click object to generate a behavior feature for representing clicking the target button according to the click attribute. If the behavior instruction is an input instruction, a target input box is determined according to the input position to generate a behavior feature for representing inputting the input information in the target input box. If the behavior instruction is a sliding instruction, a behavior feature for representing sliding from a start position to an end position is generated according to the start position and the end position included in the sliding position.
[0146] Figure 10 is a block diagram of another processing apparatus of a test script according to an example embodiment, as Figure 10 As shown in FIG. 20, the subsequence determination module 203 can include:
[0147] The division submodule 2031 is configured to divide each group of behavior feature sequences into a plurality of behavior feature subsequences. The behavior features included in the behavior feature subsequences are time-sequentially continuous.
[0148] The matching submodule 2032 is configured to determine, for each group of behavior feature sequences, that the first behavior feature subsequence matches the group of behavior feature sequences if the group of behavior feature sequences includes the behavior feature subsequence matching the first behavior feature subsequence, and the first behavior feature subsequence is any behavior feature subsequence.
[0149] The determining submodule 2033 is configured to determine that the first behavior feature subsequence is the target behavior feature subsequence if the number of groups of behavior feature sequences matching the first behavior feature subsequence is greater than or equal to the specified number.
[0150] In yet another implementation manner, the matching submodule 2032 can be configured to:
[0151] The matching submodule 2032 is configured to determine that the first behavior feature subsequence matches the group of behavior feature sequences if the group of behavior feature sequences includes the behavior feature subsequence matching the first behavior feature subsequence, and the first behavior feature subsequence is any behavior feature subsequence.
[0152] The matching submodule 2032 is configured to determine that the first behavior feature subsequence matches the group of behavior feature sequences if the group of behavior feature sequences includes the behavior feature subsequence matching the first behavior feature subsequence, and the first behavior feature subsequence is any behavior feature subsequence.
[0153] In yet another implementation manner, the generating module 204 can be configured to:
[0154] The generating module 204 is configured to determine, according to the plurality of behavior features included in the target behavior feature subsequence, the execution logic corresponding to each behavior feature, and compose the test script by arranging the execution logic corresponding to each behavior feature according to the order of each behavior feature in the target behavior feature subsequence.
[0155] Figure 11 is another block diagram of a processing device of a test script according to an example embodiment, as shown in Figure 11 The device 200 can further include:
[0156] The executing module 205 is configured to send the test script to the terminal under test through the cloud test platform, so that the terminal under test executes the test script. If the execution result of the terminal under test executing the test script is pass, the test script is stored. If the execution result of the terminal under test executing the test script is fail, the test script is updated.
[0157] As to the device in the above embodiments, the specific manners in which various modules perform operations have been described in detail in the embodiments of the method, and will not be described in detail here.
[0158] To sum up, the present disclosure first collects the behavior instructions for controlling the measured terminal, the instruction parameters corresponding to the behavior instructions, and the execution parameters when the measured terminal executes the behavior instructions, which are sent by the cloud measurement platform. Then, according to the multiple behavior instructions and the execution parameters corresponding to each behavior instruction, the behavior characteristics corresponding to each behavior instruction are determined, and the behavior characteristics corresponding to the multiple behavior instructions are divided into multiple groups of behavior characteristic sequences. Then, the target behavior characteristic sub-sequence matching at least a specified number of groups of behavior characteristic sequences is determined from the multiple groups of behavior characteristic sequences, and finally, the test script is generated according to the target behavior characteristic sub-sequence. The present disclosure collects the behavior instructions and the instruction parameters and the execution parameters, obtains multiple groups of behavior characteristic sequences, and extracts the representative target behavior characteristic sub-sequence from the multiple groups of behavior characteristic sequences, to automatically generate the test script, without manually writing the code, thereby improving the generation efficiency and accuracy of the test script.
[0159] Figure 12 is a block diagram of an electronic device 300 according to an example embodiment. As shown in Figure 12 the electronic device 300 can include a processor 301, a memory 302. The electronic device 300 can also include one or more of a multimedia component 303, an input / output (I / O) interface 304, and a communication component 305.
[0160] The processor 301 is configured to control overall operations of the electronic device 300 to complete all or part of the steps in the test script processing method described above. The memory 302 is configured to store various types of data to support operations of the electronic device 300, which can include, for example, instructions for any application or method operating on the electronic device 300, and application-related data, such as contact data, sent and received messages, pictures, audio, video, and the like. The memory 302 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk, or an optical disk. The multimedia component 303 can include a screen and an audio component. The screen can be, for example, a touch screen, and the audio component is configured to output and / or input audio signals. For example, the audio component can include a microphone configured to receive external audio signals. The received audio signals can be further stored in the memory 302 or transmitted through the communication component 305. The audio component also includes at least one speaker configured to output audio signals. The I / O interface 304 provides an interface between the processor 301 and other interface modules, which can be a keyboard, a mouse, a button, and the like. The buttons can be virtual buttons or physical buttons. The communication component 305 is configured to perform wired or wireless communication between the electronic device 300 and other devices. The wireless communication, such as Wi-Fi, Bluetooth, near field communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, and the like, or a combination of one or more of them, is not limited herein. Therefore, the communication component 305 can include, for example, a Wi-Fi module, a Bluetooth module, an NFC module, and the like.
[0161] In an exemplary embodiment, the electronic device 300 can be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements for performing the processing method of the test script as described above.
[0162] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the processing method of the test script as described above. For example, the computer-readable storage medium can be the memory 302 as described above including program instructions, which can be executed by the processor 301 of the electronic device 300 to complete the processing method of the test script as described above.
[0163] In another exemplary embodiment, a computer program product is also provided, which contains a computer program capable of being executed by a programmable device, and the computer program has code portions for executing the processing method of the test script as described above when executed by the programmable device.
[0164] The preferred embodiments of the present disclosure are described in detail above with reference to the accompanying drawings, but the present disclosure is not limited to the specific details of the above-described embodiments, and various simple modifications can be made to the technical solutions of the present disclosure within the scope of the technical concept of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
[0165] In addition, it should be noted that each specific technical feature described in the above specific embodiments can be combined in any appropriate manner without contradiction, and in order to avoid unnecessary repetition, the present disclosure will not further describe various possible combinations.
[0166] In addition, any combination of various different embodiments of the present disclosure can also be made, as long as it does not deviate from the idea of the present disclosure, and it should also be considered as disclosed by the present disclosure.
Claims
1. A method of processing a test script, characterized by, The method is applied to a cloud test platform, and the method comprises the following steps: collecting a behavior instruction for controlling a terminal under test, an instruction parameter corresponding to the behavior instruction, and an execution parameter when the terminal under test executes the behavior instruction, which are sent by the cloud test platform; the instruction parameter comprises a user identifier of sending the behavior instruction and / or a time period of sending the behavior instruction; determining a behavior feature corresponding to each behavior instruction according to a plurality of behavior instructions and the execution parameter corresponding to each behavior instruction, so as to obtain a plurality of behavior feature sequences; each behavior feature sequence comprises a plurality of behavior features which are arranged in time sequence and belong to the same instruction parameter; the plurality of behavior instructions are divided into a plurality of instruction groups; each instruction group comprises a plurality of behavior instructions which are arranged in time sequence and belong to the same instruction parameter; the instruction group corresponds to the behavior feature sequence in one-to-one manner; the behavior feature represents the corresponding behavior instruction and the execution parameter; determining a target behavior feature sub-sequence which matches at least a specified number of behavior feature sequences from the plurality of behavior feature sequences; generating a test script according to the target behavior feature sub-sequence.
2. The method of claim 1, wherein, The behavior instruction comprises a click instruction, an input instruction and a sliding instruction; the collecting of the behavior instruction for controlling the terminal under test, the instruction parameter corresponding to the behavior instruction and the execution parameter when the terminal under test executes the behavior instruction, which are sent by the cloud test platform, comprises the following steps: collecting a click instruction, an instruction parameter corresponding to the click instruction, a click attribute and an interface image when the terminal under test executes the click instruction; determining the execution parameter corresponding to the click instruction according to the click attribute and the interface image; the click attribute comprises a click position and / or a click frequency; collecting an input instruction, an instruction parameter corresponding to the input instruction, an input position and input information when the terminal under test executes the input instruction; and taking the input position and the input information as the execution parameter corresponding to the input instruction; collecting a sliding instruction, an instruction parameter corresponding to the sliding instruction, and a sliding position when the terminal under test executes the sliding instruction; and taking the sliding position as the execution parameter corresponding to the sliding instruction.
3. The method of claim 2, wherein, The determining of the execution parameter corresponding to the click instruction according to the click attribute and the interface image comprises the following steps: identifying a region indicated by the click position in the interface image to obtain a click object corresponding to the click instruction; the click object comprises a click image and / or a click text; taking the click attribute and the click object as the execution parameter corresponding to the click instruction.
4. The method of claim 3, wherein, The determining of the behavior feature corresponding to each behavior instruction according to the plurality of behavior instructions and the execution parameter corresponding to each behavior instruction comprises the following steps: if the behavior instruction is a click instruction, determining a target button according to the click object to generate a behavior feature for representing the clicking of the target button according to the click attribute. If the behavior instruction is an input instruction, a target input box is determined according to the input position, so as to generate a behavior feature for representing inputting the input information in the target input box; If the behavior instruction is a sliding instruction, a behavior feature for representing sliding from a start position to an end position is generated according to the start position and the end position included in the sliding position.
5. The method of claim 1, wherein, The method further includes: dividing each of the behavior feature sequences into a plurality of behavior feature subsequences, the behavior feature subsequences including behavior features in time sequence; for each of the behavior feature sequences, if the behavior feature sequence includes a behavior feature subsequence matching a first behavior feature subsequence, determining that the first behavior feature subsequence matches the behavior feature sequence, the first behavior feature subsequence being any one of the behavior feature subsequences; if the number of behavior feature sequences matching the first behavior feature subsequence is greater than or equal to the specified number, determining that the first behavior feature subsequence is the target behavior feature subsequence.
6. The method of claim 5, wherein, The method further includes: if a second behavior feature subsequence included in the behavior feature sequence includes a plurality of behavior features corresponding one-to-one to a plurality of behavior features included in the first behavior feature subsequence, determining that the first behavior feature subsequence matches the behavior feature sequence; the second behavior feature subsequence being any one of the behavior feature subsequences included in the behavior feature sequence.
7. The method of claim 1, wherein, The method further includes: determining, according to the plurality of behavior features included in the target behavior feature subsequence, an execution logic corresponding to each of the behavior features; arranging the execution logic corresponding to each of the behavior features in the order of the behavior features in the target behavior feature subsequence to form the test script.
8. The method of claim 1, wherein, The method further includes: sending the test script to the terminal under test through the cloud test platform, so that the terminal under test executes the test script; if an execution result of the terminal under test executing the test script is passed, storing the test script; if the execution result of the terminal under test executing the test script is failed, updating the test script.
9. A processing apparatus of a test script, characterized by, The device is applied to a cloud test platform and includes: a collection module configured to collect a behavior instruction for controlling a terminal under test, an instruction parameter corresponding to the behavior instruction, and an execution parameter of the terminal under test when executing the behavior instruction, the instruction parameter including a user identifier of a user issuing the behavior instruction and / or a time period of issuing the behavior instruction; The sequence determining module is configured to determine a behavior characteristic corresponding to each behavior instruction according to the plurality of behavior instructions and the execution parameter corresponding to each behavior instruction, to obtain a plurality of groups of behavior characteristic sequences, each group of behavior characteristic sequences including a plurality of behavior characteristics belonging to the same instruction parameter and arranged in time sequence; the plurality of behavior instructions are divided into a plurality of instruction groups, each instruction group including a plurality of behavior instructions belonging to the same instruction parameter and arranged in time sequence, the instruction group corresponding to the behavior characteristic sequence in one-to-one manner; the behavior characteristic represents the corresponding behavior instruction and the execution parameter; The sub-sequence determining module is configured to determine a target behavior characteristic sub-sequence matching at least a specified number of groups of behavior characteristic sequences from the plurality of groups of behavior characteristic sequences; The generating module is configured to generate a test script according to the target behavior characteristic sub-sequence.
10. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the steps of the method in any one of claims 1-8.
11. An electronic device, comprising: The program is executed by the processor to implement the steps of the method in any one of claims 1-8. The memory has the computer program stored thereon; The processor is configured to execute the computer program in the memory to implement the steps of the method in any one of claims 1-8.
Citation Information
Patent Citations
Test case generation method, device and equipment
CN112115039A
Terminal testing method and device and electronic equipment
CN112241372A