CN106874174B - Method and device for realizing interface test and function test - Google Patents

Method and device for realizing interface test and function test Download PDF

Info

Publication number
CN106874174B
CN106874174B CN201510921192.4A CN201510921192A CN106874174B CN 106874174 B CN106874174 B CN 106874174B CN 201510921192 A CN201510921192 A CN 201510921192A CN 106874174 B CN106874174 B CN 106874174B
Authority
CN
China
Prior art keywords
interface
request
test
user
parameter
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.)
Active
Application number
CN201510921192.4A
Other languages
Chinese (zh)
Other versions
CN106874174A (en
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.)
Advanced New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201510921192.4A priority Critical patent/CN106874174B/en
Publication of CN106874174A publication Critical patent/CN106874174A/en
Application granted granted Critical
Publication of CN106874174B publication Critical patent/CN106874174B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

Abstract

The application provides a method for realizing interface test and function test, which is applied to a terminal and comprises the following steps: initiating a test page generation request to a test server according to an interface type specified by a user and interface parameters required to be provided by calling the interface type; receiving a tested system request parameter generated by the test server according to the received interface type and interface parameter, and displaying the tested system request parameter on a test page; and executing the interface test and/or the function test of the tested system by adopting the system request on the current test page according to the execution instruction of the user. The technical scheme of the application can be generally used for testing various interface types, can automatically generate the request parameters of the tested system with different interface types, improves the testing efficiency of the interface types used for data exchange between different applications, and reduces the testing dependence.

Description

Method and device for realizing interface test and function test
Technical Field
The present application relates to the field of software testing technologies, and in particular, to a method and an apparatus for implementing interface testing and function testing.
Background
With the technical progress and wide popularization of the internet, the network can complete more and more living and working matters for people, the realization process of network services is increasingly complex, and one service can be completed by matching a plurality of systems for realizing different functions. One system provides an interface called by the other system, executes a certain function according to the interface parameters provided by the other system, and notifies the system calling the interface of the execution result. These systems may be implemented and maintained by different development teams, or even by different companies. When a system is developed or upgraded, it needs to test whether the interface provided for other system calls can work normally (interface test) and whether the expected function can be realized by calling the interface (function test).
In the prior art, for an HTTP (HyperText Transfer Protocol) interface, some test request parameters may be automatically generated by a test server, and the automatically generated test request parameters are used to call the interface for interface test and function test, but cannot be applied to other interface types; for interface types used for exchanging data between different applications, such as Remoting (remote processing) interface and WS (Web service) interface, a tester needs to manually write request parameters of a system to be tested, which seriously affects testing efficiency.
Disclosure of Invention
In view of this, the present application provides a method for implementing an interface test and a function test, which is applied to a terminal and includes:
initiating a test page generation request to a test server according to an interface type specified by a user and interface parameters required to be provided by calling the interface type;
receiving a tested system request parameter generated by the test server according to the received interface type and interface parameter, and displaying the tested system request parameter on a test page;
and executing the interface test and/or the function test of the system to be tested by adopting the request parameters of the system to be tested on the current test page according to the execution instruction of the user.
The application provides a method for realizing interface test and function test, which is applied to a test server and comprises the following steps:
receiving a test page generation request of a terminal, wherein the test page generation request comprises an interface type specified by a user and interface parameters required to be provided by calling the interface type;
generating a request parameter of the system to be tested according to the interface type and the interface parameter, and sending the request parameter to the terminal; and the tested system request parameter is used for carrying out interface test and/or function test of the tested system.
The application also provides an interface test and function test's realization device, uses on the terminal, includes:
the interface type and parameter sending unit is used for initiating a test page generation request to the test server according to an interface type specified by a user and interface parameters required to be provided by calling the interface type;
the request parameter receiving and displaying unit is used for receiving the tested system request parameters generated by the test server according to the received interface types and the interface parameters and displaying the tested system request parameters on a test page;
and the request parameter execution unit is used for executing the interface test and/or the function test of the system to be tested by adopting the request parameters of the system to be tested on the current test page according to the execution instruction of the user.
The application provides a realization device of interface test and functional test uses on test server, includes:
the device comprises an interface type and parameter receiving unit, a test page generation unit and a parameter generating unit, wherein the interface type and parameter receiving unit is used for receiving a test page generation request of a terminal, and the test page generation request comprises an interface type specified by a user and interface parameters required to be provided by calling the interface type;
the tested system request parameter generating unit is used for generating tested system request parameters according to the interface types and the interface parameters and sending the tested system request parameters to the terminal; and the tested system request parameter is used for carrying out interface test and/or function test of the tested system.
According to the technical scheme, in the embodiment of the application, the user designates the interface type and the interface parameters required to be provided by the interface type on the terminal, the terminal uploads the interface type and the interface parameters to the test server, and the test server generates the request parameters of the system to be tested according to the interface type and sends the request parameters to the terminal for the user to initiate the test. The embodiment of the application can be generally used for testing various interface types, can automatically generate the request parameters of the tested system with different interface types, and improves the testing efficiency of the interface types used for data exchange among different applications.
Drawings
Fig. 1 is a network structure diagram of an application scenario in an embodiment of the present application;
fig. 2 is a flowchart of an implementation method for interface testing and function testing applied to a terminal in an embodiment of the present application;
FIG. 3 is a flowchart illustrating a method for implementing interface testing and function testing applied to a test server according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an interface for specifying interface types and interface parameters by a user on a terminal in an application example of the present application;
FIG. 5 is a schematic diagram of an interface of preset information for setting attributes of call objects on a terminal in an application example of the present application;
FIG. 6 is a schematic interface diagram of a test page on a terminal in an application example of the present application;
fig. 7 is a hardware configuration diagram of a terminal or a test server;
fig. 8 is a logic structure diagram of an implementation apparatus for interface test and function test applied to a terminal in an embodiment of the present application;
fig. 9 is a logic structure diagram of an implementation apparatus for interface test and function test applied to a test server in the embodiment of the present application.
Detailed Description
The embodiment of the application provides a new method for realizing interface test and function test, wherein a user designates an interface type to be called and an interface parameter required to be provided for calling the interface type, a test server automatically generates a request parameter of a system to be tested according to the interface type and the interface parameter, and a terminal adopts the request parameter of the system to be tested to initiate the interface test or function test on the system to be tested, so that the method can be suitable for various interface types, including the interface type used for exchanging data among different applications; and moreover, a tester does not need to manually compile the request parameters of the tested system, so that the testing efficiency is greatly improved, and the problems in the prior art are solved.
Fig. 1 is a network structure diagram of an application scenario in an embodiment of the present application, where a terminal obtains a request parameter of a system under test through communication with a test server according to an instruction of a user; and the terminal adopts the request parameters of the tested system to execute the test and communicates with the tested system to obtain a test result. The terminal can also call the interface of the tested system through the test server, and the test server forwards the test result of the tested system to the terminal.
The terminal may be a mobile phone, a tablet Computer, a PC (Personal Computer), a notebook, a server, or a virtual terminal or server; the test server may be one physical or logical server, or two or more physical or logical servers sharing different responsibilities and cooperating with each other to implement the functions of the server in the embodiment of the present application. The terminal and the test server may also be two processes or two applications running on the same device. The system to be tested may be a PC (Personal Computer), a notebook, a server, or the like, and may be configured to receive the interface call and return the test result. The embodiment of the application does not limit the types of the terminal, the test server and the equipment where the system to be tested is located, and the types, protocols and the like of communication networks among the terminal, the test server and the system to be tested.
In the embodiment of the present application, a flow of the method for implementing the interface test and the function test applied to the terminal is shown in fig. 2, and a flow of the method applied to the test server is shown in fig. 3.
On the terminal, step 210, a test page generation request is initiated to the test server according to the interface type specified by the user and the interface parameters required to be provided for calling the interface type.
On the test server, step 310, a test page generation request of the terminal is received, where the test page generation request includes an interface type specified by a user and interface parameters required to be provided for invoking the interface type.
When different types of interfaces are called, different interface parameters need to be provided for the tested system. In order to enable the embodiment of the present application to be universally applicable to various interface types, a configuration method of an interface type to be called by a user may be provided to the user on a terminal; after a user designates an interface type to be called to a terminal, a configuration method of interface parameters required for calling the designated interface type can be provided for the user on the terminal; and after the user completes the configuration of the interface parameters, the terminal sends the interface type and the interface parameters specified by the user to the server in the test page generation request.
The interface type configuration method provided for the user can adopt radio buttons, tab pages and the like, and after the user selects the interface type, each interface parameter of the interface type can be required to be input by the user in the form of an input box. The embodiment of the present application does not limit the specific way in which the user specifies the interface type and the interface parameters.
For example, when the interface type specified by the user is Remoting (remote processing) interface or WS (Web Service) interface, the interface parameters that the user may be asked to input include interface name, interface request address, request object and its attributes, response object and referred Jar (Java ARchive) package; wherein, the interface name, the interface request address, the request object and the attribute thereof are provided by the user. When the interface type specified by the user is an HTTP (hypertext transfer Protocol) interface, the interface parameters that can be input by the user include a request mode, an interface name, an interface request address, and a request object and its attributes.
In addition, in addition to the standardized service interface or protocol interface, the interface type in the embodiment of the present application may also be an interface type customized by the system under test.
On the test server, step 320, generating a request parameter of the system to be tested according to the interface type and the interface parameter received from the terminal, and sending the request parameter to the terminal; the tested system requests the parameters to be used for carrying out interface test and/or functional test of the tested system.
On the terminal, step 220, receiving a system under test request parameter generated by the test server according to the received interface type and interface parameter, and displaying the system under test request parameter on a test page.
The test server receives a test page generation request of the terminal, extracts an interface type designated by a user and interface parameters of the interface type from the test page generation request, and generates request parameters of a system to be tested by adopting the interface parameters and according to the call logic of the interface type. When the test case formed by the request parameters of the tested system is executed, the interface test or the function test of the tested system is carried out by calling the interface specified by the user. The specific generation mode of the request parameter of the system to be tested can be realized by referring to the prior art, and is not described in detail.
If the interface parameters of the interface type specified by the user comprise the request object and the attributes thereof, the test server generates a call object according to the analyzed request object and the attributes thereof, so that each attribute in the call object is obtained; the test server sends the attribute of the calling object to the terminal, and indicates the terminal to provide preset information of the attribute of the calling object, wherein the preset information comprises an attribute default value; after receiving the instruction of the test server, the terminal displays each attribute of the calling object to the user and asks the user to set preset information; the terminal sends the preset information determined by the user to the test server; and the test server generates a request parameter of the system to be tested according to the interface type, the interface parameter and the default value of the calling object attribute sent by the terminal and sends the request parameter to the terminal.
The tester can adopt the attribute value capable of returning the correct result as the default value of the attribute of the calling object, thus after receiving the initial tested system request parameter generated by the test server, the test case formed by adopting the initial tested system request parameter can execute and return the correct result, generally, the tested system can be considered to run normally, and on the basis, other tests of the interface are carried out.
And the test server returns the generated request parameters of the tested system to the terminal sending the test page generation request. And after receiving the request parameters of the tested system, the terminal displays the request parameters on a test page. It should be noted that the test page in the embodiment of the present application refers to a display interface used for displaying request parameters of the system under test, and also used for modifying test codes, displaying test results, and the like, and may be a web page, a display window in an application program, or an interface in another form.
On the terminal, step 230, according to the execution instruction of the user, the interface test and/or the function test of the system under test are executed by using the requested parameters of the system under test on the current test page.
When a user wants to perform an interface test or a function test of the system under test according to the requested parameters of the system under test displayed on the test page, an execution instruction can be sent to the terminal. The terminal forms a test case according to the parameters of the tested system on the current test page, calls an interface designated by a tested system user, and initiates interface test or function test on the tested system; and the tested system returns the test result to the terminal. The terminal can also send the request parameters of the tested system on the current test page to the test server after receiving the execution instruction of the user, the test server constructs a test case according to the received parameters, performs interface test or function test on the tested system, and forwards the call result returned by the tested system to the terminal.
In an implementation manner, the terminal can display the test result on the test page after receiving the test result from the tested system, so that a tester can conveniently check the request parameters of the tested system and the corresponding test result at the same time. For example, for Java language, json (JavaScript Object Notation) formatting may be performed on the Java system request parameters and the test results, and then the Java system request parameters and the test results are displayed on a test page, so that the Java language request parameters and the test results are displayed in rows according to Java language specifications, thereby providing a friendly reading interface for a tester.
Given that a tester may wish to be able to manually modify system under test request parameters in order to initiate a new test, a user may be allowed to manually modify the system under test request parameters displayed on a test page. And receiving the modification operation of the user on the request parameters of the tested system on the test page by the terminal, and refreshing and displaying according to the modification operation of the user.
Some tools (which may be buttons, shortcut keys, etc.) may be provided for the user on the test interface to facilitate the user's modification of the requested parameters of the system under test. For example, a tool for generating the latest time may be provided for the user, and after receiving an instruction for generating the latest time sent by the user by using the tool, the terminal generates the latest system time and displays the latest system time on a test page for the user to modify the requested parameters of the system under test. For another example, a tool for generating a random number may be provided for the user, and after receiving an instruction for generating a random number sent by the user using the tool, the terminal generates a random number and displays the random number on a test page for the user to use when modifying the requested parameter of the system under test.
The tested system request parameters on the test page can be modified by the test server, so that the operation of a user in modifying the tested system request parameters is simplified. In one implementation, a tool (which may be a pull-down selection box, an input box, or the like) for modifying the interface name and/or the interface request address in the interface parameter may be provided for the user on the test page, and after the user modifies the interface name and/or the interface request address by using the tool, the terminal sends the interface name and/or the interface request address modified by the user to the test server; after receiving the request parameters, the test server generates the request parameters of the tested system according to the modified interface name and/or interface request address and sends the request parameters to the terminal; and the terminal refreshes the tested system request parameters displayed on the test page after receiving the parameters.
For the situation that the interface parameter includes the request object and its attribute, the preset information of the calling object attribute provided by the test server indication terminal may include whether each attribute belongs to the dynamic change attribute, and according to the specific use of the attribute in the test, some attributes need to be dynamically changed, for example, attributes used for idempotent control, and these attributes belong to the dynamic change attribute. The method comprises the steps that a tool (which can be a button, a shortcut key and the like) for updating the dynamic change attribute value can be provided for a user on a test page, when the user sends an instruction by using the tool, the instruction for updating the dynamic change attribute value by the user is sent to a test server, and the request parameters of a tested system displayed on the current test page are sent to the test server together; the test server analyzes the value of the dynamic change attribute of the calling object from the received request parameter of the system to be tested, updates the value of each dynamic change attribute according to a certain algorithm (such as an algorithm for assigning the dynamic change attribute to a random number of a value range of the dynamic change attribute), and returns the request parameter of the system to be tested with the updated dynamic change attribute value to the terminal; and the terminal receives the tested system request parameter with the updated dynamic change attribute value returned by the test server, and refreshes the display of the test page according to the received tested system request parameter.
Therefore, in the embodiment of the application, the terminal uploads the interface type specified by the user and the interface parameter required to be provided for calling the interface type to the test server, the test server generates the tested system request parameter for calling the interface specified by the user according to the information required for calling the tested system interface, and the tested system request parameter is used for interface test, so that the embodiment of the application can be universally used for various interface types, and when the interface type is used for data exchange among different applications, a tester does not need to manually write the tested system request parameter, and the test efficiency is improved; and the tested system can be tested without waiting for the development or the completion of the upgrade of the related system of the tested system, so that the test dependence is reduced.
In an application example of the present application, after a user logs in to a test server on a terminal, an interface type to be tested in a test page and interface parameters of the interface type may be specified through an interface shown in fig. 4. The application example supports three interface types of an HTTP interface, a WS interface and a TR interface, wherein the TR interface is a self-defined Remoting interface, and interface parameters required by calling the TR interface are consistent with the Remoting interface.
The user selects the TR interface tab on the interface shown in fig. 4, and inputs specific interface parameter values in the input boxes of the interface parameters on the tab. The interface parameters include the interface name, calling address (i.e., interface request address), request object, response object, and Jar package reference (i.e., referenced Jar package). In the request object input box, the private StringPaymentId and the private StringRequestId are the attributes of the request object. After the input is completed, the user clicks the decision button. The terminal carries the TR interface type appointed by the user and all interface parameters input by the user in a test page generation request and sends the test page generation request to a test server.
After receiving a test generation request of a terminal, because interface parameters of the terminal comprise a request object and attributes thereof, a test server generates a Java object (namely a call object) according to the request object and the attributes thereof, writes the attributes in the Java object into a call object attribute list, and sends the Java object attribute list to the terminal, so that a user is required to provide attribute default values and whether the attributes belong to dynamically-changed attributes or not, and the attribute default values and the attributes are used as preset information of each attribute.
The terminal presents the list of the attributes of the call object sent by the test server to the user on the interface shown in fig. 5, the user inputs an attribute value which enables the tested system to return a correct result as a default value, and sets whether each attribute belongs to a dynamically changing attribute. For example, of the three call object attributes in FIG. 5, only the FreeZeRequestId belongs to the dynamically changing attribute. And after the user input and the setting are finished, clicking 'generating a test page', and sending preset information determined by the user to a test server by the terminal.
And the test server generates a request parameter of the system to be tested according to the received interface type, the interface parameter and the default value of the attribute of the calling object, and sends the request parameter to the terminal.
After receiving the tested system request parameter generated by the test server, the terminal formats the parameter in json format and then displays the parameter in the text box on the left side of the test page shown in fig. 6.
On the test page shown in fig. 6, the API List drop-down selection box is used for the user to modify the interface name, and the ServerAddress drop-down selection box is used for the user to modify the interface request address. And when the user modifies the current value through the pull-down selection box, the terminal sends the interface name and/or the interface request address modified by the user to the test server. And the test server generates a new request parameter of the system to be tested according to the modified interface name and/or the modified interface request address and sends the new request parameter to the terminal. And the terminal refreshes a text box for displaying the request parameters of the tested system according to the request parameters of the tested system returned by the test server.
When the user clicks the Update key on the test page in fig. 6, the terminal sends an instruction for updating the dynamic change attribute value of the user and the request parameter of the system under test displayed on the current test page to the test server. The test server analyzes the received request parameters of the system to be tested, identifies the values of the dynamic change attributes from the received request parameters of the system to be tested, updates the values to the values randomly generated in the value range of the values, and then returns the request parameters of the system to be tested with the updated dynamic change attribute values to the terminal. And the terminal refreshes a text box for displaying the request parameters of the tested system according to the request parameters of the tested system returned by the test server. Therefore, the value change can be realized without the need of searching and selecting the value of the dynamic change attribute by a tester.
On the test page of FIG. 6, the user can manually modify the system under test request parameters in the text box to perform interface tests as they require. A user clicks an Date Now key, and the terminal generates the latest system time and displays the latest system time in a text box on the right side of the key; a user clicks a Random Num key, and the terminal generates a Random number and displays the Random number in a text box on the right side of the key; the user may use the latest system time and the random number to modify the system under test request parameters. In addition, after the user clicks a Format Json key, the terminal carries out Json formatting on the tested system request parameters in the current tested system request parameter text box and displays the parameters again.
And after the user clicks a Post Request key, the terminal adopts the tested system Request parameters displayed in the current tested system Request parameter text box to construct a test case and execute the test case, and calls an interface of the tested system to perform interface test or function test. After receiving the test result returned by the system under test, the terminal performs json formatting on the test result and displays the test result in a text box (not shown in fig. 6) on the right side of the text box of the request parameter of the system under test. In this way, the tester can check whether the test result is correct or not by comparing the request parameter of the tested system with the test result.
Therefore, on the test page shown in fig. 6, the user can conveniently configure different request parameters of the system under test, form different request parameter cases of the system under test, and initiate interface tests and functional tests on the system under test.
Corresponding to the above flow implementation, the embodiment of the present application further provides an implementation apparatus for an interface test and a function test applied to a terminal, and an implementation apparatus for an interface test and a function test applied to a test server. Both of these means can be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, the device in the logical sense is formed by reading a corresponding computer program instruction into a memory for running through a Central Processing Unit (CPU) of a terminal or a test server. In terms of hardware, in addition to the CPU, the memory, and the nonvolatile memory shown in fig. 7, a terminal where the device for implementing the interface test and the function test is located generally includes other hardware such as a chip for transmitting and receiving a wireless signal, and a server where the device for implementing the interface test and the function test is located generally includes other hardware such as a board for implementing a network communication function.
Fig. 8 shows an implementation apparatus for interface testing and function testing, which is applied to a terminal and includes an interface type and parameter sending unit, a request parameter receiving and displaying unit, and a request parameter executing unit, where: the interface type and parameter sending unit is used for initiating a test page generation request to the test server according to an interface type specified by a user and interface parameters required to be provided by calling the interface type; the request parameter receiving and displaying unit is used for receiving the tested system request parameters generated by the test server according to the received interface types and interface parameters and displaying the tested system request parameters on a test page; the request parameter execution unit is used for executing the interface test and/or the function test of the system to be tested by adopting the request parameters of the system to be tested on the current test page according to the execution instruction of the user.
In one example, the interface parameters include: request objects and their attributes; the device further comprises: the preset information sending unit is used for sending the preset information determined by the user to the test server according to the indication of the preset information for calling the object attribute provided by the test server; the calling object is generated by the test server according to the request object and the attribute thereof; the preset information comprises attribute default values for the test server to use to generate the request parameters of the system to be tested.
In the above example, the preset information may further include whether the attribute belongs to a dynamically changing attribute; the apparatus may further include a dynamic change instruction transmitting unit and a dynamic change code receiving unit, wherein: the dynamic change instruction sending unit is used for sending an instruction of a user for updating a dynamic change attribute value and a tested system request parameter displayed on a current test page to the test server; the dynamic change code receiving unit is used for receiving the tested system request parameters with the updated dynamic change attribute values returned by the test server and refreshing the tested system request parameters displayed on the test page.
Optionally, the interface parameters include: an interface name and an interface request address; the apparatus further includes a parameter modification transmitting unit and a parameter modification code receiving unit, wherein: the parameter modification sending unit is used for receiving the modification of the interface name and/or the interface request address by a user and sending the modified interface name and/or the modified interface request address to the test server; and the parameter modification code receiving unit is used for receiving the tested system request parameters generated by the test server according to the modified interface name and/or the modified interface request address and refreshing the tested system request parameters displayed on the test page.
In one implementation manner, the apparatus further includes a code modification unit, configured to receive a modification operation of a user on a requested parameter of the system under test on the test page, and refresh the display according to the modification operation of the user.
In the above implementation manner, the apparatus may further include a time and random number providing unit, configured to generate a latest system time according to an instruction for generating the latest time by the user, and display the latest system time on a test page for use when the user modifies the request parameter of the system under test; and/or generating a random number according to an instruction of generating the random number by the user and displaying the random number on a test page for the user to use when modifying the request parameter of the tested system.
Optionally, the apparatus further includes a test result receiving and displaying unit, configured to receive the test result from the system under test, and display the test result on a test page.
Optionally, the request parameters and the test results of the system under test are displayed on a test page after json formatting.
Fig. 9 is a diagram illustrating an implementation apparatus for interface testing and function testing, which is applied to a test server and includes an interface type and parameter receiving unit and a request parameter generating unit, where: the interface type and parameter receiving unit is used for receiving a test page generation request of the terminal, wherein the test page generation request comprises an interface type specified by a user and interface parameters required to be provided by calling the interface type; the request parameter generating unit is used for generating a request parameter of the system to be tested according to the interface type and the interface parameter and sending the request parameter to the terminal; and the tested system request parameter is used for carrying out interface test and/or function test of the tested system.
In one example, the interface parameters include: request objects and their attributes; the apparatus further includes an attribute preset information requesting unit and an attribute preset information receiving unit, wherein: the attribute preset information request unit is used for generating a calling object according to the request object and the attribute thereof in the interface parameter and indicating the terminal to provide the preset information of the attribute of the calling object; the preset information comprises attribute default values; the attribute preset information receiving unit is used for receiving the preset information determined by a user from a terminal; the tested system request parameter generating unit is specifically configured to: and generating a request parameter of the system to be tested according to the interface type, the interface parameter and the default value of the calling object attribute, and sending the request parameter to the terminal.
In the above example, the preset information may further include: whether the attribute belongs to a dynamically changing attribute; the apparatus may further include a dynamic change instruction receiving unit and a dynamic change code transmitting unit, wherein: the dynamic change instruction receiving unit is used for receiving an instruction of a user for updating a dynamic change attribute value and a request parameter of a tested system from a terminal; the dynamic change code sending unit is used for analyzing the value of the dynamic change attribute of the calling object from the received request parameter of the system to be tested, updating the value and returning the request parameter of the system to be tested with the updated value of the dynamic change attribute to the terminal.
Optionally, the interface parameters include: an interface name and an interface request address; the apparatus further includes a parameter modification receiving unit and a parameter modification code transmitting unit, wherein: the parameter modification receiving unit is used for receiving the interface name and/or the interface request address modified by the user from the terminal; and the parameter modification code sending unit is used for generating a request parameter of the system to be tested according to the modified interface name and/or the interface request address and sending the request parameter to the terminal.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

Claims (22)

1. An implementation method for interface test and function test is applied to a terminal, and is characterized by comprising the following steps:
initiating a test page generation request to a test server according to an interface type specified by a user and interface parameters required to be provided by calling the interface type; the interface parameters comprise a request object and attributes thereof;
receiving an indication that a test server provides preset information for calling object attributes, and sending the preset information determined by a user to the test server; the calling object is generated by the test server according to the request object and the attribute thereof; the preset information comprises attribute default values;
receiving a tested system request parameter generated by the test server according to the received interface type, interface parameter and default value of the calling object attribute, and displaying the tested system request parameter on a test page;
and executing the interface test and/or the function test of the system to be tested by adopting the request parameters of the system to be tested on the current test page according to the execution instruction of the user.
2. The method of claim 1, wherein the preset information further comprises: whether the attribute belongs to a dynamically changing attribute;
the method further comprises the following steps:
sending an instruction of a user for updating the dynamic change attribute value and a tested system request parameter displayed on a current test page to a test server;
and receiving the tested system request parameters with the updated dynamic change attribute values returned by the test server, and refreshing the tested system request parameters displayed on the test page.
3. The method of claim 1, wherein the interface parameters comprise: an interface name and an interface request address;
the method further comprises the following steps:
receiving the modification of the interface name and/or the interface request address by a user, and sending the modified interface name and/or interface request address to a test server;
and receiving the tested system request parameters generated by the test server according to the modified interface name and/or interface request address, and refreshing the tested system request parameters displayed on the test page.
4. The method of claim 1, further comprising: and receiving the modification operation of the user on the request parameters of the tested system on the test page, and refreshing and displaying according to the modification operation of the user.
5. The method of claim 4, further comprising: generating the latest system time according to the instruction of generating the latest time by the user and displaying the latest system time on a test page for the user to use when modifying the request parameters of the tested system; and/or
And generating a random number according to an instruction of generating the random number by the user, and displaying the random number on a test page for the user to use when modifying the request parameter of the tested system.
6. The method of claim 1, further comprising: and receiving a test result from the tested system and displaying the test result on a test page.
7. The method of claim 6, wherein the system under test requests parameters and test results are displayed on a test page after json formatting of Java script object markup.
8. The method according to claim 1, wherein the interface type comprises a Remoting interface, a web services WS interface, and/or a hypertext transfer protocol HTTP interface;
the interface parameters of the HTTP interface comprise: request mode, interface name, interface request address, and request object and its attribute;
the interface parameters of the Remoting interface and the WS interface include: interface name, interface request address, request object and its attributes, response object, and referenced Java archive Jar package.
9. An implementation method for interface test and function test is applied to a test server, and is characterized by comprising the following steps:
receiving a test page generation request of a terminal, wherein the test page generation request comprises an interface type specified by a user and interface parameters required to be provided by calling the interface type; the interface parameters comprise a request object and attributes thereof;
generating a calling object according to the request object and the attribute thereof in the interface parameter, and indicating the terminal to provide preset information of the attribute of the calling object; the preset information comprises attribute default values;
receiving the preset information determined by the user from the terminal;
generating a request parameter of the system to be tested according to the interface type, the interface parameter and the default value of the calling object attribute, and sending the request parameter to the terminal; and the tested system request parameter is used for carrying out interface test and/or function test of the tested system.
10. The method of claim 9, wherein the preset information further comprises: whether the attribute belongs to a dynamically changing attribute;
the method further comprises the following steps:
receiving a command of a user for updating a dynamic change attribute value and a request parameter of a tested system from a terminal;
analyzing the value of the dynamic change attribute of the calling object from the received request parameter of the system to be tested, updating the value, and returning the request parameter of the system to be tested with the updated dynamic change attribute value to the terminal.
11. The method of claim 9, wherein the interface parameters comprise: an interface name and an interface request address;
the method further comprises the following steps:
receiving the interface name and/or the interface request address modified by the user from the terminal;
and generating a request parameter of the system to be tested according to the modified interface name and/or the interface request address, and sending the request parameter to the terminal.
12. The method according to claim 9, wherein the interface type comprises a Remoting interface, a web services WS interface, and/or a hypertext transfer protocol HTTP interface;
the interface parameters of the HTTP interface comprise: request mode, interface name, interface request address, and request object and its attribute;
the interface parameters of the Remoting interface and the WS interface include: interface name, interface request address, request object and its attributes, response object, and referenced Java archive Jar package.
13. The utility model provides an interface test and functional test's realization device, uses on the terminal which characterized in that includes:
the interface type and parameter sending unit is used for initiating a test page generation request to the test server according to an interface type specified by a user and interface parameters required to be provided by calling the interface type; the interface parameters comprise a request object and attributes thereof;
the preset information sending unit is used for receiving an indication that the test server provides preset information for calling the object attribute and sending the preset information determined by the user to the test server; the calling object is generated by the test server according to the request object and the attribute thereof; the preset information comprises attribute default values;
the request parameter receiving and displaying unit is used for receiving the tested system request parameters generated by the test server according to the received interface types, the interface parameters and the default values of the calling object attributes and displaying the tested system request parameters on a test page;
and the request parameter execution unit is used for executing the interface test and/or the function test of the system to be tested by adopting the request parameters of the system to be tested on the current test page according to the execution instruction of the user.
14. The apparatus of claim 13, wherein the preset information further comprises: whether the attribute belongs to a dynamically changing attribute;
the device further comprises:
the dynamic change instruction sending unit is used for sending an instruction of updating the dynamic change attribute value of the user and a request parameter of the tested system displayed on the current test page to the test server;
and the dynamic change code receiving unit is used for receiving the tested system request parameters with the updated dynamic change attribute values returned by the test server and refreshing the tested system request parameters displayed on the test page.
15. The apparatus of claim 13, wherein the interface parameters comprise: an interface name and an interface request address;
the device further comprises:
the parameter modification sending unit is used for receiving the modification of the interface name and/or the interface request address by a user and sending the modified interface name and/or the modified interface request address to the test server;
and the parameter modification code receiving unit is used for receiving the tested system request parameters generated by the test server according to the modified interface name and/or the modified interface request address and refreshing the tested system request parameters displayed on the test page.
16. The apparatus of claim 13, further comprising: and the code modification unit is used for receiving the modification operation of the user on the request parameters of the tested system on the test page and refreshing and displaying according to the modification operation of the user.
17. The apparatus of claim 16, further comprising: the time and random number providing unit is used for generating the latest system time according to the instruction of generating the latest time by the user and displaying the latest system time on a test page for the user to use when modifying the request parameters of the tested system; and/or
And generating a random number according to an instruction of generating the random number by the user, and displaying the random number on a test page for the user to use when modifying the request parameter of the tested system.
18. The apparatus of claim 13, further comprising: and the test result receiving and displaying unit is used for receiving the test result from the tested system and displaying the test result on the test page.
19. The apparatus of claim 18, wherein the system under test requests parameters and test results are displayed on a test page after json formatting of Java script object markup.
20. The utility model provides an interface test and functional test's realization device, uses on test server, its characterized in that includes:
the device comprises an interface type and parameter receiving unit, a test page generation unit and a parameter generating unit, wherein the interface type and parameter receiving unit is used for receiving a test page generation request of a terminal, and the test page generation request comprises an interface type specified by a user and interface parameters required to be provided by calling the interface type; the interface parameters comprise a request object and attributes thereof;
an attribute preset information request unit, configured to generate a call object according to the request object and the attribute thereof in the interface parameter, and instruct the terminal to provide preset information of the attribute of the call object; the preset information comprises attribute default values;
an attribute preset information receiving unit for receiving the preset information determined by the user from the terminal;
the request parameter generating unit is used for generating a request parameter of the system to be tested according to the interface type, the interface parameter and the default value of the calling object attribute and sending the request parameter to the terminal; and the tested system request parameter is used for carrying out interface test and/or function test of the tested system.
21. The apparatus of claim 20, wherein the preset information further comprises: whether the attribute belongs to a dynamically changing attribute;
the device further comprises:
the dynamic change instruction receiving unit is used for receiving an instruction of a user for updating a dynamic change attribute value and a request parameter of a tested system from a terminal;
and the dynamic change code sending unit is used for analyzing the value of the dynamic change attribute of the calling object from the received request parameter of the system to be tested, updating the value and returning the request parameter of the system to be tested with the updated value of the dynamic change attribute to the terminal.
22. The apparatus of claim 20, wherein the interface parameters comprise: an interface name and an interface request address;
the device further comprises:
the parameter modification receiving unit is used for receiving the interface name and/or the interface request address modified by the user from the terminal;
and the parameter modification code sending unit is used for generating a request parameter of the system to be tested according to the modified interface name and/or the interface request address and sending the request parameter to the terminal.
CN201510921192.4A 2015-12-11 2015-12-11 Method and device for realizing interface test and function test Active CN106874174B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510921192.4A CN106874174B (en) 2015-12-11 2015-12-11 Method and device for realizing interface test and function test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510921192.4A CN106874174B (en) 2015-12-11 2015-12-11 Method and device for realizing interface test and function test

Publications (2)

Publication Number Publication Date
CN106874174A CN106874174A (en) 2017-06-20
CN106874174B true CN106874174B (en) 2020-08-21

Family

ID=59177046

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510921192.4A Active CN106874174B (en) 2015-12-11 2015-12-11 Method and device for realizing interface test and function test

Country Status (1)

Country Link
CN (1) CN106874174B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107592238B (en) * 2017-08-07 2021-05-28 千寻位置网络有限公司 Automatic test method and system of interface, service terminal and memory
CN107729228A (en) * 2017-08-24 2018-02-23 北京网众共创科技有限公司 Interface test method, device, storage medium and processor
CN107843867A (en) * 2017-09-19 2018-03-27 珠海格力电器股份有限公司 Obtain the method and device of check and correction parameter
CN108446225A (en) * 2018-03-06 2018-08-24 平安科技(深圳)有限公司 Creating device, method and the computer readable storage medium of analog interface
CN110401576B (en) * 2018-04-24 2021-03-09 北京嘀嘀无限科技发展有限公司 Network interaction testing method and device
CN108595339A (en) * 2018-05-09 2018-09-28 成都致云科技有限公司 Automated testing method, apparatus and system
CN109151860B (en) * 2018-07-27 2021-09-07 深圳市极致汇仪科技有限公司 Test configuration method and system of wireless chip
CN109743225B (en) * 2018-12-27 2021-09-28 深圳市富创优越科技有限公司 Data testing method and device, storage medium and computer equipment
CN111427774A (en) * 2020-03-09 2020-07-17 深圳开源互联网安全技术有限公司 Request parameter modification method and system for application program test case

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101576843A (en) * 2008-05-07 2009-11-11 阿里巴巴集团控股有限公司 Method and device for testing application program interface
CN102694701B (en) * 2012-06-13 2015-12-02 青岛海信传媒网络技术有限公司 Message based method of testing and system
CN104615534B (en) * 2015-01-28 2017-08-01 广州酷狗计算机科技有限公司 interface test method and device
CN105099811B (en) * 2015-06-03 2019-01-22 北京金山安全软件有限公司 A kind of interface test method and device

Also Published As

Publication number Publication date
CN106874174A (en) 2017-06-20

Similar Documents

Publication Publication Date Title
CN106874174B (en) Method and device for realizing interface test and function test
US10628134B2 (en) Generic-flat structure rest API editor
CN108156022B (en) Service calling method and device and electronic equipment
CN105335132B (en) Method, device and system for customizing application program function
WO2018045750A1 (en) Method, system, server and user terminal for displaying comment data of user
JP6404816B2 (en) Method and apparatus for responding to web page access request
CN109359237B (en) Method and equipment for searching hosted program
CN106648556B (en) Method and device for front-end and back-end integrated development test
WO2021184725A1 (en) User interface test method and apparatus, storage medium, and computer device
JP6016808B2 (en) Method and server system for implementing web access
US9648078B2 (en) Identifying a browser for rendering an electronic document
CN104423961A (en) Method and system for generating testing script
CN109710832B (en) Method and equipment for searching hosted program
US9501298B2 (en) Remotely executing operations of an application using a schema that provides for executable scripts in a nodal hierarchy
US20210224103A1 (en) Method and apparatus for generating information
CN106095886B (en) Data processing method and device
TW201734856A (en) Method and device of page display does not need to search required information on the page to bring convenience for the user
Park et al. Self-adaptive middleware framework for internet of things
CN106656940B (en) Method and apparatus for processing service access requests
CN113448578A (en) Page data processing method, processing system, electronic device and readable storage medium
CN109977317B (en) Data query method and device
CN109086147B (en) Service interface calling method and device of application program and storage medium
US11538046B2 (en) Page data acquisition method, apparatus, server, electronic device and computer readable medium
CN112241499A (en) Native rendering method and device based on information flow
CN107943465B (en) Method and device for generating HTML (Hypertext markup language) form

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200923

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Advanced innovation technology Co., Ltd

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Ltd.

Effective date of registration: 20200923

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Advanced innovation technology Co., Ltd