[go: up one dir, main page]

CN118760598A - A low-code interface automated testing method, device, medium and product - Google Patents

A low-code interface automated testing method, device, medium and product Download PDF

Info

Publication number
CN118760598A
CN118760598A CN202410895288.7A CN202410895288A CN118760598A CN 118760598 A CN118760598 A CN 118760598A CN 202410895288 A CN202410895288 A CN 202410895288A CN 118760598 A CN118760598 A CN 118760598A
Authority
CN
China
Prior art keywords
interface
response result
test
request
use case
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410895288.7A
Other languages
Chinese (zh)
Inventor
徐良春
黎绵星
钟艳艳
曹张华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiaxing Jushuitan Intelligent Technology Co ltd
Shanghai Jushuitan Network Technology Co ltd
Original Assignee
Jiaxing Jushuitan Intelligent Technology Co ltd
Shanghai Jushuitan Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiaxing Jushuitan Intelligent Technology Co ltd, Shanghai Jushuitan Network Technology Co ltd filed Critical Jiaxing Jushuitan Intelligent Technology Co ltd
Priority to CN202410895288.7A priority Critical patent/CN118760598A/en
Publication of CN118760598A publication Critical patent/CN118760598A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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)

Abstract

本发明公开一种低代码接口自动化测试方法、装置、介质及产品,涉及接口测试领域,方法包括:当处于单接口测试环境时,根据接口请求信息确定对应的被测接口的地址并获取所述被测接口的响应结果;对响应结果进行校验并在校验通过后对响应结果进行预设内容提取,以得到预设内容变量;预设内容变量用于供下一被测接口在测试时调用;将接口请求信息及对应的被测接口及响应结果作为一个接口用例存储至接口用例库中;当处于批量测试环境时,将多种格式的用例文件导入接口用例库中,以得到多个接口用例;基于接口用例库构建接口自动化测试任务;执行接口自动化测试任务,并生成测试报告。本发明提高了接口测试效率和准确性。

The present invention discloses a low-code interface automation test method, device, medium and product, which relates to the field of interface testing. The method includes: when in a single interface test environment, determining the address of the corresponding interface under test according to interface request information and obtaining the response result of the interface under test; verifying the response result and extracting the preset content of the response result after the verification is passed to obtain the preset content variable; the preset content variable is used for the next interface under test to call during the test; the interface request information and the corresponding interface under test and the response result are stored as an interface case in an interface case library; when in a batch test environment, importing case files of various formats into the interface case library to obtain multiple interface cases; constructing an interface automation test task based on the interface case library; executing the interface automation test task, and generating a test report. The present invention improves the efficiency and accuracy of interface testing.

Description

一种低代码接口自动化测试方法、装置、介质及产品A low-code interface automated testing method, device, medium and product

技术领域Technical Field

本发明涉及接口测试领域,特别是涉及一种低代码接口自动化测试方法、装置、介质及产品。The present invention relates to the field of interface testing, and in particular to a low-code interface automation testing method, device, medium and product.

背景技术Background Art

目前,业务迭代节奏越来越快,项目越来越复杂,系统也越来越庞大,接口测试使用的越来越频繁,但测试人员对接口及代码掌握程度不一,可能会影响接口测试的准确程度和测试效率。At present, the pace of business iteration is getting faster and faster, projects are becoming more and more complex, systems are becoming larger and larger, and interface testing is used more and more frequently. However, testers have different levels of mastery of interfaces and codes, which may affect the accuracy and efficiency of interface testing.

发明内容Summary of the invention

本发明的目的是提供一种低代码接口自动化测试方法、装置、介质及产品,实现低代码化、自动化的接口测试,从而提高接口测试效率和准确性。The purpose of the present invention is to provide a low-code interface automation testing method, device, medium and product to realize low-code and automated interface testing, thereby improving interface testing efficiency and accuracy.

为实现上述目的,本发明提供了如下方案:To achieve the above object, the present invention provides the following solutions:

第一方面,本发明提供一种低代码接口自动化测试方法,包括:In a first aspect, the present invention provides a low-code interface automation testing method, comprising:

当处于单接口测试环境时,根据接口请求信息,确定对应的被测接口的地址并获取所述被测接口的响应结果;When in a single-interface test environment, determine the address of the corresponding interface under test and obtain the response result of the interface under test according to the interface request information;

对所述响应结果进行校验,并在校验通过后对所述响应结果进行预设内容提取,以得到预设内容变量;所述预设内容变量用于供下一被测接口在测试时调用;Verify the response result, and extract preset content from the response result after the verification is passed to obtain preset content variables; the preset content variables are used for the next tested interface to call during the test;

将所述接口请求信息、所述接口请求信息对应的被测接口及响应结果,作为一个接口用例存储至接口用例库中;The interface request information, the tested interface corresponding to the interface request information, and the response result are stored as an interface use case in an interface use case library;

当处于批量测试环境时,将postman格式、excel格式、swagger格式、chrome调试工具复制格式的用例文件导入所述接口用例库中,以得到多个接口用例;When in a batch test environment, import the use case files in the postman format, excel format, swagger format, and chrome debugging tool copy format into the interface use case library to obtain multiple interface use cases;

基于所述接口用例库,构建接口自动化测试任务;所述接口自动化测试任务至少包括一个接口用例;Based on the interface use case library, an interface automation test task is constructed; the interface automation test task includes at least one interface use case;

执行所述接口自动化测试任务,并生成测试报告。Execute the interface automation test task and generate a test report.

第二方面,本发明提供一种计算机装置,包括:存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序以实现所述的低代码接口自动化测试方法。In a second aspect, the present invention provides a computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the low-code interface automation testing method.

第三方面,本发明提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现所述的低代码接口自动化测试方法。In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the low-code interface automation testing method.

第四方面,本发明提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现所述的低代码接口自动化测试方法。In a fourth aspect, the present invention provides a computer program product, including a computer program, which implements the low-code interface automation testing method when executed by a processor.

根据本发明提供的具体实施例,本发明公开了以下技术效果:According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:

本发明在单接口测试环境时,根据接口请求信息确定对应的被测接口的地址并获取被测接口的响应结果,在对响应结果进行校验和提取后得到预设内容变量,可用于供下一被测接口在测试时调用;需知,通过设置预设内容变量可在下一接口测试时直接调用,减少了代码的使用量,实现了低代码处理。然后将接口请求信息及对应的被测接口及响应结果作为一个接口用例存储至接口用例库中。当处于批量测试环境时,将postman格式、excel格式、swagger格式、chrome调试工具复制格式的用例文件导入接口用例库中,以得到多个接口用例;需知,通过接收不同格式的文件并直接进行转换,也减少了代码的使用,实现了低代码处理。最后,基于接口用例库构建接口自动化测试任务,执行并生成测试报告。全程无需人工参与代码的编写,提高了接口测试的准确性和效率。In a single interface test environment, the present invention determines the address of the corresponding tested interface according to the interface request information and obtains the response result of the tested interface. After verifying and extracting the response result, a preset content variable is obtained, which can be used for the next tested interface to call during testing; it should be noted that by setting the preset content variable, it can be directly called during the next interface test, reducing the amount of code used and realizing low-code processing. Then the interface request information and the corresponding tested interface and response result are stored in the interface case library as an interface use case. When in a batch test environment, the use case files in the postman format, excel format, swagger format, and chrome debugging tool copy format are imported into the interface case library to obtain multiple interface use cases; it should be noted that by receiving files in different formats and directly converting them, the use of code is also reduced, realizing low-code processing. Finally, an interface automation test task is constructed based on the interface case library, and a test report is executed and generated. There is no need for manual participation in code writing throughout the process, which improves the accuracy and efficiency of interface testing.

综上,本发明解决了接口业务测试学习代码的时间成本,复用平时测试任务中用到的接口用例带来的问题,提高了工作效率及用例的覆盖率,可以为项目带来高效的接口监测和接口管理。In summary, the present invention solves the time cost of learning codes for interface business testing, and the problems caused by reusing interface use cases used in routine testing tasks, thereby improving work efficiency and use case coverage, and can bring efficient interface monitoring and interface management to the project.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

图1为本发明低代码接口自动化测试方法的流程示意图。Figure 1 is a flow chart of the low-code interface automation testing method of the present invention.

具体实施方式DETAILED DESCRIPTION

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

本发明的目的是提供一种低代码接口自动化测试方法、装置、介质及产品,可以单接口测试又可以利用外部已有的用例快速生成接口自动化用例。The purpose of the present invention is to provide a low-code interface automation testing method, device, medium and product, which can perform single interface testing and use external existing use cases to quickly generate interface automation use cases.

为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

实施例1Example 1

如图1所示,本发明提供一种低代码接口自动化测试方法,包括:As shown in FIG1 , the present invention provides a low-code interface automation testing method, comprising:

在进行接口自动化测试时,用户需要先登陆测试平台,进入接口工具页面;在接口工具页面可选择测试环境:单个接口测试、批量导入测试。When performing interface automation testing, users need to log in to the test platform first and enter the interface tool page; on the interface tool page, they can select the test environment: single interface test, batch import test.

步骤100,当处于单接口测试环境时,根据接口请求信息,确定对应的被测接口的地址并获取所述被测接口的响应结果。Step 100, when in a single-interface test environment, determine the address of the corresponding interface under test according to the interface request information and obtain the response result of the interface under test.

具体地,根据开发提供的接口请求文档确定接口请求信息,在接口工具页面输入和设置相应的接口请求参数。所述接口请求信息包括请求方法、请求地址、请求体及请求头信息。Specifically, the interface request information is determined according to the interface request document provided by the developer, and the corresponding interface request parameters are input and set on the interface tool page. The interface request information includes the request method, request address, request body and request header information.

所述请求方法包括GET、POST、PUT及DELETE。所述请求地址为被测接口的地址,如:https://autotest.***.com/api/admin/addUser。所述请求体的类型包括form-data、x-www-form-urlencoded及json。如,{"nickname":"**0","username":"**1","password":"**2"}。请求头信息示例如:设置content-type为application/json;charset=UTF-8等。The request methods include GET, POST, PUT and DELETE. The request address is the address of the interface under test, such as: https://autotest.***.com/api/admin/addUser. The types of the request body include form-data, x-www-form-urlencoded and json. For example, {"nickname":"**0","username":"**1","password":"**2"}. Examples of request header information include: setting content-type to application/json; charset=UTF-8, etc.

在接口工具页面中,点击“发送”按钮后,根据接口请求信息请求对应的接口地址,获取被测接口的响应结果后,前端页面展示出来。In the interface tool page, after clicking the "Send" button, the corresponding interface address is requested according to the interface request information, and the response result of the tested interface is obtained, and then the front-end page is displayed.

步骤200,对所述响应结果进行校验,并在校验通过后对所述响应结果进行预设内容提取,以得到预设内容变量;所述预设内容变量用于供下一被测接口在测试时调用。Step 200, verify the response result, and extract preset content from the response result after the verification is passed to obtain preset content variables; the preset content variables are used for the next tested interface to call during testing.

具体地,对所述响应结果进行校验,包括:Specifically, verifying the response result includes:

(201)采用正则表达式或者JSONPath表达式,从所述响应结果提取预定信息。(201) Use regular expressions or JSONPath expressions to extract predetermined information from the response results.

(202)判断所述预定信息是否满足预期条件;所述预期条件以比较模式进行表征,所述比较模式包括包含、不包含、相等、不相等、大于、小于。(202) Determine whether the predetermined information satisfies an expected condition; the expected condition is characterized by a comparison mode, and the comparison mode includes including, not including, equal, not equal, greater than, and less than.

(203)若所述预定信息满足预期条件,则表明校验通过;若所述预定信息未满足预期条件,则表明校验未通过。(203) If the predetermined information meets the expected conditions, it indicates that the verification is passed; if the predetermined information does not meet the expected conditions, it indicates that the verification is not passed.

举例如下:响应内容为${RESPONSE},提取值表达式(即正则表达式)为【"message(.*?)"】,比较模式为包含,预期值为“新增用户成功”;若在经过解析后得到【"message":"新增用户成功"】,则表明满足预期包含的文本,此时校验通过。For example, the response content is ${RESPONSE}, the extraction value expression (regular expression) is ["message(.*?)"], the comparison mode is inclusion, and the expected value is "New user added successfully"; if ["message":"New user added successfully"] is obtained after parsing, it means that the expected included text is met and the verification passes.

对所述响应结果进行预设内容提取,具体包括:采用正则表达式或者JSONPath表达式,从所述响应结果中提取待用内容,并将所述待用内容存储为预设内容变量。Extracting preset content from the response result specifically includes: extracting the stand-by content from the response result using a regular expression or a JSONPath expression, and storing the stand-by content as a preset content variable.

举例如下:采用JSONPath表达式【$.data.userId】对响应内容进行提取,经过解析得到333;将上述得到的结果存储到UserID中,后续接口参数输入中可以通过指定写法【写法是${UserID}】来引用该值,在发送请求前会将${UserID}还原为333。For example: Use the JSONPath expression [$.data.userId] to extract the response content, and obtain 333 after parsing; store the above result in UserID, and the value can be referenced in the subsequent interface parameter input by specifying the writing method [writing method is ${UserID}]. Before sending the request, ${UserID} will be restored to 333.

从接口的响应内容中提取得到指定内容后,可进行存储并给后续接口使用;如上述示例中提取的userId可给后续接口使用。After extracting the specified content from the response content of the interface, it can be stored and used by subsequent interfaces; for example, the userId extracted in the above example can be used by subsequent interfaces.

步骤300,将所述接口请求信息、所述接口请求信息对应的被测接口及响应结果,作为一个接口用例存储至接口用例库中。Step 300: store the interface request information, the tested interface corresponding to the interface request information, and the response result as an interface use case in an interface use case library.

在一个具体示例中,在将所述接口请求信息、所述接口请求信息对应的被测接口及响应结果,作为一个接口用例存储至接口用例库时,对所述接口用例进行命名,并确定所属项目及所属模块。In a specific example, when the interface request information, the tested interface corresponding to the interface request information and the response result are stored as an interface use case in an interface use case library, the interface use case is named, and the project and module to which it belongs are determined.

具体地,在对响应结果验证和提取完成之后,点击接口工具页面的保存按钮,出现一个弹窗,在弹窗中输入用例名称(如:修改主仓库存和虚拟库存_执行成功)、所属项目(如:开放平台)和模块(如:开放平台pre)等信息,点击保存/更新按钮,会将接口请求信息及对应的被测接口及响应结果保存到一个接口用例中,自动汇总到测试用例库。在实际应用中,还可设置密钥、优先级以及添加备注内容。Specifically, after the response result is verified and extracted, click the Save button on the interface tool page, a pop-up window will appear, enter the use case name (such as: Modify the main warehouse inventory and virtual inventory_Execution successful), the project (such as: Open Platform) and the module (such as: Open Platform pre) and other information in the pop-up window, click the Save/Update button, the interface request information and the corresponding tested interface and response results will be saved to an interface use case, and automatically aggregated to the test case library. In actual applications, you can also set the key, priority and add notes.

所述自动用例库中的接口用例可采用接口用例列表的形式展示,表中包括:序号、用例名称、备注、模块名称、项目名称、优先级、请求方式及请求头信息等。The interface use cases in the automatic use case library can be displayed in the form of an interface use case list, which includes: serial number, use case name, remarks, module name, project name, priority, request method and request header information, etc.

步骤400,当处于批量测试环境时,将postman格式、excel格式、swagger格式、chrome调试工具复制格式的用例文件导入所述接口用例库中,以得到多个接口用例。Step 400, when in a batch testing environment, import the use case files in the postman format, excel format, swagger format, and chrome debugging tool copy format into the interface use case library to obtain multiple interface use cases.

具体地,在测试用例库中批量导入已有接口用例文件快速生接口自动化用例的过程中,导入类型支持:postman格式(平时采用postman测试保存)、excel格式接口用例(测试人员一般采用EXCEL编写)、swagger格式(由开发提供)、chrome调试工具复制格式等导入,这些文件存储接口输入参数非常有规律,读取这些格式文件,将对应字段经过转化为接口工具需求的格式。Specifically, in the process of batch importing existing interface case files in the test case library to quickly generate interface automation cases, the import types supported are: postman format (usually saved using postman testing), excel format interface case (testers generally write in EXCEL), swagger format (provided by development), chrome debugging tool copy format, etc. These files store interface input parameters in a very regular manner. These format files are read and the corresponding fields are converted into the format required by the interface tool.

步骤500,基于所述接口用例库,构建接口自动化测试任务;所述接口自动化测试任务至少包括一个接口用例。Step 500: construct an interface automation test task based on the interface use case library; the interface automation test task includes at least one interface use case.

在一个实际应用中,在接口测试任务页面,新增接口自动化测试任务TestSuite,输入必要信息,创建一个接口自动化任务。然后,点击任务的【添加用例】按钮,选择测试用例库中的接口,组成该接口自动化任务的用例。In an actual application, on the interface test task page, add an interface automation test task TestSuite, enter the necessary information, and create an interface automation task. Then, click the [Add Use Case] button of the task, select the interface in the test case library, and form the use case of the interface automation task.

步骤600,执行所述接口自动化测试任务,并生成测试报告。Step 600, executing the interface automation test task and generating a test report.

在一个实际应用中,点击接口自动化测试任务的执行按钮,会自动执行该接口任务中所有用例。用例执行结束后,会生成测试报告。In an actual application, clicking the execution button of an interface automated test task will automatically execute all the use cases in the interface task. After the use case execution is completed, a test report will be generated.

最后,本发明能够实现低代码接口自动化测试的技术在于:Finally, the technology of the present invention that can realize low-code interface automated testing is:

1)单接口测试中,本发明进行了了响应结果提取,使用JSONPath表达式【$.data.userId】提取了响应结果中的userId的内容333.存储到变量UserID中;假设后续接口2想查询该用户的公司信息,使用${UserID}即可代表该用户Id,然后接口2还可以继续从接口2的响应结果中提取内容,为接口2的后续接口再继续使用,如此循环。这样通过从上一个响应结果提取指定内容,为下一个接口使用,达到接口一连串的接口测试,不需要用户编写代码,只需要编写提取表达式就可以完成接口的测试。1) In the single interface test, the present invention extracts the response result, and uses the JSONPath expression [$.data.userId] to extract the content 333 of the userId in the response result. It is stored in the variable UserID; if the subsequent interface 2 wants to query the company information of the user, ${UserID} can be used to represent the user ID, and then interface 2 can continue to extract content from the response result of interface 2, and continue to use it for the subsequent interface of interface 2, and so on. In this way, by extracting the specified content from the previous response result and using it for the next interface, a series of interface tests can be achieved, and the user does not need to write code, but only needs to write the extraction expression to complete the interface test.

2)在服务器端,每个用户都事先分配了一个存储变量的容器A(以键值对的格式存储);在单接口测试中,输入变量名和提取表达式后,点击调试按钮,根据表达式提取的333,将{UserID:333}存储到服务端的容器A中。当在其它接口中输入${UserID}时,服务端会将${}里面的名称解析出来,即得到UserID;之后到用户的容器A获得UserID对应的值333,然后将${UserID}替换成333。通过上述变量的动态引用设置,无需额外新增UserID的相关代码,实现了低代码。2) On the server side, each user is assigned a container A for storing variables (stored in the format of key-value pairs) in advance; in the single interface test, after entering the variable name and extracting the expression, click the debug button, and store {UserID:333} in the server-side container A according to 333 extracted by the expression. When ${UserID} is entered in other interfaces, the server will parse the name in ${} to get the UserID; then go to the user's container A to get the value 333 corresponding to the UserID, and then replace ${UserID} with 333. Through the dynamic reference setting of the above variables, there is no need to add additional UserID-related code, which achieves low code.

3)本发明中导入类型支持:postman格式、excel格式接口用例、swagger格式、chrome调试工具复制格式等导入,这些文件存储接口输入参数非常有规律,读取这些格式文件,将对应字段转化为接口工具需求的格式,并存储到接口用例库中。本发明无需对各文件编写代码,而是通过直接转换实现了低代码。3) The import types supported in the present invention include: postman format, excel format interface use case, swagger format, chrome debugging tool copy format, etc. These files store interface input parameters in a very regular manner. These format files are read, the corresponding fields are converted into the format required by the interface tool, and stored in the interface use case library. The present invention does not need to write code for each file, but achieves low code through direct conversion.

实施例2Example 2

一种计算机装置,包括:存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序以实现实施例1中的低代码接口自动化测试方法。A computer device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the low-code interface automation testing method in Example 1.

实施例3Example 3

一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现实施例1中的低代码接口自动化测试方法。A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the low-code interface automation testing method in Example 1.

实施例4Example 4

一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现实施例1中的低代码接口自动化测试方法。A computer program product includes a computer program, which implements the low-code interface automation testing method in Example 1 when executed by a processor.

实施例5Example 5

一种计算机设备,该计算机设备可以是数据库。该计算机设备包括处理器、存储器、输入/输出接口(Input/Output,简称I/O)和通信接口。其中,处理器、存储器和输入/输出接口通过系统总线连接,通信接口通过输入/输出接口连接到系统总线。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质和内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储待处理事务。该计算机设备的输入/输出接口用于处理器与外部设备之间交换信息。该计算机设备的通信接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现实施例1中的低代码接口自动化测试方法。A computer device, which may be a database. The computer device includes a processor, a memory, an input/output interface (Input/Output, referred to as I/O) and a communication interface. The processor, the memory and the input/output interface are connected via a system bus, and the communication interface is connected to the system bus via the input/output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store pending transactions. The input/output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the low-code interface automation testing method in Example 1 is implemented.

需要说明的是,本申请所涉及的对象信息(包括但不限于对象设备信息、对象个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经对象授权或者经过各方充分授权的信息和数据,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。It should be noted that the object information (including but not limited to object device information, object personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-OnlyMemory,ROM)、磁带、软盘、闪存、光存储器、高密度嵌入式非易失性存储器、阻变存储器(ReRAM)、磁变存储器(Magnetoresistive RandomAccess Memory,MRAM)、铁电存储器(Ferroelectric Random Access Memory,FRAM)、相变存储器(Phase Change Memory,PCM)、石墨烯存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器等。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static RandomAccessMemory,SRAM)或动态随机存取存储器(Dynamic RandomAccess Memory,DRAM)等。本申请所提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请所提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器等,不限于此。Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处。综上所述,本说明书内容不应理解为对本发明的限制。This article uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only used to help understand the method and core ideas of the present invention. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims (8)

1. A method for automated testing of a low code interface, the method comprising:
When the single-interface testing environment exists, determining the address of a corresponding tested interface according to the interface request information and acquiring a response result of the tested interface;
verifying the response result, and extracting preset content from the response result after the response result passes the verification to obtain a preset content variable; the preset content variable is used for the next tested interface to be called in the test;
storing the interface request information, the tested interface corresponding to the interface request information and the response result as an interface use case into an interface use case library;
When the interface case library is in a batch test environment, importing use case files in postman format, excel format, swagger format and chrome debugging tool copy format into the interface case library to obtain a plurality of interface cases;
Constructing an interface automatic test task based on the interface use case library; the interface automatic test task at least comprises an interface use case;
And executing the interface automatic test task and generating a test report.
2. The method according to claim 1, wherein the interface request information includes a request method, a request address, a request body, and request header information;
The request method includes GET, POST, PUT and DELETE;
The request address is the address of the tested interface;
the types of the request body include form-data, x-www-form-urlencoded and json.
3. The method for automatically testing the low-code interface according to claim 1, wherein the step of verifying the response result specifically comprises the steps of:
Extracting predetermined information from the response result by using a regular expression or JSONPath expression;
judging whether the preset information meets an expected condition or not; the expected condition is characterized by a comparison pattern comprising include, not include, equal, not equal, greater than, less than;
if the preset information meets the expected condition, the verification is passed; and if the preset information does not meet the expected condition, indicating that the verification is not passed.
4. The method for automatically testing the low-code interface according to claim 1, wherein the extracting the preset content from the response result specifically comprises:
And extracting standby content from the response result by adopting a regular expression or JSONPath expression, and storing the standby content as a preset content variable.
5. The low code interface automated test method of claim 1, further comprising:
And when the interface request information, the tested interface corresponding to the interface request information and the response result are stored as one interface use case to an interface use case library, naming the interface use case, and determining the belonged item and the belonged module.
6. A computer apparatus, comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor executes the computer program to implement the low code interface automated test method of any of claims 1-5.
7. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the low code interface automated test method of any of claims 1-5.
8. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the low code interface automated test method of any of claims 1-5.
CN202410895288.7A 2024-07-04 2024-07-04 A low-code interface automated testing method, device, medium and product Pending CN118760598A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410895288.7A CN118760598A (en) 2024-07-04 2024-07-04 A low-code interface automated testing method, device, medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410895288.7A CN118760598A (en) 2024-07-04 2024-07-04 A low-code interface automated testing method, device, medium and product

Publications (1)

Publication Number Publication Date
CN118760598A true CN118760598A (en) 2024-10-11

Family

ID=92940830

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410895288.7A Pending CN118760598A (en) 2024-07-04 2024-07-04 A low-code interface automated testing method, device, medium and product

Country Status (1)

Country Link
CN (1) CN118760598A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170123951A1 (en) * 2015-10-30 2017-05-04 International Business Machines Corporation Automated test generation for multi-interface enterprise virtualization management environment
CN116048890A (en) * 2022-12-13 2023-05-02 杭州乒乓智能技术有限公司 Multimode automatic interface test method, device, equipment and storage medium
CN117009249A (en) * 2023-09-15 2023-11-07 天津赛象科技股份有限公司 Test method, system and medium for automatically generating interface use cases and codes
CN117520145A (en) * 2023-09-28 2024-02-06 北京捷科智诚科技有限公司 A low-code assembled interface automated mixed scenario testing method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170123951A1 (en) * 2015-10-30 2017-05-04 International Business Machines Corporation Automated test generation for multi-interface enterprise virtualization management environment
CN116048890A (en) * 2022-12-13 2023-05-02 杭州乒乓智能技术有限公司 Multimode automatic interface test method, device, equipment and storage medium
CN117009249A (en) * 2023-09-15 2023-11-07 天津赛象科技股份有限公司 Test method, system and medium for automatically generating interface use cases and codes
CN117520145A (en) * 2023-09-28 2024-02-06 北京捷科智诚科技有限公司 A low-code assembled interface automated mixed scenario testing method

Similar Documents

Publication Publication Date Title
CN108763076A (en) A kind of Software Automatic Testing Method, device, equipment and medium
CN113886232B (en) Test script generation method, terminal equipment and storage medium
CN107977308A (en) interface test method and device
CN115718705A (en) A comprehensive management platform interface automated testing method and system
CN116089275A (en) Database testing method, database system, electronic equipment and storage medium
CN114238085B (en) Interface testing method, device, computer equipment, and storage medium
CN118132448B (en) Test case processing method, device, computer equipment and storage medium
CN115049365A (en) Application commissioning information processing method and device and computer equipment
US20230039971A1 (en) Automated return evaluation with anomoly detection
CN113986766A (en) Automatic testing method and device
CN118760598A (en) A low-code interface automated testing method, device, medium and product
CN118093396A (en) Interface testing method, device, computer equipment and storage medium
CN114490415B (en) Business testing method, computer device, storage medium and computer program product
CN117370160A (en) Code auditing method, apparatus, computer device, storage medium and program product
CN116820927A (en) Method and device for processing exception of batch operation
CN116126672A (en) Interface testing method, device, equipment and storage medium
CN116361149A (en) Batch processing automated testing method, device, computer equipment and storage medium
CN119201588A (en) Business system monitoring method, device and computer equipment
CN117453703A (en) Test method, apparatus, device, medium and program product
CN118656060A (en) A method and system for dynamically adjusting form submission content
CN117112424A (en) Method, device, equipment, medium and product for generating test case
CN117331789A (en) Log generation method, device, computer equipment and storage medium
CN119003362A (en) Test case input parameter detection method, system, terminal and medium
CN120692186A (en) Blockchain interface testing method and device based on event monitoring and state prediction
CN118503117A (en) Selenium-based automatic test method, terminal equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination