WO2019100635A1 - 自动化测试脚本的编辑方法、装置、终端设备及存储介质 - Google Patents
自动化测试脚本的编辑方法、装置、终端设备及存储介质 Download PDFInfo
- Publication number
- WO2019100635A1 WO2019100635A1 PCT/CN2018/081058 CN2018081058W WO2019100635A1 WO 2019100635 A1 WO2019100635 A1 WO 2019100635A1 CN 2018081058 W CN2018081058 W CN 2018081058W WO 2019100635 A1 WO2019100635 A1 WO 2019100635A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- action
- use case
- basic
- editing
- execution
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Definitions
- the present application relates to the field of automated testing, and in particular, to an editing method, device, terminal device and storage medium for an automated test script.
- test case editing and test case-based test script are two separate steps, that is, the use case editor needs to edit the test case according to the user's needs, and then the script developer is based on the edit. Test the use case editing code to get the test script. As the user's needs change, when the test cases and test scripts are updated, the test cases and the test scripts are independent of each other, and synchronous updates cannot be implemented. In addition, when the test scripts are edited based on the test cases, the script developers need to be compared. High code editing capabilities. Moreover, when the corresponding test scripts are separately edited based on different test cases, there are functionally identical parts between different test cases. If the test scripts are separately edited, the work efficiency may be low due to repeated work.
- the present application provides an editing method, device, terminal device and storage medium for an automated test script, so as to solve the problem that the steps of editing the current test case and the steps of editing the test script based on the test case are independent of one another, resulting in low efficiency of test script editing.
- the present application provides an editing method for an automated test script, including:
- the action execution code of the basic action associated with the use case execution number is invoked to form Target test script
- the use case editing management platform and the use case test management platform are connected by a B/S architecture.
- the present application provides an apparatus for editing an automated test script, including:
- the use case execution number display module is configured to sequentially display at least two use case execution numbers on the configuration interface of the use case editing management platform;
- the original test case obtaining module is configured to associate each of the use case execution numbers with a basic action to form an original test case, and send the original test case to the use case test management platform;
- a target test script obtaining module configured to be associated with the use case execution number according to a display order of at least two of the use case execution execution numbers in the original test case on a configuration interface of the use case test management platform
- the action of the underlying action executes the code to form the target test script.
- the present application provides a terminal device including a memory, a processor, and computer readable instructions stored in the memory and executable on the processor, the processor executing the computer readable instructions The following steps are implemented:
- the action execution code of the basic action associated with the use case execution number is invoked to form Target test script
- the use case editing management platform and the use case test management platform are connected by a B/S architecture.
- the application provides one or more non-transitory readable storage media storing computer readable instructions, such as one or more, when executed by one or more processors
- the processor performs the following steps:
- the action execution code of the basic action associated with the use case execution number is invoked to form Target test script
- the use case editing management platform and the use case test management platform are connected by a B/S architecture.
- Embodiment 1 is a flow chart of an editing method of an automated test script provided in Embodiment 1.
- FIG. 2 is a specific schematic view of step S20 of Figure 1;
- FIG. 3 is another specific schematic diagram of step S20 of FIG. 1;
- step S20 of FIG. 1 is another specific schematic diagram of step S20 of FIG. 1;
- FIG. 5 is a specific schematic view of step S30 of Figure 1;
- FIG. 6 is a schematic diagram of an editing apparatus of an automated test script provided in Embodiment 2;
- FIG. 7 is a schematic diagram of a terminal device provided in Embodiment 4.
- FIG. 1 shows a flow chart of an editing method of an automated test script in this embodiment.
- the editing method of the automated test script can be applied to a financial institution such as a bank, a securities, an insurance or other institution that needs to automatically test the system, so as to test the editing efficiency and reduce the test of the script by using the editing method of the automated test script.
- Script editing costs As shown in FIG. 1, the editing method of the automated test script includes the following steps:
- S10 Display at least two use case execution numbers sequentially on the configuration interface of the use case editing management platform.
- the use case editing management platform refers to the management platform used by testers to create test cases.
- the configuration interface of the use case editing management platform is the interface displayed by the tester when editing the test case. Specifically, when the test case editing instruction input by the tester when clicking the use case editing button, the use case editing management platform jumps based on the use case editing command. Interface.
- the use case execution number is the number of the execution order of each test execution step in the original test case edited by the tester.
- the configuration interface performs the execution number according to the preset number of use cases, such as displaying 1-10 in the order of Arabic numerals. Wait for 10 use cases to execute the number.
- the tester wants to add test cases, you can choose batch add mode or add one by one to reduce the interface resource share and increase the load rate.
- the "add number" button in the configuration interface of the use case editing management platform may be clicked to input an execution number addition instruction to the use case editing management platform, and the execution number is added.
- the number of use case execution numbers to be added to the input can be customized. If the batch addition mode is selected, the number of execution number of the use case is defined as an integer greater than 1. If the item-by-add method is selected, the number of execution numbers of the use case is defined. It is 1 for the purpose of adding convenience.
- the original test case refers to a set of test scenarios including test execution steps obtained by the tester according to the requirements of the system to be tested.
- the basic action is some basic test action pre-stored by the server, such as the action of "login".
- the use case test management platform is a management platform based on test case editing test scripts. Specifically, each use case execution number is associated with a required basic action selected by the tester in the pre-stored basic action (hereinafter referred to as a target action) to form a group comprising at least two basic actions, and at least two The test scenario in which the execution order between the base actions corresponds to the use case execution number, that is, the original test case.
- the original test cases formed based on the basic actions associated with the use case execution number can be executed strictly in accordance with the use case execution number display and execution order in subsequent tests. Ensure that the test to be tested can be performed in the order of the basic actions in the original test case designed by the user to enhance the accuracy of the test.
- the use case editing management platform sends the obtained original test case to the use case test management platform, and sends the reminder information to the test management mailbox, thereby enhancing the real-time synchronization of the test script editing process.
- the use case editing management platform and the use case test management platform are connected through the B/S architecture.
- the B/S architecture is the browser and server structure. Under this structure, the user work interface is implemented by the WEB browser. Very few transaction logic is implemented in the browser, but the main transaction logic is on the server ( Server) implementation.
- the B/S architecture is a network structure mode after the rise of WEB. The WEB browser is the most important application software for the client. Users do not need to download, just install the browser to use, greatly reducing maintenance costs.
- At least two use case execution numbers are sequentially displayed on the configuration interface of the use case editing management platform, and then each use case execution number is associated with a basic action to form an original test case, so that the execution number is based on the use case.
- the original test cases formed by the associated underlying actions can be executed strictly in accordance with the display and execution order of the use case execution numbers in subsequent tests.
- the original test case is then sent to the use case test management platform based on the B/S architecture, so that the user does not need to send the test case to the use case test management platform separately, and has real-time synchronization.
- each use case execution number is associated with a basic action to form an original test case, which specifically includes the following steps:
- S211 Acquire an action selection instruction input by the user in an input box corresponding to each use case execution number, and the action selection instruction includes an action ID and/or an action name.
- the action selection instruction is an instruction for selecting a desired action of the user.
- the action ID is an identifier for uniquely identifying a base action pre-stored in the server.
- the action name refers to the name of the test action input by the tester or the name of the base action pre-stored in the server.
- each use case execution number corresponds to an input box to enable the tester to input the target action, and the tester can input only the action ID, or only input the action name, or can input the action ID and the action name at the same time, and complete the input.
- the corresponding action selection instruction can be input to obtain the required basic action based on the action selection instruction.
- the manner in which the tester obtains the target action may be as follows: First, when the tester knows the action ID and/or the action name of the target action stored in the server in advance, the action ID and/or action of the target action may be directly input. Name to get the target action. Second, when the tester does not know the action ID and/or the action name of the target action stored in the server, the target action name to be achieved by the target action may be input, and the use case editing management platform will test according to the target action name input by the tester.
- the person provides a similar basic action corresponding to the target action for the tester to select the target action from the similar basic actions provided, that is, the user can input an action selection instruction to the use case editing management platform, so as to select an instruction based on the action Similar basic actions determine the target action. It can be understood that if the similar basic action recommended by the use case editing management platform does not have a target action to be used by the user, the use case editing management platform generates a reminder information for reminding the developer to load the target action, and sends the reminder information to the use case editing management platform. The developer's client is used to remind the developer to perform basic action development based on the reminder information, which makes the use case editing management platform more practical and meets the needs of testers.
- the keyword matching algorithm may be used to obtain a similar basic action corresponding to the target action.
- the keyword matching algorithm includes but is not limited to the Knuth-Morris-Pratt (KMP) algorithm.
- KMP Knuth-Morris-Pratt
- the KMP algorithm is an improved string matching algorithm.
- the key of the KMP algorithm is to use the information after the matching failure to minimize the number of matching between the pattern string and the main string to achieve fast matching.
- the KMP algorithm is used to perform keyword matching on the target action input by the tester and the action name stored in the database, to obtain similar basic actions, save time, and improve efficiency.
- the server stores a keyword information table in which the action name of the basic action is stored, and each action name corresponds to one or more keywords, and the target action and the keyword information table are matched by the KMP algorithm.
- the keyword "open browser” can be a browser.
- the server will be a tester in the pre-stored keyword information table by matching the keyword "browser”. It is recommended to "open the browser” to facilitate the use of testers to enhance the user experience.
- the editing method of the automated test script further includes pre-configuring the basic action list.
- the configuration of the basic action list specifically includes the following steps:
- S221 Acquire at least two action editing requests in the use case editing management platform, where the action editing request includes an action name corresponding to the basic action.
- the developer may input at least two basic action editing requests on the use case editing management platform to form a basic action list, and the use case editing management platform may call the pre-stored basic action editing template after receiving the basic action editing request.
- the basic action editing template includes an action name of the base action and a corresponding action execution code. The developer only needs to edit the action name of the basic action and the corresponding action execution code to complete the editing of the basic action, so as to simplify the operation process, save time and improve efficiency.
- S222 Clustering the at least two action names by using a clustering algorithm, and classifying and managing the action names corresponding to the basic actions by using the example editing management platform to form a basic action list.
- the basic action list obtained by clustering the at least two action names by using the K-means clustering algorithm includes at least two cluster class clusters, each cluster class cluster corresponding to a behavior type, and each clustering
- the class cluster includes a centroid.
- the cosine similarity algorithm is used to calculate the distance from each action name to the centroid, and the cluster cluster to which the centroid with the smallest calculated distance belongs is used as the category of the action name.
- the K-MEANS algorithm is an input algorithm cluster number k, and a database containing n data objects, and outputs an algorithm that satisfies the minimum standard k clusters of variance.
- the algorithm has low complexity and can be processed in a short time. Massive data to improve efficiency.
- the step of clustering at least two action names by using the K-maens clustering algorithm is as follows: First, K are randomly selected from at least two action names as a centroid, where k represents the number of cluster clusters. Then, using the word segmentation technique, each action name (including the centroid) is segmented, and the TF-IDF is used to calculate the weight of each word in the corresponding action name to form a feature vector. For example, the word “open browser” is segmented, and the "open” "browser” is used to form a feature vector (the vector dimension of the feature vector is 2); if the dimensions of the feature vectors of the two action names are different, the feature of the largest dimension is taken.
- the word segmentation technique can use the staging word segmentation tool to perform word segmentation, and the stutter word segmentation tool is a common Chinese word segmentation tool, which has the advantages of high accuracy and high efficiency.
- each use case execution number is associated with a basic action to form an original test case, which specifically includes the following steps:
- S231 Display a basic action list on the configuration interface of the use case editing management platform, where the basic action list includes at least one basic action.
- the basic action list refers to an action list that is pre-stored in the use case editing management platform and includes at least one basic action.
- the basic action list is displayed in a hierarchical list on the configuration interface of the use case editing management platform.
- the tester can also select the target action according to the basic action list, so that the tester can quickly view all the basic actions stored by the server and improve the user experience.
- the tester can select the target action in the basic action list by dragging and dropping, and drag it to the input box corresponding to the use case execution number, so that the target action selected by the tester is associated with the use case execution number.
- the target action selected by the tester is input into the input box corresponding to the use case execution number by using a drag and drop method, and the operation process is simple, and the work efficiency is improved.
- each use case execution number is associated with a basic action to form an original test case, which specifically includes the following steps:
- S241 Acquire an action search instruction input by the user, and the action search instruction includes a target action name.
- the action search command refers to an instruction that the user searches for the desired action autonomously.
- the target action name is the name of the action that the user selects the desired action.
- the action search box is popped up on the configuration interface of the use case management platform, and the user can input the target action name in the action search box to search, and the use case edit management
- the platform will also recommend keywords for the user to search for the top N (N ⁇ 1) digits for users to choose, and improve user experience.
- the keyword information table pre-stored by the server further includes a “number of searches” field, and the server reads the target action name input by the user and matches the keyword in the keyword information table.
- the Add 1 to the "number of searches" field corresponding to the keyword in the keyword information table that matches the success and sort the keywords in the keyword information table according to the order of the number of searches to achieve the recommendation for the user.
- the purpose of searching for keywords with N (N ⁇ 1) digits is convenient for users.
- the use case editing management platform queries whether the basic action corresponding to the target action name exists in the basic action list according to the user input target action name. Specifically, the similarity between the base action name and the target action name in the base action list is calculated by the cosine similarity degree to determine whether the target action name exists in the base action list.
- the cosine similarity algorithm also known as the cosine similarity algorithm, is an algorithm that evaluates the similarity of two vectors by evaluating their cosine values. It can be understood that the base action name whose cosine similarity reaches the threshold is selected as the target action name by calculating the cosine similarity between the target action name and the action name of the base action in the base action list.
- the basic action name whose cosine similarity reaches the threshold in the basic basic action list is selected as the target action name, and the target action name is automatically filled in the input box corresponding to the use case execution number, so as to achieve convenient operation.
- the use case editing management platform if the basic action list in the use case editing management platform does not have a target action to be used by the user, that is, there is no target action corresponding to the target action name, the use case editing management platform generates a reminder for prompting the developer to load the target action.
- the information is sent to the developer's client of the use case editing management platform to remind the developer to perform basic action development based on the reminder information, thereby making the use case editing management platform more practical and satisfying the needs of testers.
- the configuration interface of the use case test management platform refers to the interface that the test case management management platform jumps to based on the script edit command when the tester inputs the script edit command by clicking the script edit button.
- the target test script is a test script that scripts the target test case.
- the server pre-stores the action execution code corresponding to the basic action for use by the tester to improve the user experience.
- step S30 according to the display order of at least two use case execution numbers in the original test case, the action execution code of the basic action associated with the use case execution number is invoked to form a target test script, which specifically includes the following steps. :
- S31 The action execution code of the basic action associated with the use case execution number is invoked according to the display order of at least two use case execution numbers in the original test case to form an original test script.
- the use case execution number is associated with the base action, and the database stores the action execution code corresponding to the action ID of each base action.
- the use case test management platform acquires a script edit instruction input by the tester.
- the script edit instruction includes an action ID associated with at least two use case execution numbers.
- the use case test management platform sequentially calls the action execution code corresponding to each use case execution number in the original test case based on the action ID to form the original test script. This process eliminates the need for testers to rewrite test scripts based on the original test cases, and can directly call the stored action execution code, saving time and improving work efficiency.
- S32 Acquire a script editing instruction input by the user, and the script editing instruction includes an action ID and an adjustment parameter.
- the adjustment parameter refers to the parameter input by the tester when the original test script is modified according to the system requirements.
- the action execution code includes a method function for implementing the base action and corresponding original parameters.
- the user can input a script editing instruction to the use case editing management platform to modify the original parameter to the adjustment parameter in the script editing instruction.
- the corresponding action execution script includes a method function for implementing the function of the print browser and corresponding original parameters, and the URL of the browser can be changed, and the input is performed.
- the required adjustment parameters ie the required URL
- S33 Modify the action execution code corresponding to the action ID based on the adjustment parameter to form a target test script.
- the action execution code corresponding to the action ID in the original test script is modified by the adjustment parameter corresponding to each action execution code acquired in step S32 to form a target test script, and the target test script is uploaded to the use case test management platform.
- the tester ID and the corresponding mailbox that receive the test result may be configured before the target test script is uploaded to the use case test management platform, so that the system to be tested corresponds to a tester to enhance the work management process.
- At least two use case execution numbers are sequentially displayed on the configuration interface of the use case editing management platform, and then each use case execution number is associated with a basic action to form an original test case, so that the execution number is based on the use case.
- the original test cases formed by the associated underlying actions can be executed strictly in accordance with the display and execution order of the use case execution numbers in subsequent tests.
- the original test case is then uploaded to the use case test management platform based on the B/S architecture, so that the user does not need to separately upload the test case to the use case test management platform, and can also be synchronized in the use case editing management platform when testing based on the test script. Test script execution status with real-time synchronization.
- the action execution code of the basic action associated with the use case execution number is sequentially called to form a target test script.
- the user only needs to call the pre-stored action execution code associated with the base action, and the developer does not need to edit the code again to obtain the test script, thereby improving work efficiency.
- Fig. 6 is a block diagram showing the editing apparatus of the automated test script corresponding to the editing method of the automated test script in the first embodiment.
- the editing device of the automated test script includes a use case execution number display module 10, an original test case acquisition module 20, and a target test script acquisition module 30.
- the implementation function of the use case execution number display module 10, the original test case acquisition module 20, and the target test script acquisition module 30 corresponds to the steps corresponding to the editing method of the automatic test script in the embodiment. To avoid redundancy, the embodiment does not Detailed one by one.
- the use case execution number display module 10 is configured to sequentially display at least two use case execution numbers on the configuration interface of the use case editing management platform.
- the original test case obtaining module 20 is configured to associate each use case execution number with a basic action to form an original test case, and send the original test case to the use case test management platform.
- the target test script obtaining module 30 is configured to be associated with the use case execution number according to a display order of at least two of the use case execution execution numbers in the original test case on a configuration interface of the use case test management platform.
- the action of the underlying action executes the code to form the target test script.
- the original test case acquisition module 20 includes an action selection instruction acquisition unit 211 and a use case execution number association unit 212.
- the action selection instruction acquisition unit 211 is configured to acquire an action selection instruction input by the user in an input box corresponding to each use case execution number, where the action selection instruction includes an action ID and/or an action name.
- the use case execution number associating unit 212 is configured to associate with the base action with the use case execution number based on the action ID and/or the action name.
- the original test case acquisition module 20 includes an action edit request acquisition unit 221 and a base action list acquisition unit 222, a base action list display unit 231, and a use case execution number association unit 232.
- the action editing request obtaining unit 221 is configured to acquire at least two action editing requests in the use case editing management platform, where the action editing request includes an action name corresponding to the basic action.
- the basic action list obtaining unit 222 is configured to perform clustering processing on the at least two action names by using a clustering algorithm, and classify and manage the action names corresponding to the basic actions by using the example editing management platform to form a basic action list.
- the basic action list display unit 231 is configured to display a basic action list on the configuration interface of the use case editing management platform, where the basic action list includes at least one basic action.
- the use case execution number associating unit 232 is configured to drag and drop a basic action in the basic action list into an input box corresponding to a use case execution number by using a drag and drop method, and associate the use case execution number with the base action.
- the original test case acquisition module 20 includes an action search instruction acquisition unit 241, a target action name acquisition unit 242, a base action acquisition unit 243, and a reminder information acquisition unit 244.
- the action search instruction acquisition unit 241 is configured to acquire an action search command input by the user, and the action search command includes a target action name.
- the target action name obtaining unit 242 is configured to determine whether the target action name exists in the basic action list.
- the basic action obtaining unit 243 is configured to acquire a target action name in the base action list, acquire a base action corresponding to the target action name, and associate each use case execution number with a base action.
- the reminder information obtaining unit 244 is configured to output the reminder information if the target action name does not exist in the basic action list.
- the target test script acquisition module 30 includes an original test script acquisition unit 31, a script edit instruction acquisition unit 32, and a target test script acquisition unit 33.
- the original test script obtaining unit 31 is configured to call the action execution code of the basic action associated with the use case execution number according to the display order of the at least two use case execution numbers in the original test case to form the original test script.
- the script editing instruction obtaining unit 32 is configured to acquire a script editing instruction input by the user, and the script editing instruction includes an action ID and an adjustment parameter.
- the target test script obtaining unit 33 is configured to modify the action execution code corresponding to the action ID based on the adjustment parameter to form a target test script.
- This embodiment provides one or more non-volatile readable storage media having computer readable instructions stored thereon.
- the one or more non-volatile readable storage mediums storing computer readable instructions, when executed by one or more processors, causing one or more processors to execute the automated test scripts of embodiment 1.
- the editing method in order to avoid duplication, will not be described here.
- the computer readable instructions when executed by the processor, the functions of the modules/units in the editing device of the automated test script in Embodiment 2 are implemented. To avoid repetition, details are not described herein again.
- non-volatile readable storage media storing computer readable instructions may comprise: any entity or device capable of carrying the computer readable instruction code, a recording medium, a USB flash drive, a mobile hard drive, Disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and the like.
- FIG. 7 is a schematic diagram of a terminal device according to an embodiment of the present application.
- the terminal device 70 of this embodiment includes a processor 71, a memory 72, and computer readable instructions 73 stored in the memory 72 and operable on the processor 71.
- the processor 71 executes the computer readable instructions 73, the steps in the embodiment of the editing method of the above various automated test scripts are implemented, such as steps S10 to S30 shown in FIG.
- the processor 71 implements the functions of the modules/units in the various apparatus embodiments described above when the computer readable instructions 73 are executed, such as the functions of the modules 10 through 30 shown in FIG.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
- Stored Programmes (AREA)
Abstract
一种自动化测试脚本的编辑方法、装置、终端设备及存储介质。该自动化测试脚本的编辑方法包括:在用例编辑管理平台的配置界面上依序显示至少两个用例执行编号(S10);将每一所述用例执行编号与一基础动作关联,形成原始测试用例,并将所述原始测试用例发送到用例测试管理平台(S20);在所述用例测试管理平台的配置界面上,依据所述原始测试用例中的至少两个所述用例执行编号的显示顺序,调用与所述用例执行编号相关联的基础动作的动作执行代码,形成目标测试脚本(S30);其中,所述用例编辑管理平台和所述用例测试管理平台通过B/S架构相连。该自动化测试脚本的编辑方法具有操作便捷,实时同步性强,提高工作效率的优点。
Description
本申请以2017年11月27日提交的申请号为201711207570.8,名称为“自动化测试脚本的编辑方法、装置、终端设备及存储介质”的中国发明专利申请为基础,并要求其优先权。
本申请涉及自动化测试领域,尤其涉及一种自动化测试脚本的编辑方法、装置、终端设备及存储介质。
在当前自动化测试脚本的编辑过程,测试用例编辑和基于测试用例编辑测试脚本是两个相互独立的步骤,即需由用例编辑人员根据用户需求编辑好测试用例,再由脚本开发人员基于编辑好的测试用例编辑代码,以获取测试脚本。随着用户需求的不断变动,在对测试用例和测试脚本进行更新时,由于测试用例与测试脚本相互独立,无法实现同步更新;另外,在基于测试用例编辑测试脚本时,需要脚本开发人员具有较高的代码编辑能力。而且,在基于不同测试用例分别编辑对应的测试脚本时,不同测试用例之间存在功能相同部分,若分别编辑测试脚本,可能会因重复工作而导致工作效率低。
发明内容
本申请提供一种自动化测试脚本的编辑方法、装置、终端设备及存储介质,以解决当前测试用例编辑的步骤和基于测试用例编辑测试脚本的步骤相互独立而导致测试脚本编辑效率低的问题。
第一方面,本申请提供一种自动化测试脚本的编辑方法,包括:
在用例编辑管理平台的配置界面上依序显示至少两个用例执行编号;
将每一所述用例执行编号与一基础动作关联,形成原始测试用例,并将所述原始测试用例发送到用例测试管理平台;
在所述用例测试管理平台的配置界面上,依据所述原始测试用例中的至少两个所述用 例执行编号的显示顺序,调用与所述用例执行编号相关联的基础动作的动作执行代码,形成目标测试脚本;
其中,所述用例编辑管理平台和所述用例测试管理平台通过B/S架构相连。
第二方面,本申请提供一种自动化测试脚本的编辑装置,包括:
用例执行编号显示模块,用于在用例编辑管理平台的配置界面上依序显示至少两个用例执行编号;
原始测试用例获取模块,用于将每一所述用例执行编号与一基础动作关联,形成原始测试用例,并将所述原始测试用例发送到用例测试管理平台;
目标测试脚本获取模块,用于在在所述用例测试管理平台的配置界面上,依据所述原始测试用例中的至少两个所述用例执行编号的显示顺序,调用与所述用例执行编号相关联的基础动作的动作执行代码,形成目标测试脚本。
第三方面,本申请提供一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
在用例编辑管理平台的配置界面上依序显示至少两个用例执行编号;
将每一所述用例执行编号与一基础动作关联,形成原始测试用例,并将所述原始测试用例发送到用例测试管理平台;
在所述用例测试管理平台的配置界面上,依据所述原始测试用例中的至少两个所述用例执行编号的显示顺序,调用与所述用例执行编号相关联的基础动作的动作执行代码,形成目标测试脚本;
其中,所述用例编辑管理平台和所述用例测试管理平台通过B/S架构相连。
第四方面,本申请提供一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
在用例编辑管理平台的配置界面上依序显示至少两个用例执行编号;
将每一所述用例执行编号与一基础动作关联,形成原始测试用例,并将所述原始测试用例发送到用例测试管理平台;
在所述用例测试管理平台的配置界面上,依据所述原始测试用例中的至少两个所述用例执行编号的显示顺序,调用与所述用例执行编号相关联的基础动作的动作执行代码,形成目标测试脚本;
其中,所述用例编辑管理平台和所述用例测试管理平台通过B/S架构相连。
本申请的一个或多个实施例的细节在下面的附图及描述中提出。本申请的其他特征和优点将从说明书、附图以及权利要求书变得明显。
为了更清楚地说明本申请的技术方案,下面将对本申请的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是实施例1中提供的自动化测试脚本的编辑方法的一流程图。
图2是图1中步骤S20的一具体示意图;
图3是图1中步骤S20的另一具体示意图;
图4是图1中步骤S20的又一具体示意图;
图5是图1中步骤S30的一具体示意图;
图6是实施例2中提供的自动化测试脚本的编辑装置的一示意图;
图7是实施例4中提供的终端设备的一示意图。
下面将结合本申请中的附图,对本申请中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
实施例1
图1示出本实施例中自动化测试脚本的编辑方法的流程图。该自动化测试脚本的编辑方法可应用在银行、证券、保险等金融机构或其他需要对系统进行自动化测试的机构的终端设备中,以便利用该自动化测试脚本的编辑方法测试脚本的编辑效率、降低测试脚本编辑成本。如图1所示,该自动化测试脚本的编辑方法包括如下步骤:
S10:在用例编辑管理平台的配置界面上依序显示至少两个用例执行编号。
其中,用例编辑管理平台是指测试人员用来创建测试用例的管理平台。用例编辑管理平台的配置界面是测试人员在编辑测试用例时所显示的界面,具体是指测试人员在点击用 例编辑按钮而输入的用例编辑指令时,用例编辑管理平台基于用例编辑指令所跳转到的界面。用例执行编号是指测试人员所编辑的原始测试用例中每一测试执行步骤的执行顺序的编号。
本实施例中,当终端设备跳转到用例编辑管理平台的配置界面时,由于界面资源有限,该配置界面会依据显示预设数量的用例执行编号,如按照阿拉伯数字的顺序展示出1-10等10个用例执行编号。当测试人员想要添加测试用例时,可以选择批量添加方式或者逐条添加方式,降低界面资源占有率,提升加载速率。具体地,当测试人员想要添加测试用例的测试执行步骤时,可点击该用例编辑管理平台的配置界面中的“添加编号”按钮而向用例编辑管理平台输入执行编号添加指令,该执行编号添加指令中可自定义输入所要添加的用例执行编号的数量;如选择批量添加方式时,则定义该用例执行编号的数量为大于1的整数;即选择逐条添加方式,则定义该用例执行编号的数量为1,以达到添加便捷的目的。
S20:将每一用例执行编号与一基础动作关联,形成原始测试用例,并将原始测试用例发送到用例测试管理平台。
其中,原始测试用例是指测试人员根据待测试系统的需求进行编辑所得到的一组包含测试执行步骤的测试方案。基础动作是服务器预先存储的一些基础的测试动作,例如“登录”的动作。用例测试管理平台是基于测试用例编辑测试脚本的管理平台。具体地,将每一个用例执行编号与测试人员在预先存储的基础动作中选取的一所需基础动作(以下简称为目标动作)相关联,形成一组包含至少两个基础动作,且至少两个基础动作之间的执行顺序与用例执行编号相对应的测试方案,即原始测试用例。
由于至少两个用例执行编号是依序显示并依序执行的,使得基于与用例执行编号关联的基础动作形成的原始测试用例在后续测试时,能够严格按照用例执行编号的显示和执行顺序执行,保证对待测试系统的测试可依据用户设计好的原始测试用例中各基础动作的顺序执行,增强测试的准确性。本实施例中,用例编辑管理平台会将得到的原始测试用例发送到用例测试管理平台,并发送提醒信息到测试管理邮箱,增强测试脚本编辑流程的实时同步性。
本实施例中,用例编辑管理平台和用例测试管理平台通过B/S架构相连。其中,B/S架构即浏览器和服务器结构,在这种结构下,用户工作界面是通过WEB浏览器来实现,极少部分事务逻辑在浏览器(Browser)实现,但是主要事务逻辑在服务器(Server)实现。B/S架构是WEB兴起后的一种网络结构模式,WEB浏览器是客户端最主要的应用软件。用户无 需下载,只要安装浏览器即可使用,大大降低维护成本。
本实施例中,首先在用例编辑管理平台的配置界面上依序显示至少两个用例执行编号,然后将每一用例执行编号与一基础动作关联,形成原始测试用例,以使基于与用例执行编号关联的基础动作形成的原始测试用例在后续测试时,能够严格按照用例执行编号的显示和执行顺序执行。之后基于B/S架构将原始测试用例发送到用例测试管理平台,以使用户无需单独发送测试用例到用例测试管理平台,具有实时同步性。
如图2所示,步骤S20中,将每一用例执行编号与一基础动作关联,形成原始测试用例,具体包括如下步骤:
S211:在每一用例执行编号对应的输入框中,获取用户输入的动作选择指令,动作选择指令包括动作ID和/或动作名称。
其中,动作选择指令是用于选择用户所需动作的指令。动作ID是用于唯一识别服务器中预先存储的基础动作的标识。动作名称是指测试人员输入目标动作的名称或者服务器中预先存储的基础动作的名称。具体地,每一用例执行编号都对应一输入框以使测试人员输入目标动作,测试人员可以只输入动作ID,也可以只输入动作名称,或者可以同时输入动作ID和动作名称,并在输入完成后点击确定按钮即可输入相应的动作选择指令,以便基于该动作选择指令获取所需的基础动作。
S212:基于动作ID和/或动作名称,以使用例执行编号与基础动作关联。
具体地,测试人员获取目标动作的方式可以有如下两种情况:一是测试人员知道服务器中预先存储目标动作的动作ID和/或动作名称时,可以直接输入目标动作的动作ID和/或动作名称,以获取目标动作。二是测试人员不知道服务器中预先存储目标动作的动作ID和/或动作名称时,可以输入目标动作所要实现的目标动作名称,用例编辑管理平台会根据测试人员所输入的目标动作名称,给测试人员提供与目标动作相对应的相似基础动作,以供测试人员从所提供的相似基础动作中选择目标动作,即用户可通过向用例编辑管理平台输入动作选择指令,以便基于该动作选择指令中的相似基础动作确定目标动作。可以理解地,若用例编辑管理平台推荐的相似基础动作没有用户所要使用的目标动作,则用例编辑管理平台会生成到提醒开发人员加载该目标动作的提醒信息,并发送给该用例编辑管理平台的开发人员的客户端,以提醒开发人员基于提醒信息进行基础动作开发,从而使得该用例编辑管理平台更具有实用性,满足测试人员的需求。
进一步地,用例编辑管理平台在给测试人员推荐相似基础动作时,可以采用关键词匹配算法,获取与目标动作相对应的相似基础动作。其中,关键词匹配算法包括但不限于克 努特-莫里斯-普拉特(Knuth-Morris-Pratt,以下简称KMP)算法。具体地,KMP算法是一种改进的字符串匹配算法,KMP算法的关键是利用匹配失败后的信息,尽量减少模式串与主串的匹配次数以达到快速匹配的目的。本实施例中,选用KMP算法对测试人员所输入的目标动作和数据库中存储的动作名称进行关键词匹配,获取相似基础动作,节省时间,提高效率。
具体地,服务器会预先存储关键词信息表,该关键词信息表中存储基础动作的动作名称,每一动作名称对应一个或多个关键词,通过KMP算法匹配目标动作与关键词信息表中的关键词,以确定相似基础动作。例如“打开浏览器”的关键词可以为浏览器,当测试人员输入“点击浏览器”时,服务器会在预先存储的关键词信息表中,通过匹配到关键词“浏览器”而为测试人员推荐“打开浏览器”的动作,方便测试人员使用,提升用户体验。
在一具体实施方式中,如图3所示,步骤S20之前,该自动化测试脚本的编辑方法还包括预先配置基础动作列表。其中,对基础动作列表的配置,具体包括如下步骤:
S221:在用例编辑管理平台获取至少两个动作编辑请求,动作编辑请求包括基础动作对应的动作名称。
具体地,开发人员可向用例编辑管理平台上输入至少两个基础动作编辑请求,以形成基础动作列表,用例编辑管理平台在接收到基础动作编辑请求之后会调用预先存储的基础动作编辑模板。该基础动作编辑模板包括基础动作的动作名称和对应的动作执行代码。开发人员只需编辑基础动作的动作名称和对应的动作执行代码,即可完成对基础动作的编辑,以达到简化操作流程,节省时间,提高效率的目的。
S222:采用聚类算法对至少两个动作名称进行聚类处理,以使用例编辑管理平台对基础动作对应的动作名称进行分类管理,形成基础动作列表。
具体地,采用K-means聚类算法对至少两个动作名称进行聚类处理后获取的基础动作列表包括至少两个聚类类簇,每一聚类类簇对应一行为类型,并且每一聚类类簇包括一质心。采用余弦相似度算法计算每一动作名称到质心的距离,将计算得出的距离最小的质心所属的聚类类簇作为该动作名称的类别。其中,K-MEANS算法是输入聚类个数k,以及包含n个数据对象的数据库,输出满足方差最小标准k个聚类的一种算法,该算法的复杂度低,能在短时间内处理海量数据,提高效率。
进一步地,采用K-maens聚类算法对至少两个动作名称进行聚类处理的步骤如下:首先从至少两个动作名称中随机选取K个作为质心,其中,k代表聚类类簇的数量。再采用分词技术将每个动作名称(包括质心)进行分词,采用TF-IDF计算每个词语在对应的动 作名称的权值形成特征向量。例如对“打开浏览器”进行分词,得到“打开”“浏览器”形成特征向量(该特征向量的向量维度为2);若两个动作名称的特征向量的维度不同,则取最大维度的特征向量对应的维度作为最终维度,其他的特征向量维度不足的用0补齐即可。最后采用余弦相似度算法计算每个动作名称对应的特征向量与质心的距离,将计算得出的距离最小的质心所属的聚类类簇作为该动作名称的类别。其中,质心的个数由聚类类簇的数量K决定,具体的K值由开发人员自定义。本实施例中,分词技术可采用结巴分词工具进行分词,结巴分词工具是一种常见的中文分词工具,具有准确率高、效率高的优点。
具体地,步骤S20中,将每一用例执行编号与一基础动作关联,形成原始测试用例,具体包括如下步骤:
S231:在用例编辑管理平台的配置界面上显示基础动作列表,基础动作列表包括至少一个基础动作。
其中,基础动作列表是指用例编辑管理平台中预先存储的包含至少一个基础动作的动作列表。本实施例中,用例编辑管理平台的配置界面上以分级列表的形式显示基础动作列表。具体地,测试人员也可根据基础动作列表选取目标动作,以使测试人员更快速的查看服务器存储的所有基础动作,提升用户体验。
S232:采用拖拽方式将基础动作列表中的一基础动作拖拽到与一用例执行编号对应的输入框中,以使用例执行编号与基础动作关联。
具体地,测试人员可以采用拖拽方式在基础动作列表中选取目标动作,将其拖拽到与用例执行编号所对应的输入框中,以使测试人员选取到的目标动作与用例执行编号相关联。本实施例中,采用拖拽方式将测试人员选取到的目标动作输入到与用例执行编号所对应的输入框中,该操作过程简单,提高了工作效率。
在另一具体实施方式中,如图4所示,步骤S20中,将每一用例执行编号与一基础动作关联,形成原始测试用例,具体包括如下步骤:
S241:获取用户输入的动作搜索指令,动作搜索指令包括目标动作名称。
其中,动作搜索指令是指用户自主搜索所需动作的指令。目标动作名称是指用户选择所需动作的动作名称。具体地,用户在点击特定用例执行编号所对应的输入框时,会在用例管理平台的配置界面上弹出动作搜索框,用户可在动作搜索框中输入目标动作名称进行搜索,并且该用例编辑管理平台还会给用户推荐搜索次数排在前N(N≥1)位的关键词供用户选择,提升用户体验度。
进一步地,服务器预先存储的关键词信息表中还包括“搜索次数”字段,服务器会读 取用户输入的目标动作名称并匹配关键词信息表中的关键词,当匹配到关键词时,会在匹配成功的关键词信息表中的关键词所对应的“搜索次数”字段上加1,并按照搜索次数从大到小的顺序对关键词信息表中的关键词进行排序,以达到为用户推荐搜索次数排在N(N≥1)位的关键词的目的,方便用户使用。
S242:判断基础动作列表中是否存在目标动作名称。
其中,用例编辑管理平台会根据用户输入目标动作名称查询基础动作列表中是否存在与目标动作名称相对应的基础动作。具体地,通过余弦相似度计算基础动作列表中的基础动作名称与目标动作名称的相似度判断基础动作列表中是否存在目标动作名称。余弦相似度算法,又称为余弦相似性算法,是通过计算两个向量的夹角余弦值来评估他们的相似度的算法。可以理解地,通过计算目标动作名称与基础动作列表中的基础动作的动作名称的余弦相似度,选取余弦相似度达到阈值的基础动作名称作为目标动作名称。
S243:若基础动作列表中存在目标动作名称,则获取与目标动作名称相对应的基础动作,将每一用例执行编号与一基础动作关联。
具体地,选取基础基础动作列表中余弦相似度达到阈值的基础动作名称作为目标动作名称,并将目标动作名称自动填入与用例执行编号对应的输入框中,以达到操作便捷的目的。
S244:若基础动作列表中不存在目标动作名称,则输出提醒信息。
具体地,若用例编辑管理平台中的基础动作列表没有用户所要使用的目标动作,即不存在与目标动作名称相对应的目标动作,则用例编辑管理平台会生成提醒开发人员加载该目标动作的提醒信息,并发送给该用例编辑管理平台的开发人员的客户端,以提醒开发人员基于提醒信息进行基础动作开发,从而使得该用例编辑管理平台更具有实用性,满足测试人员的需求。
S30:在用例测试管理平台的配置界面上,依据原始测试用例中的至少两个用例执行编号的显示顺序,调用与用例执行编号相关联的基础动作的动作执行代码,形成目标测试脚本。
其中,用例测试管理平台的配置界面是指测试人员在点击脚本编辑按钮而输入的脚本编辑指令时,用例测试管理平台会基于脚本编辑指令所跳转到的界面。目标测试脚本是将目标测试用例进行脚本化处理得到的测试脚本。具体地,服务器会预先存储与基础动作对应的动作执行代码供测试人员使用,提高用户体验。
如图5所示,步骤S30中,依据原始测试用例中的至少两个用例执行编号的显示顺序, 调用与用例执行编号相关联的基础动作的动作执行代码,形成目标测试脚本,具体包括如下步骤:
S31:依据原始测试用例中的至少两个用例执行编号的显示顺序,调用与用例执行编号相关联的基础动作的动作执行代码,形成原始测试脚本。
其中,用例执行编号与基础动作关联,数据库中存储有每个基础动作的动作ID对应的动作执行代码。具体地,用例测试管理平台在接收到用例编辑管理平台发送的原始测试用例后,会获取测试人员输入的脚本编辑指令。该脚本编辑指令包括与至少两个用例执行编号相关联的动作ID。用例测试管理平台会基于动作ID依序调用原始测试用例中每个用例执行编号对应的动作执行代码,以形成原始测试脚本。该过程无需测试人员重新根据原始测试用例编写测试脚本,可直接调用已存储的动作执行代码,节省时间,提高工作效率。
S32:获取用户输入的脚本编辑指令,脚本编辑指令包括动作ID和调节参数。
其中,调节参数是指测试人员根据系统需求对原始测试脚本进行修改时所输入的参数。具体地,动作执行代码包括用于实现基础动作的方法函数和对应的原始参数。用户可向用例编辑管理平台输入脚本编辑指令,以将原始参数修改为脚本编辑指令中的调节参数。例如当测试人员选择的基础动作为“打开浏览器”时,其对应的动作执行脚本包括用于实现打印浏览器功能的方法函数和对应的原始参数,可以对浏览器的网址进行更改,输入所需的调节参数(即所需网址),以使原始测试用例更合符合待测试系统的需求。
S33:基于调节参数,对动作ID对应的动作执行代码进行修改,以形成目标测试脚本。
具体地,通过步骤S32获取的每一动作执行代码对应的调节参数修改原始测试脚本中与动作ID对应的动作执行代码,以形成目标测试脚本,将目标测试脚本上传到用例测试管理平台。本实施例中,在上传目标测试脚本到用例测试管理平台之前也可配置接收测试结果的测试人员ID和对应的邮箱,使得待测试系统对应一测试人员,以增强工作管理流程条理性。
本实施例中,首先在用例编辑管理平台的配置界面上依序显示至少两个用例执行编号,然后将每一用例执行编号与一基础动作关联,形成原始测试用例,以使基于与用例执行编号关联的基础动作形成的原始测试用例在后续测试时,能够严格按照用例执行编号的显示和执行顺序执行。之后基于B/S架构将原始测试用例上传到用例测试管理平台,以使用户无需单独上传测试用例到用例测试管理平台,并且在后续基于测试脚本进行测试时也可在用例编辑管理平台中同步查看测试脚本的执行状态,具有实时同步性。最后,在用例测试管理平台的配置界面上,依据原始测试用例中的至少两个用例执行编号,依序调用与用例 执行编号相关联的基础动作的动作执行代码,形成目标测试脚本。该测试脚本编辑过程中用户只需调用预先存储的与基础动作相关联的动作执行代码,无需开发人员再次编辑代码获取测试脚本,提高工作效率。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请的实施过程构成任何限定。
实施例2
图6示出与实施例1中自动化测试脚本的编辑方法一一对应的自动化测试脚本的编辑装置的原理框图。如图6所示,该自动化测试脚本的编辑装置包括用例执行编号显示模块10、原始测试用例获取模块20、目标测试脚本获取模块30。其中,用例执行编号显示模块10、原始测试用例获取模块20、目标测试脚本获取模块30的实现功能与实施例中自动化测试脚本的编辑方法对应的步骤一一对应,为避免赘述,本实施例不一一详述。
用例执行编号显示模块10,用于在用例编辑管理平台的配置界面上依序显示至少两个用例执行编号。
原始测试用例获取模块20,用于将每一用例执行编号与一基础动作关联,形成原始测试用例,并将原始测试用例发送到用例测试管理平台。
目标测试脚本获取模块30,用于在所述用例测试管理平台的配置界面上,依据所述原始测试用例中的至少两个所述用例执行编号的显示顺序,调用与所述用例执行编号相关联的基础动作的动作执行代码,形成目标测试脚本。
优选地,原始测试用例获取模块20包括动作选择指令获取单元211和用例执行编号关联单元212。
动作选择指令获取单元211,用于在每一用例执行编号对应的输入框中,获取用户输入的动作选择指令,动作选择指令包括动作ID和/或动作名称。
用例执行编号关联单元212,用于基于动作ID和/或动作名称,以使用例执行编号与基础动作关联。
优选地,原始测试用例获取模块20包括动作编辑请求获取单元221和基础动作列表获取单元222、基础动作列表显示单元231和用例执行编号关联单元232。
动作编辑请求获取单元221,用于在用例编辑管理平台获取至少两个动作编辑请求,动作编辑请求包括基础动作对应的动作名称。
基础动作列表获取单元222,用于采用聚类算法对至少两个动作名称进行聚类处理, 以使用例编辑管理平台对基础动作对应的动作名称进行分类管理,形成基础动作列表。
基础动作列表显示单元231,用于在用例编辑管理平台的配置界面上显示基础动作列表,基础动作列表包括至少一个基础动作。
用例执行编号关联单元232,用于采用拖拽方式将基础动作列表中的一基础动作拖拽到与一用例执行编号对应的输入框中,以使用例执行编号与基础动作关联。
优选地,原始测试用例获取模块20包括动作搜索指令获取单元241、目标动作名称获取单元242、基础动作获取单元243和提醒信息获取单元244。
动作搜索指令获取单元241,用于获取用户输入的动作搜索指令,动作搜索指令包括目标动作名称。
目标动作名称获取单元242,用于判断基础动作列表中是否存在目标动作名称。
基础动作获取单元243,用于基础动作列表中存在目标动作名称,则获取与目标动作名称相对应的基础动作,将每一用例执行编号与一基础动作关联。
提醒信息获取单元244,用于基础动作列表中不存在目标动作名称,则输出提醒信息。
优选地,目标测试脚本获取模块30包括原始测试脚本获取单元31、脚本编辑指令获取单元32和目标测试脚本获取单元33。
原始测试脚本获取单元31,用于依据原始测试用例中的至少两个用例执行编号的显示顺序,调用与用例执行编号相关联的基础动作的动作执行代码,形成原始测试脚本。
脚本编辑指令获取单元32,用于获取用户输入的脚本编辑指令,脚本编辑指令包括动作ID和调节参数。
目标测试脚本获取单元33,用于基于调节参数,对动作ID对应的动作执行代码进行修改,以形成目标测试脚本。
实施例3
本实施例提供一个或多个存储有计算机可读指令的非易失性可读存储介质。该一个或多个存储有计算机可读指令的非易失性可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行实施例1中自动化测试脚本的编辑方法,为避免重复,这里不再赘述。或者,该计算机可读指令被处理器执行时实现实施例2中自动化测试脚本的编辑装置中各模块/单元的功能,为避免重复,这里不再赘述。
可以理解地,一个或多个存储有计算机可读指令的非易失性可读存储介质可以包括:能够携带所述计算机可读指令代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、 光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号等。
实施例4
图7是本申请一实施例提供的终端设备的示意图。如图7所示,该实施例的终端设备70包括:处理器71、存储器72以及存储在存储器72中并可在处理器71上运行的计算机可读指令73。处理器71执行计算机可读指令73时实现上述各个自动化测试脚本的编辑方法实施例中的步骤,例如图1所示的步骤S10至S30。或者,处理器71执行计算机可读指令73时实现上述各装置实施例中各模块/单元的功能,例如图6所示模块10至30的功能。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。
以上述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。
Claims (20)
- 一种自动化测试脚本的编辑方法,其特征在于,包括:在用例编辑管理平台的配置界面上依序显示至少两个用例执行编号;将每一所述用例执行编号与一基础动作关联,形成原始测试用例,并将所述原始测试用例发送到用例测试管理平台;在所述用例测试管理平台的配置界面上,依据所述原始测试用例中的至少两个所述用例执行编号的显示顺序,调用与所述用例执行编号相关联的基础动作的动作执行代码,形成目标测试脚本;其中,所述用例编辑管理平台和所述用例测试管理平台通过B/S架构相连。
- 根据权利要求1所述的自动化测试脚本的编辑方法,其特征在于,所述将每一所述用例执行编号与一基础动作关联,包括:在每一所述用例执行编号对应的输入框中,获取用户输入的动作选择指令,所述动作选择指令包括动作ID和/或动作名称;基于所述动作ID和/或动作名称,以使所述用例执行编号与所述基础动作关联。
- 根据权利要求1所述的自动化测试脚本的编辑方法,其特征在于,所述将每一所述用例执行编号与一基础动作关联,包括:在所述用例编辑管理平台的配置界面上显示基础动作列表,所述基础动作列表包括至少一个基础动作;采用拖拽方式将所述基础动作列表中的一基础动作拖拽到与一所述用例执行编号对应的输入框中,以使所述用例执行编号与所述基础动作关联。
- 根据权利要求3所述的自动化测试脚本的编辑方法,其特征在于,所述将每一所述用例执行编号与一基础动作关联,还包括:获取用户输入的动作搜索指令,所述动作搜索指令包括目标动作名称;判断所述基础动作列表中是否存在所述目标动作名称;若所述基础动作列表中存在所述目标动作名称,则获取与所述目标动作名称相对应的基础动作,将每一所述用例执行编号与一基础动作关联;若所述基础动作列表中不存在所述目标动作名称,则输出提醒信息。
- 根据权利要求1所述的自动化测试脚本的编辑方法,其特征在于,所述依据所述原始测试用例中的至少两个所述用例执行编号的显示顺序,调用与所述用例执行编号相关联 的基础动作的动作执行代码,形成目标测试脚本,包括:依据所述原始测试用例中的至少两个所述用例执行编号的显示顺序,调用与所述用例执行编号相关联的基础动作的动作执行代码,形成原始测试脚本;获取用户输入的脚本编辑指令,所述脚本编辑指令包括动作ID和调节参数;基于所述调节参数,对所述动作ID对应的动作执行代码进行修改,以形成目标测试脚本。
- 根据权利要求1所述的自动化测试脚本的编辑方法,其特征在于,所述基础动作包括动作名称;在所述将每一所述用例执行编号与一基础动作关联,形成原始测试用例的步骤之前,所述自动化测试脚本的编辑方法还包括:在所述用例编辑管理平台获取至少两个动作编辑请求,所述动作编辑请求包括所述基础动作对应的动作名称;采用聚类算法对至少两个所述动作名称进行聚类处理,以使所述用例编辑管理平台对所述基础动作对应的动作名称进行分类管理,形成基础动作列表。
- 一种自动化测试脚本的编辑装置,其特征在于,包括:用例执行编号显示模块,用于在用例编辑管理平台的配置界面上依序显示至少两个用例执行编号;原始测试用例获取模块,用于将每一所述用例执行编号与一基础动作关联,形成原始测试用例,并将所述原始测试用例发送到用例测试管理平台;目标测试脚本获取模块,用于在在所述用例测试管理平台的配置界面上,依据所述原始测试用例中的至少两个所述用例执行编号的显示顺序,调用与所述用例执行编号相关联的基础动作的动作执行代码,形成目标测试脚本。
- 根据权利要求7所述的自动化测试脚本的编辑装置,其特征在于,还包括:动作编辑请求获取单元,用于在所述用例编辑管理平台获取至少两个动作编辑请求,所述动作编辑请求包括所述基础动作对应的动作名称;基础动作列表获取单元,用于采用聚类算法对至少两个所述动作名称进行聚类处理,以使所述用例编辑管理平台对所述基础动作对应的动作名称进行分类管理,形成基础动作列表。
- 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如下步 骤:在用例编辑管理平台的配置界面上依序显示至少两个用例执行编号;将每一所述用例执行编号与一基础动作关联,形成原始测试用例,并将所述原始测试用例发送到用例测试管理平台;在所述用例测试管理平台的配置界面上,依据所述原始测试用例中的至少两个所述用例执行编号的显示顺序,调用与所述用例执行编号相关联的基础动作的动作执行代码,形成目标测试脚本;其中,所述用例编辑管理平台和所述用例测试管理平台通过B/S架构相连。
- 如权利要求9所述的终端设备,其特征在于,所述将每一所述用例执行编号与一基础动作关联,包括:在每一所述用例执行编号对应的输入框中,获取用户输入的动作选择指令,所述动作选择指令包括动作ID和/或动作名称;基于所述动作ID和/或动作名称,以使所述用例执行编号与所述基础动作关联。
- 如权利要求9所述的终端设备,其特征在于,所述将每一所述用例执行编号与一基础动作关联,包括:在所述用例编辑管理平台的配置界面上显示基础动作列表,所述基础动作列表包括至少一个基础动作;采用拖拽方式将所述基础动作列表中的一基础动作拖拽到与一所述用例执行编号对应的输入框中,以使所述用例执行编号与所述基础动作关联。
- 如权利要求11所述的终端设备,其特征在于,所述将每一所述用例执行编号与一基础动作关联,还包括:获取用户输入的动作搜索指令,所述动作搜索指令包括目标动作名称;判断所述基础动作列表中是否存在所述目标动作名称;若所述基础动作列表中存在所述目标动作名称,则获取与所述目标动作名称相对应的基础动作,将每一所述用例执行编号与一基础动作关联;若所述基础动作列表中不存在所述目标动作名称,则输出提醒信息。
- 如权利要求9所述的终端设备,其特征在于,所述依据所述原始测试用例中的至少两个所述用例执行编号的显示顺序,调用与所述用例执行编号相关联的基础动作的动作执行代码,形成目标测试脚本,包括:依据所述原始测试用例中的至少两个所述用例执行编号的显示顺序,调用与所述用例 执行编号相关联的基础动作的动作执行代码,形成原始测试脚本;获取用户输入的脚本编辑指令,所述脚本编辑指令包括动作ID和调节参数;基于所述调节参数,对所述动作ID对应的动作执行代码进行修改,以形成目标测试脚本。
- 如权利要求9所述的终端设备,其特征在于,所述基础动作包括动作名称;在所述将每一所述用例执行编号与一基础动作关联,形成原始测试用例的步骤之前,所述自动化测试脚本的编辑方法还包括:在所述用例编辑管理平台获取至少两个动作编辑请求,所述动作编辑请求包括所述基础动作对应的动作名称;采用聚类算法对至少两个所述动作名称进行聚类处理,以使所述用例编辑管理平台对所述基础动作对应的动作名称进行分类管理,形成基础动作列表。
- 一个或多个存储有计算机可读指令的非易失性可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:在用例编辑管理平台的配置界面上依序显示至少两个用例执行编号;将每一所述用例执行编号与一基础动作关联,形成原始测试用例,并将所述原始测试用例发送到用例测试管理平台;在所述用例测试管理平台的配置界面上,依据所述原始测试用例中的至少两个所述用例执行编号的显示顺序,调用与所述用例执行编号相关联的基础动作的动作执行代码,形成目标测试脚本;其中,所述用例编辑管理平台和所述用例测试管理平台通过B/S架构相连。
- 如权利要求15所述的非易失性可读存储介质,其特征在于,所述将每一所述用例执行编号与一基础动作关联,包括:在每一所述用例执行编号对应的输入框中,获取用户输入的动作选择指令,所述动作选择指令包括动作ID和/或动作名称;基于所述动作ID和/或动作名称,以使所述用例执行编号与所述基础动作关联。
- 如权利要求15所述的非易失性可读存储介质,其特征在于,所述将每一所述用例执行编号与一基础动作关联,包括:在所述用例编辑管理平台的配置界面上显示基础动作列表,所述基础动作列表包括至少一个基础动作;采用拖拽方式将所述基础动作列表中的一基础动作拖拽到与一所述用例执行编号对 应的输入框中,以使所述用例执行编号与所述基础动作关联。
- 如权利要求17所述的非易失性可读存储介质,其特征在于,所述将每一所述用例执行编号与一基础动作关联,还包括:获取用户输入的动作搜索指令,所述动作搜索指令包括目标动作名称;判断所述基础动作列表中是否存在所述目标动作名称;若所述基础动作列表中存在所述目标动作名称,则获取与所述目标动作名称相对应的基础动作,将每一所述用例执行编号与一基础动作关联;若所述基础动作列表中不存在所述目标动作名称,则输出提醒信息。
- 如权利要求15所述的非易失性可读存储介质,其特征在于,所述依据所述原始测试用例中的至少两个所述用例执行编号的显示顺序,调用与所述用例执行编号相关联的基础动作的动作执行代码,形成目标测试脚本,包括:依据所述原始测试用例中的至少两个所述用例执行编号的显示顺序,调用与所述用例执行编号相关联的基础动作的动作执行代码,形成原始测试脚本;获取用户输入的脚本编辑指令,所述脚本编辑指令包括动作ID和调节参数;基于所述调节参数,对所述动作ID对应的动作执行代码进行修改,以形成目标测试脚本。
- 如权利要求15所述的非易失性可读存储介质,其特征在于,所述基础动作包括动作名称;在所述将每一所述用例执行编号与一基础动作关联,形成原始测试用例的步骤之前,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行如下步骤:在所述用例编辑管理平台获取至少两个动作编辑请求,所述动作编辑请求包括所述基础动作对应的动作名称;采用聚类算法对至少两个所述动作名称进行聚类处理,以使所述用例编辑管理平台对所述基础动作对应的动作名称进行分类管理,形成基础动作列表。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711207570.8 | 2017-11-27 | ||
CN201711207570.8A CN108255706A (zh) | 2017-11-27 | 2017-11-27 | 自动化测试脚本的编辑方法、装置、终端设备及存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019100635A1 true WO2019100635A1 (zh) | 2019-05-31 |
Family
ID=62721601
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/081058 WO2019100635A1 (zh) | 2017-11-27 | 2018-03-29 | 自动化测试脚本的编辑方法、装置、终端设备及存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108255706A (zh) |
WO (1) | WO2019100635A1 (zh) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109542795A (zh) * | 2018-12-13 | 2019-03-29 | 平安科技(深圳)有限公司 | 为用户推荐测试动作的方法、装置、介质、电子设备 |
CN109753437B (zh) * | 2019-01-11 | 2024-06-25 | 平安科技(深圳)有限公司 | 测试程序生成方法及装置、存储介质、电子设备 |
CN110404263B (zh) * | 2019-07-26 | 2023-04-07 | 网易(杭州)网络有限公司 | 一种可视化编辑方法和装置 |
CN110704305A (zh) * | 2019-09-07 | 2020-01-17 | 创新奇智(合肥)科技有限公司 | 一种基于文本的自动化测试用例设计方法和系统 |
CN112506756B (zh) * | 2020-11-11 | 2023-06-06 | 东风汽车集团有限公司 | 一种车辆控制器测试用例脚本生成方法和装置 |
CN112596972B (zh) * | 2020-12-23 | 2024-05-03 | 文思海辉智科科技有限公司 | 车载设备的测试方法、装置、系统、计算机设备 |
CN113742238B (zh) * | 2021-09-14 | 2024-05-14 | 南方电网数字平台科技(广东)有限公司 | 一种测试用例的生成方法及装置 |
CN114840412A (zh) * | 2022-03-25 | 2022-08-02 | 网宿科技股份有限公司 | 测试工具的运行方法、电子设备及存储介质 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1677197A1 (en) * | 2004-12-31 | 2006-07-05 | ST Incard S.r.l. | Test case automatic generation method for testing proactive GSM applications on SIM card |
CN101025686A (zh) * | 2007-03-22 | 2007-08-29 | 中兴通讯股份有限公司 | 一种自动化测试系统及测试脚本的生成和运行方法 |
CN101339534A (zh) * | 2008-06-17 | 2009-01-07 | 金蝶软件(中国)有限公司 | 一种软件测试的方法及装置 |
CN106547689A (zh) * | 2016-10-20 | 2017-03-29 | 金航数码科技有限责任公司 | 一种基于web的自动化测试用例开发系统及方法 |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2508643A (en) * | 2012-12-07 | 2014-06-11 | Ibm | Method for Performing a Regression Test after Modifying Source Code File |
CN103631590B (zh) * | 2013-11-29 | 2017-04-05 | 广东明创软件科技有限公司 | 自动化测试脚本的编辑方法 |
CN104298595A (zh) * | 2014-09-29 | 2015-01-21 | 百视通网络电视技术发展有限责任公司 | 自动化测试方法及测试系统 |
-
2017
- 2017-11-27 CN CN201711207570.8A patent/CN108255706A/zh active Pending
-
2018
- 2018-03-29 WO PCT/CN2018/081058 patent/WO2019100635A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1677197A1 (en) * | 2004-12-31 | 2006-07-05 | ST Incard S.r.l. | Test case automatic generation method for testing proactive GSM applications on SIM card |
CN101025686A (zh) * | 2007-03-22 | 2007-08-29 | 中兴通讯股份有限公司 | 一种自动化测试系统及测试脚本的生成和运行方法 |
CN101339534A (zh) * | 2008-06-17 | 2009-01-07 | 金蝶软件(中国)有限公司 | 一种软件测试的方法及装置 |
CN106547689A (zh) * | 2016-10-20 | 2017-03-29 | 金航数码科技有限责任公司 | 一种基于web的自动化测试用例开发系统及方法 |
Also Published As
Publication number | Publication date |
---|---|
CN108255706A (zh) | 2018-07-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019100635A1 (zh) | 自动化测试脚本的编辑方法、装置、终端设备及存储介质 | |
US10719301B1 (en) | Development environment for machine learning media models | |
US11556746B1 (en) | Fast annotation of samples for machine learning model development | |
US10776170B2 (en) | Software service execution apparatus, system, and method | |
US11303539B2 (en) | Network component placement architecture | |
US20220156053A1 (en) | Software dependency management | |
WO2019100576A1 (zh) | 自动化测试管理方法、装置、终端设备及存储介质 | |
US10453165B1 (en) | Computer vision machine learning model execution service | |
US11580179B2 (en) | Method and system for service agent assistance of article recommendations to a customer in an app session | |
WO2019100577A1 (zh) | 自动化测试管理方法、装置、终端设备及存储介质 | |
US10838941B2 (en) | Automated image-based record creation and related database systems | |
US9811605B2 (en) | Methods, apparatuses and computer program products for automated learning of data models | |
US9032360B1 (en) | Selecting a test scenario template based on similarity of testing profiles belonging to different organizations | |
US9348735B1 (en) | Selecting transactions based on similarity of profiles of users belonging to different organizations | |
US11720825B2 (en) | Framework for multi-tenant data science experiments at-scale | |
US20130290238A1 (en) | Discovery and grouping of related computing resources using machine learning | |
US20200210934A1 (en) | Issue tracking system using a similarity score to suggest and create duplicate issue requests across multiple projects | |
US11775867B1 (en) | System and methods for evaluating machine learning models | |
US20230117893A1 (en) | Machine learning techniques for environmental discovery, environmental validation, and automated knowledge repository generation | |
CN110177006B (zh) | 基于接口预测模型的节点测试方法及装置 | |
CA3126789A1 (en) | Data management system for web based data services | |
CN115657901B (zh) | 一种基于统一参数的业务变更方法及装置 | |
US20230385181A1 (en) | Re-usable web-objects for use with automation tools | |
US11809398B1 (en) | Methods and systems for connecting data with non-standardized schemas in connected graph data exchanges | |
US11762857B2 (en) | Methods and systems for searching data exchanges that comprise information on assets with non-homogenous functionality and non-standardized data descriptions |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18881167 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 28.08.2020) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18881167 Country of ref document: EP Kind code of ref document: A1 |