CN112363912A - Method for testing comprehensive automatic interface - Google Patents
Method for testing comprehensive automatic interface Download PDFInfo
- Publication number
- CN112363912A CN112363912A CN202011100819.7A CN202011100819A CN112363912A CN 112363912 A CN112363912 A CN 112363912A CN 202011100819 A CN202011100819 A CN 202011100819A CN 112363912 A CN112363912 A CN 112363912A
- Authority
- CN
- China
- Prior art keywords
- interface
- test
- testing
- framework
- background
- 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
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 116
- 238000000034 method Methods 0.000 title claims abstract description 35
- 238000011056 performance test Methods 0.000 claims abstract description 15
- 230000000007 visual effect Effects 0.000 claims abstract description 13
- 238000011076 safety test Methods 0.000 claims abstract description 12
- 230000000712 assembly Effects 0.000 claims abstract description 7
- 238000000429 assembly Methods 0.000 claims abstract description 7
- 238000013515 script Methods 0.000 claims description 19
- 230000006870 function Effects 0.000 claims description 12
- 241000508269 Psidium Species 0.000 claims description 8
- 230000003993 interaction Effects 0.000 claims description 7
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 230000002452 interceptive effect Effects 0.000 claims description 3
- 238000010998 test method Methods 0.000 claims 1
- 238000012956 testing procedure Methods 0.000 claims 1
- 230000008569 process Effects 0.000 abstract description 6
- 238000007405 data analysis Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000004806 packaging method and process Methods 0.000 description 3
- 230000007547 defect Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011990 functional testing Methods 0.000 description 1
- 238000002347 injection Methods 0.000 description 1
- 239000007924 injection Substances 0.000 description 1
- 238000006116 polymerization reaction Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a method for fully automating interface test, which relates to the technical field of interface test; the visual interface of an Angular JS front-end frame is utilized to carry out interface information, configuration of related parameter information and selection of interface test types, the Node service and the backstage are interacted according to the configuration and the selected interface test types, the backstage utilizes corresponding assemblies to build the test frame respectively to carry out interface function test, interface safety test and interface performance test, through a unified visual interface, after the input interface information and the related configuration are obtained, the function test, the safety test and the performance test of the interface can be automatically completed, the test process is simple to operate, a large amount of code operation is not required, the operation of special staff is not required, the interface test efficiency is greatly improved, meanwhile, an interface test tool does not need to be repeatedly installed, excessive resources are not occupied, and the requirements of quick and comprehensive test of the interface are met.
Description
Technical Field
The invention discloses a method for testing an interface, relates to the technical field of interface testing, and particularly relates to a method for comprehensively and automatically testing the interface.
Background
The traditional software development mode is not divided into a front end and a back end, the existing development mode is normalized in order to be compatible with more types of front ends, the front end and the back end are logically separated, and the front end and the back end are mutually called through interfaces to carry out data interaction. The interface test is used as a part of software quality, the correctness and the stability of the system can be more intuitively and efficiently tested, and because the interface test is closer to the implementation of a bottom layer, the defect detection of some high-complexity platforms is more effective, and the cost for repairing the defects is lower. From simple functional testing to complex security and performance testing, the demand for interface testing in the field of computer software is increasing. Although some interface testing tools exist in the market at present, testing items are single, and only one of functions, performance and safety is usually supported, and a plurality of tools need to be installed when a tester conducts interface testing, so that not only is resources occupied, but also the learning cost is high, and the requirement of rapid and comprehensive testing of interfaces cannot be met.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a method for testing a comprehensive automatic interface, which has the characteristics of strong universality, simple and convenient implementation and the like and has wide application prospect.
The specific scheme provided by the invention is as follows:
a method for testing a comprehensive automatic interface utilizes a visual interface of an Angular JS front-end framework to configure interface information and related parameter information and select an interface testing type,
and interacting with the background through the Node service according to the configuration and the selected interface test type, and respectively utilizing the corresponding assemblies to build a test framework by the background to carry out interface function test, interface safety test and interface performance test.
Preferably, in the method, the background utilizes an Ant component to perform dependency management and compilation on test data, utilizes Gson to perform data analysis and conversion, and utilizes Logback to manage logs.
Preferably, in the method, the Ant component uses Jsoup as a network interface calling frame for interface function test, and the TestNG component is used for managing an interface test script and a test process.
Preferably, in the method, the Ant component uses the Guava IO as a network interface calling framework for interface security testing and interface performance testing, and the TestNG component is used for managing an interface testing script and a testing process.
Preferably, in the method, Files provided by Guava are used for generating the interface security test script, and the interface security test script is called by AppsanCMD to execute the scanning task and generate the scanning report.
Preferably, in the method, Files provided by Guava are used for generating the interface performance test script, and a Jmeter interface is called to execute the interface performance test script.
A system for testing a fully automatic interface comprises a front-end module, an interactive module and a back-end module,
the front-end module utilizes a visual interface of the Angular JS front-end framework to configure interface information and related parameter information and select an interface test type,
the interaction module interacts with the background through the Node service according to the configuration and the selected interface test type, and the back-end module respectively utilizes the corresponding assemblies to build a test framework through the background to carry out interface function test, interface safety test and interface performance test.
An apparatus for fully automated interface testing, comprising: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor is configured to invoke the machine readable program to perform the method for full automation interface testing.
The invention has the advantages that:
the invention provides a method for testing a comprehensive automatic interface, which can automatically complete the function test, the safety test and the performance test of the interface after acquiring input interface information and relevant configuration through a unified visual interface, has simple operation in the testing process, does not need to carry out a large amount of code operation, does not need to be operated by special staff, greatly improves the interface testing efficiency, does not need to repeatedly install an interface testing tool, does not occupy excessive resources, and meets the requirements of quick and comprehensive test of the interface.
Drawings
FIG. 1 is a schematic view of a front end frame of the present invention;
FIG. 2 is a block diagram of a functional test framework for an interface according to the present invention;
FIG. 3 is a block diagram of a security test framework for an interface according to the present invention;
FIG. 4 is a block diagram of a framework for testing the performance of an interface according to the present invention;
FIG. 5 is a flow chart illustrating the steps performed by the present invention.
Detailed Description
The present invention is further described below in conjunction with the following figures and specific examples so that those skilled in the art may better understand the present invention and practice it, but the examples are not intended to limit the present invention.
The invention provides a method for testing a comprehensive automatic interface, which utilizes a visual interface of an Angular JS front-end framework to configure interface information and related parameter information and select an interface testing type,
and interacting with the background through the Node service according to the configuration and the selected interface test type, and respectively utilizing the corresponding assemblies to build a test framework by the background to carry out interface function test, interface safety test and interface performance test.
By providing a uniform visual interface, the method can support interface types of various protocols and simultaneously support the function, safety and performance test of the interface, does not need to install a plurality of tools for each person, and saves resources; unified input and test report output are provided, so that the test has more specialty and consistency; the visual interface is simple and easy to use, operation is simple, learning is not needed, the visual interface can be used by the first hand, testing cost is reduced, and testing efficiency is improved.
In some embodiments of the present invention, referring to fig. 1, it is shown that an AngularJS front-end framework is adopted for developing a front-end visual interface, MVW (Model-View-Whatever), modularization, semantic tags, dependency injection, and other means are applied, HTML is extended through an instruction, and data is bound to HTML through an expression; performing webpage layout by using the tags and CSS styles in the HTML, for example, embedding another report display page in the current HTML document through an inline frame, and realizing switching display among different test reports; developing page logic through JavaScript, such as switching tags, acquiring text content, acquiring element corresponding content, key value contra-rotating json array, calling a service interface and the like, adopting an Express Web application framework for node.js to carry out interaction of a front background through Node service, providing a plurality of convenient modules for a node.js platform, and defining package.json according to the required modules, such as completing the conversion of data streams through Node-xlsx, thereby realizing the purpose of exporting the data streams transmitted by a front page out of an Excel form and the like; after the front-end page calls the Node service, the Excel file is exported, and the test content of the response type is carried out through triggering bat/. sh (depending on the system environment).
In other embodiments of the present invention, a technical framework of a background interface testing part is specifically introduced, wherein a testing framework of jsup + TestNG is adopted to perform an interface function test, a DataProvide component is used to implement parameterization of test data, and Apache POI component is used to implement reading of the test data; jsoup is selected as a network interface calling frame, and the method is lighter than Httpclient and faster to Document analysis of Response; managing a test script and a test driver by a TestNG test framework; the report component generates a report in an HTML format, and is easy to read; ant performs dependence management, packaging and compiling; the Gson is used for data analysis, converting Java objects into Json character strings and converting the Json character strings into tool classes of the objects; the Assert is used for setting the check point, and the check point is independently packaged, so that the setting of the check point is greatly facilitated; logback clearly records the use case execution log to facilitate problem location, see FIG. 2.
When the interface safety test is carried out on the background, a testNG test framework is adopted, a DataProvide component is used for realizing parameterization of test data, and the test data is read through an Apache POI component; files provided by Google Guava are selected to generate a safety test script; selecting a TestNG test framework to manage a test script and a test driver; calling a security test script to execute a scanning task and generate a scanning report through the Appsan CMD; ant performs dependence management, packaging and compiling; the Gson is used for data analysis, converting Java objects into Json character strings and converting the Json character strings into tool classes of the objects; the Logback clearly records the use case execution log to facilitate problem location, and refer to fig. 3.
And when the interface performance is tested in the background, a test framework of TestNG is adopted, and development and design are carried out by relying on a powerful Java library. Data driving design, namely parameterizing test data by using a DataProvide component and reading the test data by using an Apache POI component; files provided by Google Guava are selected to generate a performance test script; managing a test script and a test driver by a TestNG test framework; calling a Jmeter interface to execute a test script; the XSL style file formats and outputs an HTML polymerization report result; ant performs dependence management, packaging and compiling; the Gson is used for data analysis, converting Java objects into Json character strings and converting the Json character strings into tool classes of the objects; the Logback clearly records the use case execution log to facilitate problem location, and reference is made to fig. 4.
Meanwhile, the invention also provides a system for testing the fully automatic interface, which comprises a front-end module, an interactive module and a rear-end module,
the front-end module utilizes a visual interface of the Angular JS front-end framework to configure interface information and related parameter information and select an interface test type,
the interaction module interacts with the background through the Node service according to the configuration and the selected interface test type, and the back-end module respectively utilizes the corresponding assemblies to build a test framework through the background to carry out interface function test, interface safety test and interface performance test.
The information interaction, execution process and other contents of each module in the system are based on the same concept as the method embodiment of the present invention, and specific contents can be referred to the description in the method embodiment of the present invention, and are not described herein again.
Meanwhile, the invention provides a device for testing a comprehensive automatic interface, which comprises: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor is configured to invoke the machine readable program to perform the method for full automation interface testing.
The information interaction of the processor in the device, the process of executing the readable code, and the like are based on the same concept as the method embodiment of the present invention, and specific contents may refer to the description in the method embodiment of the present invention, and are not described herein again.
It should be noted that not all steps and modules in the above flows and system structures are necessary, and some steps or modules may be omitted according to actual needs. The execution order of the steps is not fixed and can be adjusted as required. The system structure described in the above embodiments may be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by a plurality of physical entities, or some components in a plurality of independent devices may be implemented together.
The above-mentioned embodiments are merely preferred embodiments for fully illustrating the present invention, and the scope of the present invention is not limited thereto. The equivalent substitution or change made by the technical personnel in the technical field on the basis of the invention is all within the protection scope of the invention. The protection scope of the invention is subject to the claims.
Claims (8)
1. A method for testing a comprehensive automatic interface is characterized in that a visual interface of an Angular JS front-end framework is utilized to configure interface information and related parameter information and select an interface testing type,
and interacting with the background through the Node service according to the configuration and the selected interface test type, and respectively utilizing the corresponding assemblies to build a test framework by the background to carry out interface function test, interface safety test and interface performance test.
2. The method of claim 1, wherein the background uses Ant component to perform dependency management and compilation of test data, Gson to perform data parsing and conversion, and Logback to manage logs.
3. The method of claim 2, wherein the Ant component uses Jsoup as a network interface calling framework for interface function testing, and the TestNG component is used to manage interface test scripts and test procedures.
4. A method according to claim 2 or 3, wherein the Ant component uses Guava IO as a network interface calling framework for interface security testing and interface performance testing, and manages interface testing scripts and testing procedures using the TestNG component.
5. The method of claim 2 or 4, wherein Files provided by Guava are used to generate interface security test scripts, and AppsanCMD calls the interface security test scripts to execute the scan task and generate the scan report.
6. The method according to claim 2 or 4, wherein Files provided by Guava are used to generate the interface performance test script, and a Jmeter interface is called to execute the interface performance test script.
7. A system for testing a comprehensive automatic interface is characterized by comprising a front-end module, an interactive module and a rear-end module,
the front-end module utilizes a visual interface of the Angular JS front-end framework to configure interface information and related parameter information and select an interface test type,
the interaction module interacts with the background through the Node service according to the configuration and the selected interface test type, and the back-end module respectively utilizes the corresponding assemblies to build a test framework through the background to carry out interface function test, interface safety test and interface performance test.
8. A device for testing a fully automated interface, comprising: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor configured to invoke the machine readable program to perform a method for full automation interface testing as recited in any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011100819.7A CN112363912A (en) | 2020-10-15 | 2020-10-15 | Method for testing comprehensive automatic interface |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011100819.7A CN112363912A (en) | 2020-10-15 | 2020-10-15 | Method for testing comprehensive automatic interface |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112363912A true CN112363912A (en) | 2021-02-12 |
Family
ID=74506811
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011100819.7A Pending CN112363912A (en) | 2020-10-15 | 2020-10-15 | Method for testing comprehensive automatic interface |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112363912A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113254914A (en) * | 2021-04-24 | 2021-08-13 | 中电长城网际系统应用广东有限公司 | Front-end and back-end synchronous management method and system based on visual display |
CN114138670A (en) * | 2021-12-10 | 2022-03-04 | 四川启睿克科技有限公司 | Method based on interface automation test and function, performance and safety test fusion |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180173606A1 (en) * | 2016-12-15 | 2018-06-21 | Syntel, Inc. | Hybrid testing automation engine |
CN109902026A (en) * | 2019-03-27 | 2019-06-18 | 北京奇艺世纪科技有限公司 | A kind of processing method and test platform of interface testing information |
CN110287102A (en) * | 2019-05-22 | 2019-09-27 | 深圳壹账通智能科技有限公司 | Core data detection processing method, apparatus, computer equipment and storage medium |
CN111221729A (en) * | 2019-12-31 | 2020-06-02 | 的卢技术有限公司 | Automatic testing method and system with platform service and testing service separated |
-
2020
- 2020-10-15 CN CN202011100819.7A patent/CN112363912A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180173606A1 (en) * | 2016-12-15 | 2018-06-21 | Syntel, Inc. | Hybrid testing automation engine |
CN109902026A (en) * | 2019-03-27 | 2019-06-18 | 北京奇艺世纪科技有限公司 | A kind of processing method and test platform of interface testing information |
CN110287102A (en) * | 2019-05-22 | 2019-09-27 | 深圳壹账通智能科技有限公司 | Core data detection processing method, apparatus, computer equipment and storage medium |
CN111221729A (en) * | 2019-12-31 | 2020-06-02 | 的卢技术有限公司 | Automatic testing method and system with platform service and testing service separated |
Non-Patent Citations (1)
Title |
---|
浙大网新软件产业集团: "【质量管理】"测试就是点点点???"—软件接口测试介绍", 《HTTPS://MP.WEIXIN.QQ.COM/S/KEGZ8JJ0V37PEIZR0SOQZG》, vol. 2017, 10 January 2017 (2017-01-10), pages 2 - 4 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113254914A (en) * | 2021-04-24 | 2021-08-13 | 中电长城网际系统应用广东有限公司 | Front-end and back-end synchronous management method and system based on visual display |
CN114138670A (en) * | 2021-12-10 | 2022-03-04 | 四川启睿克科技有限公司 | Method based on interface automation test and function, performance and safety test fusion |
CN114138670B (en) * | 2021-12-10 | 2024-05-14 | 四川启睿克科技有限公司 | Method based on integration of interface automation test and function, performance and safety test |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109189684B (en) | Python-based automatic interface testing method | |
US10372594B2 (en) | Method and device for retrieving test case based on code coverage | |
CN103150249B (en) | A kind of method and system of automatic test | |
US6941546B2 (en) | Method and apparatus for testing a software component using an abstraction matrix | |
CN101930400B (en) | SDK (Software Development Kit) automatic test system and method | |
CN103049371A (en) | Testing method and testing device of Android application programs | |
CN1908895B (en) | System and method for application program globalization problem verification | |
CN110716870A (en) | Automatic service testing method and device | |
CN112363912A (en) | Method for testing comprehensive automatic interface | |
CN109240700B (en) | Key code positioning method and system | |
Amalfitano et al. | The DynaRIA tool for the comprehension of Ajax web applications by dynamic analysis | |
CN114818565A (en) | Simulation environment management platform, method, equipment and medium based on python | |
CN112817853A (en) | Automatic test method, system and electronic equipment | |
CN113836014A (en) | Interface testing method and device, electronic equipment and storage medium | |
Zhu et al. | A test automation solution on gui functional test | |
CN117370217B (en) | Automatic interface test result generation method based on python | |
Pelivani et al. | An empirical study of user interface testing tools | |
Jian-Ping et al. | Application analysis of automated testing framework based on robot | |
CN116841543A (en) | Development method for dynamically generating cross-platform multi-terminal application based on Flutter | |
CN115514677B (en) | Method and system for server dial testing | |
Li et al. | A framework of model-driven web application testing | |
US20040153871A1 (en) | Automatic analysis of the properties of a system based on runtime logs | |
KR100969877B1 (en) | Test automating system | |
CN109062785B (en) | Interface parameter constraint code positioning method and system | |
CN113485919A (en) | Test method, test device 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 |