CN113377661A - Interface testing method and device, electronic equipment and storage medium - Google Patents

Interface testing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113377661A
CN113377661A CN202110698811.3A CN202110698811A CN113377661A CN 113377661 A CN113377661 A CN 113377661A CN 202110698811 A CN202110698811 A CN 202110698811A CN 113377661 A CN113377661 A CN 113377661A
Authority
CN
China
Prior art keywords
test
interface
interface test
parameters
script
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
CN202110698811.3A
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.)
Shenzhen Pingan Zhihui Enterprise Information Management Co ltd
Original Assignee
Shenzhen Pingan Zhihui Enterprise Information Management 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 Shenzhen Pingan Zhihui Enterprise Information Management Co ltd filed Critical Shenzhen Pingan Zhihui Enterprise Information Management Co ltd
Priority to CN202110698811.3A priority Critical patent/CN113377661A/en
Publication of CN113377661A publication Critical patent/CN113377661A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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 invention relates to the field of testing, and discloses an interface testing method, which comprises the following steps: the method comprises the steps of responding to an interface test request, and creating interface test parameters which comprise function test parameters and environment test parameters; compiling a test case in a preset mind mapping tool according to the functional test parameters and the environmental test parameters to obtain an interface test case; and converting the interface test case into an interface test script, and operating the interface test script to obtain a test result of the interface test case. In addition, the invention also relates to a block chain technology, and the test result can be stored in the block chain. In addition, the invention also provides an interface testing device, electronic equipment and a storage medium. The invention can improve the efficiency of interface test.

Description

Interface testing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of testing, and in particular, to an interface testing method and apparatus, an electronic device, and a computer-readable storage medium.
Background
The interface test is a test for testing interfaces among components of a system, and is mainly used for detecting interaction points between an external system and the system and between subsystems inside the system.
At present, a plurality of mature interface automatic test frameworks and platforms exist in the industry, a web page is provided for testers to input a large amount of interface request information and check points, but along with richer and diversified functions of products, the existing sass product service is adopted, the service flow is relatively complex and changeable, a large amount of interfaces and complex data structures need to be designed in the same development process of inevitable projects, and the interaction with the front end is realized, so that the large amount of complex interface data need to be maintained when the testers write the automatic test scripts, the script writing work of the testers is greatly increased, and the interface test efficiency can be influenced.
Disclosure of Invention
The invention provides an interface testing method, an interface testing device, electronic equipment and a computer readable storage medium, and mainly aims to improve the efficiency of interface testing.
In order to achieve the above object, the present invention provides an interface testing method, including:
responding to an interface test request, and creating interface test parameters, wherein the interface test parameters comprise functional test parameters and environment test parameters;
compiling a test case in a preset mind mapping tool according to the functional test parameters and the environmental test parameters to obtain an interface test case;
and converting the interface test case into an interface test script, and operating the interface test script to obtain a test result of the interface test case.
Optionally, the creating interface test parameters in response to the interface test request includes:
identifying an interface test type of the interface test request;
acquiring a test object of the interface test request according to the interface test type;
and configuring interface test parameters according to the test object.
Optionally, the compiling a test case in a preset mind mapping tool according to the functional test parameters and the environmental test parameters to obtain an interface test case includes:
analyzing a source file of the mind map tool, and acquiring tree nodes of an interface test from the source file through traversal operation;
loading the function test parameters into the tree nodes, and adding environment variable nodes into the tree nodes;
and loading the environment test parameters to the environment variable nodes to generate an interface test case.
Optionally, the loading the functional test parameters into the tree node includes:
acquiring the parameter type and the parameter attribute of the function test parameter;
and constructing a test node of the parameter attribute according to the parameter type, and adding the test node into a tree node.
Optionally, the converting the interface test case into an interface test script includes:
acquiring a node value and a node level of a tree node in the interface test case;
mapping the node value to a script value of an interface test script;
mapping the node hierarchy into an operating logic of an interface test script;
and generating an interface test script of the interface test case according to the script value and the operation logic.
Optionally, the running the interface test script to obtain the test result of the interface test case includes:
acquiring interface test parameters corresponding to the interface test scripts, and calling a test page of interface test according to the interface test parameters;
accessing the interface test script into the test page;
and executing the interface test of the interface test script by using a test instruction based on the test page to obtain a test result of the interface test case.
Optionally, the accessing the interface test script into the test page includes:
acquiring interface test parameters of the test page and a configuration file of the interface test script;
according to the interface test parameters and the configuration file, configuring an access channel of the interface test script by using a preset link instruction;
and executing the access of the interface test script according to the access channel.
In order to solve the above problem, the present invention further provides an interface testing apparatus, including:
the test parameter creating module is used for responding to an interface test request and creating interface test parameters, and the interface test parameters comprise functional test parameters and environment test parameters;
the test case compiling module is used for compiling the test cases in a preset mind map tool according to the functional test parameters and the environment test parameters to obtain interface test cases;
and the case testing module is used for converting the interface testing case into an interface testing script and operating the interface testing script to obtain a testing result of the interface testing case.
In order to solve the above problem, the present invention also provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to implement the interface testing method described above.
In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored, the at least one computer program being executed by a processor in an electronic device to implement the interface testing method described above.
The embodiment of the invention firstly responds to the interface test request, creates the interface test parameters and can determine the test object of the subsequent test case, and secondly, the embodiment of the invention compiles the test case in the preset mind mapping tool according to the interface test parameters to obtain the interface test case, thereby reducing the input of a large amount of interface test data in a test page or a test platform and reducing the work of compiling scripts by a tester, and further improving the efficiency of interface test; furthermore, the embodiment of the invention converts the interface test case into the interface test script, can realize the development code multiplexing of the interface test case, and improves the script compiling efficiency, thereby improving the interface test efficiency.
Drawings
Fig. 1 is a schematic flowchart of an interface testing method according to an embodiment of the present invention;
FIG. 2 is a detailed flowchart illustrating a step of the interface testing method provided in FIG. 1 according to a first embodiment of the present invention;
FIG. 3 is a block diagram of an interface testing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic diagram of an internal structure of an electronic device implementing an interface testing method according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides an interface testing method. The execution subject of the interface testing method includes, but is not limited to, at least one of electronic devices, such as a server and a terminal, which can be configured to execute the method provided by the embodiments of the present application. In other words, the interface testing method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Fig. 1 is a schematic flow chart of an interface testing method according to an embodiment of the present invention. In an embodiment of the present invention, the interface testing method includes:
and S1, responding to the interface test request, and creating interface test parameters, wherein the interface test parameters comprise functional test parameters and environment test parameters.
In the embodiment of the present invention, the interface test request is generated based on different service scenarios, such as a page login interface test request, an order search interface test request, and a data query interface test request, the interface test parameter refers to an object parameter to be tested, and includes a functional test parameter and an environmental test parameter, the functional test parameter refers to test content to be responded to by the interface test, and includes a test attribute, a test field, and the like, the environmental test parameter refers to an operating environment parameter of the interface test, and includes: such as address, IP, and port, etc. For example, for a login interface test request, the interface test parameters include: a user name, a password, a login address, a login port number, and the like.
In one embodiment of the present invention, referring to fig. 2, the creating interface test parameters in response to the interface test request includes:
s20, identifying the interface test type of the interface test request;
s21, acquiring a test object of the interface test request according to the interface test type;
and S22, configuring interface test parameters according to the test object.
In an optional embodiment, the identification of the interface test type may be implemented by a request name of the interface test request, and if the request name of the page login interface test request is a page login test, the interface test type of the page login interface test request is a page login, the test object refers to an interface to be tested, and the interface test parameter configuration is configured based on different test objects, including a functional test parameter and an environmental test parameter.
And S2, compiling the test case in a preset mind map tool according to the functional test parameters and the environmental test parameters to obtain the interface test case.
In the embodiment of the invention, the preset mind mapping tool comprises XMind, the XMind is developed by adopting Java language, has the property of cross-platform operation, and can support plug-ins based on an eclipse RCP system structure, and the plug-ins can extend extension points defined by a system by compiling XML (extensive markup language) manifest files. Furthermore, in the embodiment of the invention, by compiling the test case in the XMind, a large amount of interface test data can be reduced from being input into a test page or a test platform, the work of writing scripts by testers is reduced, and the efficiency of subsequent interface test is improved.
According to one embodiment of the present invention, compiling a test case in a preset mind mapping tool according to the functional test parameters and the environmental test parameters to obtain an interface test case includes: analyzing a source file of the mind map tool, acquiring tree nodes of an interface test from the source file through traversal operation, loading the functional test parameters into the tree nodes, adding environment variable nodes into the tree nodes, loading the environment test parameters into the environment variable nodes, and generating an interface test case.
In an optional embodiment, the parsing of the source file is implemented by using a jar package of the XMind source file core file, and is used for loading parameters of a subsequent interface test, and the query of the tree node is obtained by performing api interface query by using the XMind toolkit to determine parameter location information of the subsequent interface test.
In an optional embodiment, the loading the functional test parameters into the tree node includes: and acquiring the parameter type and the parameter attribute of the function test parameter, constructing a test node of the parameter attribute according to the parameter type, and adding the test node into a tree node. The parameter type refers to a parameter type to be tested and is used for representing characteristics of parameters, such as a text box, a drop-down box, a multiplexing box and the like, and the parameter attribute refers to an interface object to be tested, such as a test name, a test length, a test field and the like.
Further, the constructing the test node of the parameter attribute according to the parameter type includes: and configuring the test logic and the test object of the parameter attribute according to the parameter type, and generating the test node of the parameter attribute according to the test logic and the test object.
Illustratively, the parameter type is a text box, and the test logic for configuring the parameter attribute is: arranging the test sequence according to the priority of the parameter attribute; configuring the test object of the parameter attribute comprises: whether characters need to be filled, the maximum length allowed to be recorded, the maximum length-1 not allowed to be recorded, the maximum length +1 not allowed to be recorded, whether Chinese can be recorded, whether lowercase English can be recorded, whether uppercase English can be recorded, whether special characters in a Chinese state can be recorded, whether special characters in an English state can be recorded and the like.
In an optional embodiment, the adding of the environment variable node is realized by a placeholder algorithm, and is used for adding a corresponding test environment parameter in the tree node to separate data of a generated test case environment from a subsequent test interface environment, so that reusability of an interface test case script is improved.
Further, another embodiment of the present invention further includes: and storing the data in the interface test case into a database in a key-value pair (key-value) form so as to facilitate the query and update of the subsequent interface test case, wherein the key stores the full path of the tree node in the xmnd, and the value is the ID of the tree node in the xmnd in the database.
And S3, converting the interface test case into an interface test script, and operating the interface test script to obtain a test result of the interface test case.
In the embodiment of the present invention, the converting the interface test case into the interface test script includes: and acquiring a node value and a node level of a tree node in the interface test case, mapping the node value to be a script value of an interface test script, mapping the node level to be operation logic of the interface test script, and generating the interface test script of the interface test case according to the script value and the operation logic.
In an optional embodiment, the mapping between the script value and the running logic is compiled through Java language.
Illustratively, the presence interface test case includes: the username: xiaoming and password: the ABC123, acquiring the node value of the interface test case includes: functional test parameters of xiaoming and ABC123, test environment parameters of username and password, and the test sequence of the nodes is that the parameters of xiaoming and ABC123 are tested simultaneously, and Java language is adopted to make the test sequence of the username: xiaoming and password: ABC123, the script values and running logic mapped to the interface test script include: { script engine manager (); scriptennebyname ("js"); scripten ═ username: xiaoming and password: ABC123) javascript engine }.
Further, the running the interface test script to obtain the test result of the interface test case includes: acquiring interface test parameters corresponding to the interface test script, calling a test page of the interface test according to the interface test parameters, accessing the interface test script into the test page, and executing the interface test of the interface test script by using a test instruction based on the test page to obtain a test result of the interface test case.
In an optional implementation, the interface test parameters are obtained through environment test parameters in the interface test script, and the test page refers to a page, such as a web page, on which a function test is required.
In an optional embodiment, the accessing the interface test script into the test page includes: acquiring interface test parameters of the test page and a configuration file of the interface test script, configuring an access channel of the interface test script by using a preset link instruction according to the interface test parameters and the configuration file, and executing the access of the interface test script according to the access channel. Wherein the preset link instruction comprises: href instructions.
Further, the present invention further comprises, after obtaining the test result: and creating a one-key generation preview button and an export button, wherein the one-key generation preview button is used for displaying the test results in a page in a list form, and the export button returns the test results to the user.
Further, in order to ensure privacy and security of the test result, the test result may also be stored in a blockchain node.
The embodiment of the invention firstly responds to the interface test request, creates the interface test parameters and can determine the test object of the subsequent test case, and secondly, the embodiment of the invention compiles the test case in the preset mind mapping tool according to the interface test parameters to obtain the interface test case, thereby reducing the input of a large amount of interface test data in a test page or a test platform and reducing the work of compiling scripts by a tester, and further improving the efficiency of interface test; furthermore, the embodiment of the invention converts the interface test case into the interface test script, can realize the development code multiplexing of the interface test case, and improves the script compiling efficiency, thereby improving the interface test efficiency.
FIG. 3 is a functional block diagram of the interface testing apparatus according to the present invention.
The interface test apparatus 100 of the present invention can be installed in an electronic device. According to the implemented functions, the interface test apparatus may include a test parameter creation module 101, a test case compilation module 102, and a case test module 103. A module according to the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the test parameter creating module 101 is configured to create interface test parameters in response to an interface test request, where the interface test parameters include functional test parameters and environmental test parameters.
In the embodiment of the present invention, the interface test request is generated based on different service scenarios, such as a page login interface test request, an order search interface test request, and a data query interface test request, the interface test parameter refers to an object parameter to be tested, and includes a functional test parameter and an environmental test parameter, the functional test parameter refers to test content to be responded to by the interface test, and includes a test attribute, a test field, and the like, the environmental test parameter refers to an operating environment parameter of the interface test, and includes: such as address, IP, and port, etc. For example, for a login interface test request, the interface test parameters include: a user name, a password, a login address, a login port number, and the like.
In one embodiment of the present invention, when the test parameter creating module 101 creates the interface test parameters in the following manner:
step I, identifying the interface test type of the interface test request;
step II, acquiring a test object of the interface test request according to the interface test type;
and step III, configuring interface test parameters according to the test object.
In an optional embodiment, the identification of the interface test type may be implemented by a request name of the interface test request, and if the request name of the page login interface test request is a page login test, the interface test type of the page login interface test request is a page login, the test object refers to an interface to be tested, and the interface test parameter configuration is configured based on different test objects, including a functional test parameter and an environmental test parameter.
The test case compiling module 102 is configured to compile a test case in a preset mind mapping tool according to the functional test parameters and the environmental test parameters, so as to obtain an interface test case.
In the embodiment of the invention, the preset mind mapping tool comprises XMind, the XMind is developed by adopting Java language, has the property of cross-platform operation, and can support plug-ins based on an eclipse RCP system structure, and the plug-ins can extend extension points defined by a system by compiling XML (extensive markup language) manifest files.
According to one embodiment of the present invention, the test case is compiled in a preset mind mapping tool according to the functional test parameters and the environmental test parameters to obtain an interface test case, and the test case compiling module 102 executes the following steps: analyzing a source file of the mind map tool, acquiring tree nodes of an interface test from the source file through traversal operation, loading the functional test parameters into the tree nodes, adding environment variable nodes into the tree nodes, loading the environment test parameters into the environment variable nodes, and generating an interface test case.
In an optional embodiment, the parsing of the source file is implemented by using a jar package of the XMind source file core file, and is used for loading parameters of a subsequent interface test, and the query of the tree node is obtained by performing api interface query by using the XMind toolkit to determine parameter location information of the subsequent interface test.
In an optional embodiment, the test case compiling module 102 loads the functional test parameters into the tree nodes in the following manner: and acquiring the parameter type and the parameter attribute of the function test parameter, constructing a test node of the parameter attribute according to the parameter type, and adding the test node into a tree node. The parameter type refers to a parameter type to be tested and is used for representing characteristics of parameters, such as a text box, a drop-down box, a multiplexing box and the like, and the parameter attribute refers to an interface object to be tested, such as a test name, a test length, a test field and the like.
Further, the test case compiling module 102 constructs the test node of the parameter attribute by adopting the following method: and configuring the test logic and the test object of the parameter attribute according to the parameter type, and generating the test node of the parameter attribute according to the test logic and the test object.
Illustratively, the parameter type is a text box, and the test logic for configuring the parameter attribute is: arranging the test sequence according to the priority of the parameter attribute; configuring the test object of the parameter attribute comprises: whether characters need to be filled, the maximum length allowed to be recorded, the maximum length-1 not allowed to be recorded, the maximum length +1 not allowed to be recorded, whether Chinese can be recorded, whether lowercase English can be recorded, whether uppercase English can be recorded, whether special characters in a Chinese state can be recorded, whether special characters in an English state can be recorded and the like.
In an optional embodiment, the adding of the environment variable node is realized by a placeholder algorithm, and is used for adding a corresponding test environment parameter in the tree node to separate data of a generated test case environment from a subsequent test interface environment, so that reusability of an interface test case script is improved.
Further, in another embodiment of the present invention, the test case compiling module 102 further includes: and storing the data in the interface test case into a database in a key-value pair (key-value) form so as to facilitate the query and update of the subsequent interface test case, wherein the key stores the full path of the tree node in the xmnd, and the value is the ID of the tree node in the xmnd in the database.
The case testing module 103 is configured to convert the interface test case into an interface test script, and run the interface test script to obtain a test result of the interface test case.
In the embodiment of the present invention, the interface test case is converted into an interface test script, and the case test module 103 is executed in the following manner: and acquiring a node value and a node level of a tree node in the interface test case, mapping the node value to be a script value of an interface test script, mapping the node level to be operation logic of the interface test script, and generating the interface test script of the interface test case according to the script value and the operation logic.
In an optional embodiment, the mapping between the script value and the running logic is compiled through Java language.
Further, the use case testing module 103 runs the interface testing script in the following manner to obtain the testing result of the interface testing use case: acquiring interface test parameters corresponding to the interface test script, calling a test page of the interface test according to the interface test parameters, accessing the interface test script into the test page, and executing the interface test of the interface test script by using a test instruction based on the test page to obtain a test result of the interface test case.
In an optional implementation, the interface test parameters are obtained through environment test parameters in the interface test script, and the test page refers to a page, such as a web page, on which a function test is required.
In an optional embodiment, in the step of accessing the interface test script into the test page, the use case test module 103 executes the following steps: acquiring interface test parameters of the test page and a configuration file of the interface test script, configuring an access channel of the interface test script by using a preset link instruction according to the interface test parameters and the configuration file, and executing the access of the interface test script according to the access channel. Wherein the preset link instruction comprises: href instructions.
Further, after obtaining the test result, the use case testing module 103 is further configured to: and creating a one-key generation preview button and an export button, wherein the one-key generation preview button is used for displaying the test results in a page in a list form, and the export button returns the test results to the user.
Further, in order to ensure privacy and security of the test result, the test result may also be stored in a blockchain node.
The embodiment of the invention firstly responds to the interface test request, creates the interface test parameters and can determine the test object of the subsequent test case, and secondly, the embodiment of the invention compiles the test case in the preset mind mapping tool according to the interface test parameters to obtain the interface test case, thereby reducing the input of a large amount of interface test data in a test page or a test platform and reducing the work of compiling scripts by a tester, and further improving the efficiency of interface test; furthermore, the embodiment of the invention converts the interface test case into the interface test script, can realize the development code multiplexing of the interface test case, and improves the script compiling efficiency, thereby improving the interface test efficiency.
Fig. 4 is a schematic structural diagram of an electronic device implementing the interface testing method according to the present invention.
The electronic device may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as an interface test program, stored in the memory 11 and executable on the processor 10.
In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, and includes one or more Central Processing Units (CPUs), a microprocessor, a digital Processing chip, a graphics processor, a combination of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device by running or executing programs or modules (e.g., executing interface test programs, etc.) stored in the memory 11 and calling data stored in the memory 11.
The memory 11 includes at least one type of readable storage medium including flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in the electronic device and various types of data, such as codes of an interface test program, etc., but also to temporarily store data that has been output or is to be output.
The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
The communication interface 13 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
Fig. 4 shows only an electronic device having components, and those skilled in the art will appreciate that the structure shown in fig. 4 does not constitute a limitation of the electronic device, and may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The interface test program stored in the memory 11 of the electronic device is a combination of a plurality of computer programs, which when executed in the processor 10, can implement:
responding to an interface test request, and creating interface test parameters, wherein the interface test parameters comprise functional test parameters and environment test parameters;
compiling a test case in a preset mind mapping tool according to the functional test parameters and the environmental test parameters to obtain an interface test case;
and converting the interface test case into an interface test script, and operating the interface test script to obtain a test result of the interface test case.
Specifically, the processor 10 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the computer program, which is not described herein again.
Further, the electronic device integrated module/unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a non-volatile computer-readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
responding to an interface test request, and creating interface test parameters, wherein the interface test parameters comprise functional test parameters and environment test parameters;
compiling a test case in a preset mind mapping tool according to the functional test parameters and the environmental test parameters to obtain an interface test case;
and converting the interface test case into an interface test script, and operating the interface test script to obtain a test result of the interface test case.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. An interface testing method, the method comprising:
responding to an interface test request, and creating interface test parameters, wherein the interface test parameters comprise functional test parameters and environment test parameters;
compiling a test case in a preset mind mapping tool according to the functional test parameters and the environmental test parameters to obtain an interface test case;
and converting the interface test case into an interface test script, and operating the interface test script to obtain a test result of the interface test case.
2. The interface test method of claim 1, wherein said creating interface test parameters in response to an interface test request comprises:
identifying an interface test type of the interface test request;
acquiring a test object of the interface test request according to the interface test type;
and configuring interface test parameters according to the test object.
3. The interface test method according to claim 1, wherein said compiling the test case in a predetermined mind mapping tool according to the functional test parameters and the environment test parameters to obtain the interface test case comprises:
analyzing a source file of the mind map tool, and acquiring tree nodes of an interface test from the source file through traversal operation;
loading the function test parameters into the tree nodes, and adding environment variable nodes into the tree nodes;
and loading the environment test parameters to the environment variable nodes to generate an interface test case.
4. The interface testing method of claim 3, wherein said loading the functional test parameters into the tree nodes comprises:
acquiring the parameter type and the parameter attribute of the function test parameter;
and constructing a test node of the parameter attribute according to the parameter type, and adding the test node into a tree node.
5. The interface testing method of claim 1, wherein said converting the interface test cases into interface test scripts comprises:
acquiring a node value and a node level of a tree node in the interface test case;
mapping the node value to a script value of an interface test script;
mapping the node hierarchy into an operating logic of an interface test script;
and generating an interface test script of the interface test case according to the script value and the operation logic.
6. The interface testing method according to any one of claims 1 to 5, wherein the running the interface test script to obtain the test result of the interface test case includes:
acquiring interface test parameters corresponding to the interface test scripts, and calling a test page of interface test according to the interface test parameters;
accessing the interface test script into the test page;
and executing the interface test of the interface test script by using a test instruction based on the test page to obtain a test result of the interface test case.
7. The interface testing method of claim 6, wherein said accessing the interface test script into the test page comprises:
acquiring interface test parameters of the test page and a configuration file of the interface test script;
according to the interface test parameters and the configuration file, configuring an access channel of the interface test script by using a preset link instruction;
and executing the access of the interface test script according to the access channel.
8. An interface testing apparatus, the apparatus comprising:
the test parameter creating module is used for responding to an interface test request and creating interface test parameters, and the interface test parameters comprise functional test parameters and environment test parameters;
the test case compiling module is used for compiling the test cases in a preset mind map tool according to the functional test parameters and the environment test parameters to obtain interface test cases;
and the case testing module is used for converting the interface testing case into an interface testing script and operating the interface testing script to obtain a testing result of the interface testing case.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the interface testing method of any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out an interface testing method according to any one of claims 1 to 7.
CN202110698811.3A 2021-06-23 2021-06-23 Interface testing method and device, electronic equipment and storage medium Pending CN113377661A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110698811.3A CN113377661A (en) 2021-06-23 2021-06-23 Interface testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110698811.3A CN113377661A (en) 2021-06-23 2021-06-23 Interface testing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113377661A true CN113377661A (en) 2021-09-10

Family

ID=77578728

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110698811.3A Pending CN113377661A (en) 2021-06-23 2021-06-23 Interface testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113377661A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114610605A (en) * 2022-02-24 2022-06-10 海南乾唐视联信息技术有限公司 Test method, test device, terminal equipment and storage medium
GB2619324A (en) * 2022-05-31 2023-12-06 The Court Of Edinburgh Napier Univ Software management system
CN117435513A (en) * 2023-12-21 2024-01-23 深圳市智慧城市科技发展集团有限公司 Test case generation method, terminal equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108509339A (en) * 2018-03-22 2018-09-07 京北方信息技术股份有限公司 Method for generating test case, device based on browser and mind map and equipment
CN108595338A (en) * 2018-05-08 2018-09-28 平安普惠企业管理有限公司 Test case write method, device, computer equipment and storage medium
CN109726125A (en) * 2018-12-21 2019-05-07 郑州云海信息技术有限公司 The processing method and processing device of test case in a kind of mind map
CN112559368A (en) * 2020-12-23 2021-03-26 马上消费金融股份有限公司 Interface automation test method and its use case generation method, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108509339A (en) * 2018-03-22 2018-09-07 京北方信息技术股份有限公司 Method for generating test case, device based on browser and mind map and equipment
CN108595338A (en) * 2018-05-08 2018-09-28 平安普惠企业管理有限公司 Test case write method, device, computer equipment and storage medium
CN109726125A (en) * 2018-12-21 2019-05-07 郑州云海信息技术有限公司 The processing method and processing device of test case in a kind of mind map
CN112559368A (en) * 2020-12-23 2021-03-26 马上消费金融股份有限公司 Interface automation test method and its use case generation method, equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114610605A (en) * 2022-02-24 2022-06-10 海南乾唐视联信息技术有限公司 Test method, test device, terminal equipment and storage medium
GB2619324A (en) * 2022-05-31 2023-12-06 The Court Of Edinburgh Napier Univ Software management system
CN117435513A (en) * 2023-12-21 2024-01-23 深圳市智慧城市科技发展集团有限公司 Test case generation method, terminal equipment and computer readable storage medium
CN117435513B (en) * 2023-12-21 2024-04-02 深圳市智慧城市科技发展集团有限公司 Test case generation method, terminal equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN113377661A (en) Interface testing method and device, electronic equipment and storage medium
CN112506779A (en) Software interface testing method and device, electronic equipment and storage medium
CN114398194A (en) Data collection method and device, electronic equipment and readable storage medium
CN113238929A (en) Code testing method and device based on Mock data, electronic equipment and storage medium
CN112527664A (en) Method and device for generating test case, electronic equipment and storage medium
CN115599386A (en) Code generation method, device, equipment and storage medium
CN112486490B (en) Front-end code packaging method and device, electronic equipment and storage medium
CN113032275A (en) Method and device for testing field, electronic equipment and storage medium
CN112579475A (en) Code testing method, device, equipment and readable storage medium
CN113468175A (en) Data compression method and device, electronic equipment and storage medium
CN113434542A (en) Data relation identification method and device, electronic equipment and storage medium
CN112559337A (en) Code coverage rate testing method and device, electronic equipment and storage medium
CN113297180A (en) Data migration method and device, electronic equipment and storage medium
CN112631903A (en) Task testing method and device, electronic equipment and storage medium
CN115033489A (en) Code resource detection method and device, electronic equipment and storage medium
CN114398282A (en) Test script generation method, device, equipment and storage medium
CN113176993A (en) Case testing method and device, electronic equipment and storage medium
CN115470152A (en) Test code generation method, test code generation device, and storage medium
CN114461531A (en) Platform adaptability test method, device, equipment and storage medium of test case
CN114356379A (en) Backup-based service upgrading method, device, equipment and storage medium
CN113051171A (en) Interface test method, device, equipment and storage medium
CN111400191A (en) Webpage security testing method and device and computer readable storage medium
CN112527443A (en) Prompt box display method and device, electronic equipment and computer readable storage medium
CN113032256A (en) Automatic test method, device, computer system and readable storage medium
CN112667244A (en) Data verification method and device, electronic equipment and computer readable 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210910