CN110287113A - Automation interface test method - Google Patents

Automation interface test method Download PDF

Info

Publication number
CN110287113A
CN110287113A CN201910555175.1A CN201910555175A CN110287113A CN 110287113 A CN110287113 A CN 110287113A CN 201910555175 A CN201910555175 A CN 201910555175A CN 110287113 A CN110287113 A CN 110287113A
Authority
CN
China
Prior art keywords
interface
test
parameter
test method
test case
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910555175.1A
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.)
Sichuan Changhong Electric Co Ltd
Original Assignee
Sichuan Changhong Electric 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 Sichuan Changhong Electric Co Ltd filed Critical Sichuan Changhong Electric Co Ltd
Priority to CN201910555175.1A priority Critical patent/CN110287113A/en
Publication of CN110287113A publication Critical patent/CN110287113A/en
Pending legal-status Critical Current

Links

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
    • 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/3688Test 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 present invention relates to interface testing technology, solve the problems, such as that existing interface test method testing efficiency is not high.Technical solution is summarized are as follows: introducting interface configuration file obtains corresponding interface message according to interface configuration file;At least one test order is configured for each parameter field in interface requests parameter list;According to preset test method, it is respectively combined according to all test orders of all parameter fields and generates each corresponding test case;The each corresponding test case generated is executed, and judges to obtain the implementing result of corresponding test case according to preset expected result in the test order for actually returning the result and accordingly generating each test case for executing each test case.Beneficial effect is: tester need to only carry out the shirtsleeve operations such as introducting interface configuration file, the test order for configuring parameters field in interface test process of the present invention, and the degree of automation of interface testing is higher, improves interface testing efficiency.

Description

Automation interface test method
Technical field
The present invention relates to interface testing technologies, in particular to automation interface measuring technology.
Background technique
Traditional interface testing needs tester to be manually entered related test parameters, when interface quantity or single face are joined When number is excessive, repeated authentication takes considerable time energy and effect as a result, the test process for changing parameter repeatedly becomes abnormal cumbersome Rate is not high.Current interface test method can replace the design parameter in test case automatically and carry out a degree of automation Test, but cannot generate test case automatically according to interface testing rule, and the work of this part is there is still a need for being accomplished manually, interface Testing efficiency is not high.
Summary of the invention
The present invention is to solve the problems, such as that existing interface test method testing efficiency is not high, provides a kind of automation interface test Method.
To solve the above problems, the technical solution adopted by the present invention is that:
Automation interface test method, comprising the following steps:
Step 1: introducting interface configuration file, obtains corresponding interface message, the interface letter according to interface configuration file Breath includes at least interface name, interface calls the path URL, interface requests method, interface requests parameter list, interface requests parameter Illustrate and interface return parameters illustrate, then to user feedback interface requests parameter declaration and interface return parameters explanation;
Step 2: user is in interface requests parameter list according to interface requests parameter declaration and interface return parameters explanation Each parameter field configure at least one test order;
Step 3: being respectively combined according to preset test method according to all test orders of all parameter fields Generate each corresponding test case;
Step 4: calling the path URL and interface requests method to execute each corresponding of generation according to interface name, interface Test case, and according to the test order actually returned the result and accordingly generate each test case for executing each test case In preset expected result judge to obtain the implementing result of corresponding test case.
As advanced optimizing, the above method further include:
Step 5: generating interface testing report according to the implementing result of all test cases.
As advanced optimizing, the interface testing report uses graphical representation mode.
As advanced optimizing, the test method uses comprehensive test method or orthogonal experiment.
As advanced optimizing, the test order includes: that parameter field is verified for empty verifying and/or parameter field range And/or parameter field signature verification and/or parameter field type approval.
Beneficial effect is: the present invention is by configuring corresponding test order for each parameter field, then according to each ginseng The test order of digital section configuration is combined to obtain test case, then implementation of test cases to complete interface testing, and interface is surveyed Tester need to only carry out the simple behaviour such as introducting interface configuration file, the test order for configuring parameters field during examination Make.By the above method, the degree of automation of interface testing is higher, improves interface testing efficiency.
Specific embodiment
Below with reference to embodiment, technical solution of the present invention is further illustrated.
The technical scheme is that automation interface test method, comprising the following steps:
Step 1: importing the interface configuration file of the formats such as Excel, md, html, xml, obtained according to interface configuration file Corresponding interface message, interface message includes at least interface name, interface calls the path URL, interface requests method, interface requests Parameter list, interface requests parameter declaration and interface return parameters explanation, then to user feedback interface requests parameter declaration and Interface return parameters explanation;
Step 2: user is in interface requests parameter list according to interface requests parameter declaration and interface return parameters explanation Each parameter field configure at least one test order;
Step 3: being respectively combined according to preset test method according to all test orders of all parameter fields Generate each corresponding test case;
Step 4: calling the path URL and interface requests method to execute each corresponding of generation according to interface name, interface Test case, and according to the test order actually returned the result and accordingly generate each test case for executing each test case In preset expected result judge to obtain the implementing result of corresponding test case.
The above method is further optimized, specifically may is that
The above method can also include: Step 5: generating interface testing report according to the implementing result of all test cases; Test case is carried out be completed after, the test report for generating summing-up facilitates tester to check.Specifically, interface testing Report enables tester is more intuitive quickly to recognize test knot using graphical representations modes such as cake chart, histograms Fruit information.
Above-mentioned test method can use comprehensive test method or orthogonal experiment.Generation can be made using comprehensive test method Test case is more comprehensive, but the time spent in opposite execution use-case is also more, the test generated using orthogonal experiment The time spent in use-case is relatively fewer, but test case representativeness is stronger, opposite execution use-case is also less, and tester can To select suitable test method according to actual needs.
Above-mentioned test order may include:
Parameter field is empty verifying: testing one by one not allows for empty parameter field when being sky, if correct processing;
And/or parameter field range verifying: each parameter field is tested one by one and is overruned when being worth, if correct processing;
And/or parameter field signature verification: when the wrong tally signature of generation closes signature rule, if correct processing;
And/or parameter field type approval: when testing each parameter field type error one by one, if correct processing.
Embodiment
Concrete example illustrates technical solution of the present invention below.
This example is based on existing interface test macro, follows the steps below interface testing:
Step S1, user will need the interface configuration file of interface to be tested to imported into system, and system is matched according to interface Set file acquisition interface name, interface calls the path URL, interface requests method, interface requests parameter list, interface requests parameter Illustrate and interface return parameters illustrate, is then said interface requests parameter declaration and interface return parameters by human-computer interaction interface It is bright to feed back to user.
Step S2, user illustrates according to interface requests parameter declaration and interface return parameters, is by human-computer interaction interface Each parameter field in interface requests parameter list configures test order, needs a parameter field can be with according to actual test Multiple test orders are configured, the optional test order that this example provides has: parameter field is verified for sky, parameter field range is verified, Parameter field signature verification, parameter field type approval.
Step S3, system is by comprehensive test method or orthogonal experiment, according to all test orders of all parameter fields It is respectively combined and generates each corresponding test case;Assuming that there are three parameter field, each parameter field is configured with three A test order, according to be comprehensive test method, then generating with number of cases is 3 × 3 × 3=27, according to be orthogonal examination Method is tested, then the use-case number generated is 9 according to orthogonal arrage L9 ().
Step S4, system generates corresponding interface requests message according to the information in each test case of generation respectively, And the path URL and interface requests method is called respectively to send each interface requests message of generation according to interface name, interface To the corresponding interface, to execute each test case generated, then according to execute each test case actually return the result and Preset expected result in the test order of each test case is accordingly generated to judge to obtain the execution knot of corresponding test case Fruit, wherein preset expected result is that user returns according to interface requests parameter declaration and interface in above-mentioned steps S2 in test order It is pre-configured to return parameter declaration.
Step S5, system is reported according to the interface testing that the implementing result of all test cases generates represented as histograms.

Claims (5)

1. automation interface test method, which comprises the following steps:
Step 1: introducting interface configuration file, obtains corresponding interface message according to interface configuration file, the interface message is extremely It less include interface name, interface the calling path URL, interface requests method, interface requests parameter list, interface requests parameter declaration Illustrate with interface return parameters, then to user feedback interface requests parameter declaration and interface return parameters explanation;
Step 2: user illustrates to be every in interface requests parameter list according to interface requests parameter declaration and interface return parameters A parameter field configures at least one test order;
Step 3: being respectively combined generation according to all test orders of all parameter fields according to preset test method Each corresponding test case;
Step 4: calling the path URL and interface requests method to execute each corresponding test generated according to interface name, interface Use-case, and according to pre- in the test order for actually returning the result and accordingly generating each test case for executing each test case If expected result judge to obtain the implementing result of corresponding test case.
2. automation interface test method as described in claim 1, which is characterized in that further include:
Step 5: generating interface testing report according to the implementing result of all test cases.
3. automation interface test method as claimed in claim 2, which is characterized in that the interface testing report uses figure Change exhibition method.
4. automation interface test method as described in claim 1, which is characterized in that the test method uses comprehensive test Method or orthogonal experiment.
5. automation interface test method as described in claim 1, which is characterized in that the test order includes: parameter word Section is empty verifying and/or the verifying of parameter field range and/or parameter field signature verification and/or parameter field type approval.
CN201910555175.1A 2019-06-25 2019-06-25 Automation interface test method Pending CN110287113A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910555175.1A CN110287113A (en) 2019-06-25 2019-06-25 Automation interface test method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910555175.1A CN110287113A (en) 2019-06-25 2019-06-25 Automation interface test method

Publications (1)

Publication Number Publication Date
CN110287113A true CN110287113A (en) 2019-09-27

Family

ID=68005585

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910555175.1A Pending CN110287113A (en) 2019-06-25 2019-06-25 Automation interface test method

Country Status (1)

Country Link
CN (1) CN110287113A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111737137A (en) * 2020-06-24 2020-10-02 重庆紫光华山智安科技有限公司 Interface test data generation method and device, host and storage medium
CN112597033A (en) * 2020-12-26 2021-04-02 中国农业银行股份有限公司 Automatic interface testing method and device
CN112799953A (en) * 2021-02-08 2021-05-14 北京字节跳动网络技术有限公司 Interface testing method and device, computer equipment and storage medium
CN113779444A (en) * 2021-11-12 2021-12-10 北京宇信科技集团股份有限公司 Interface development method, zero code engine and zero code data interface development system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150356001A1 (en) * 2014-06-06 2015-12-10 Ebay Inc. Unit test automation for business rules and applications
CN106951364A (en) * 2017-02-08 2017-07-14 深圳国泰安教育技术股份有限公司 Method of testing and device
CN107908541A (en) * 2017-07-26 2018-04-13 平安壹钱包电子商务有限公司 Interface test method, device, computer equipment and storage medium
CN108897687A (en) * 2018-06-29 2018-11-27 泰华智慧产业集团股份有限公司 A kind of API automated testing method and system based on data-driven
CN109189666A (en) * 2018-08-02 2019-01-11 腾讯科技(北京)有限公司 Interface test method, device and computer equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150356001A1 (en) * 2014-06-06 2015-12-10 Ebay Inc. Unit test automation for business rules and applications
CN106951364A (en) * 2017-02-08 2017-07-14 深圳国泰安教育技术股份有限公司 Method of testing and device
CN107908541A (en) * 2017-07-26 2018-04-13 平安壹钱包电子商务有限公司 Interface test method, device, computer equipment and storage medium
CN108897687A (en) * 2018-06-29 2018-11-27 泰华智慧产业集团股份有限公司 A kind of API automated testing method and system based on data-driven
CN109189666A (en) * 2018-08-02 2019-01-11 腾讯科技(北京)有限公司 Interface test method, device and computer equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111737137A (en) * 2020-06-24 2020-10-02 重庆紫光华山智安科技有限公司 Interface test data generation method and device, host and storage medium
CN112597033A (en) * 2020-12-26 2021-04-02 中国农业银行股份有限公司 Automatic interface testing method and device
CN112799953A (en) * 2021-02-08 2021-05-14 北京字节跳动网络技术有限公司 Interface testing method and device, computer equipment and storage medium
CN113779444A (en) * 2021-11-12 2021-12-10 北京宇信科技集团股份有限公司 Interface development method, zero code engine and zero code data interface development system

Similar Documents

Publication Publication Date Title
CN110287113A (en) Automation interface test method
CN103792448B (en) A kind of digital protection device automatic test control system and control method thereof
CN105786695B (en) Data test method and system
Bhattacharya et al. Model-independent determination of the axial mass parameter<? format?> in quasielastic neutrino-nucleon scattering
Lei et al. Non-sequential Monte Carlo simulation for cyber-induced dependent failures in composite power system reliability evaluation
CN106528424B (en) Test method and test platform based on background system service or interface
CN104363324B (en) A kind of method of testing and test system tested automatically cell phone mainboard
CN102122265B (en) System and method for verifying computer software test results
CN111459821B (en) Software automation unit test method based on TestNG
CN109947646A (en) Interface test method, device, computer equipment and storage medium
Jena et al. A novel approach for test case generation from UML activity diagram
CN103365765B (en) Test case screening technique and system
CN105512036A (en) Test template for automatically generating test case according to preset rules and test method
CN103869801A (en) Test method of nuclear power plant instrumentation control logic function block and system
CN107861876A (en) Method of testing, device, computer equipment and readable storage medium storing program for executing
CN110046091B (en) Automatic test method and device
CN102110053A (en) Random testing method based on Android
CN109408262A (en) A kind of business data processing method and relevant device
CN110337076A (en) SMS platform interface test method, device, computer equipment and storage medium
CN104731587A (en) Unit testing data generating method and unit testing data generating system
CN110058974A (en) A kind of USB PD fast charge protocol chip checking method based on RISC_V processor
CN105337796A (en) WIFI router performance test method and system
CN102855175B (en) Automated testing method and device
CN110069279A (en) A kind of method of calibration, device and the storage medium of DC control protective program
CN109831348A (en) Automatic jig test method, equipment and system

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

Application publication date: 20190927

RJ01 Rejection of invention patent application after publication