CN105468524A - Automatic test method and system of WEB interface - Google Patents

Automatic test method and system of WEB interface Download PDF

Info

Publication number
CN105468524A
CN105468524A CN201510833736.1A CN201510833736A CN105468524A CN 105468524 A CN105468524 A CN 105468524A CN 201510833736 A CN201510833736 A CN 201510833736A CN 105468524 A CN105468524 A CN 105468524A
Authority
CN
China
Prior art keywords
test
testing method
automated testing
web interface
automatic test
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
CN201510833736.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.)
Shanghai Feixun Data Communication Technology Co Ltd
Original Assignee
Shanghai Feixun Data Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201510833736.1A priority Critical patent/CN105468524A/en
Publication of CN105468524A publication Critical patent/CN105468524A/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 invention relates to the automatic test field, especially an automatic test method and system of a WEB interface. Test cases are downloaded by an Svn server; after the number of the test cases is counted, a defined table is filled with the test cases; a class of the table is introduced through programming of the Python language; the keywords of the automatic test are customized; the keywords are written to the table header of the table; and the result information of the automatic test is stored in the table according to corresponding keywords in automatic test.

Description

The automated testing method of WEB interface and system
Technical field
The present invention relates to automatic test field, particularly relate to a kind of automated testing method and system of WEB interface.
Background technology
Web interface test stands in a kind of means of carrying out on web services program UI layer testing, be stand in user angle on test the correctness of web services program traffic logic, because the interface protocol of test is numerous, if adopt manual testing, not only inefficiency, and easily make mistakes
Summary of the invention
For problems such as manual testing's inefficiencies in prior art, the invention provides a kind of automated testing method and system of WEB interface, by building the framework of automatic test, realize web interface test, to improve test execution efficiency and to reduce the artificial cost returned.
The present invention adopts following technical scheme:
An automated testing method for WEB interface, comprising:
Download test case by Svn server, after adding up the number of described test case, described test case is inserted in defined form;
Write by Python the class that described form introduced in language, the keyword of self-defined described automatic test, described keyword is write the gauge outfit part of described form;
During automatic test, the described keyword of the object information of described automatic test according to correspondence is saved in described form.
Preferably, before automatic test, call Http interface to perform described test case, by introducing API Checkpointing.
Preferably, before automatic test, the http assembled character that test needs.
Preferably, described automated testing method comprises:
Analyzing XML file, obtains rreturn value field.
Preferably, described automated testing method comprises,
When carrying out automatic test first, check that whether described XML file is correct; If correct, encapsulate described XML file, the described object information of test is backfilled in described form, using as follow-up regression tested reference; If incorrect, preserve after manual correction.
Preferably, in described automated testing method, described form is Excel form.
Preferably, described automated testing method comprises, and the described keyword of definition comprises: CaseID and/or whether run and/or file size and/or outcome record and/or test result and/or use case description.
An automatization test system for WEB interface, comprising:
Case management module, downloads test case and adds up the number of described test case, described test case being inserted in defined form;
Test data typing module, with described case management model calling, writes by Python the class that described form introduced in language, the keyword of self-defined described automatic test, described keyword to be write the gauge outfit part of described form;
Execution module, performs described test case, calls Http interface, adopts packaged API Checkpointing, and
When carrying out automatic test first, when the described XML file of inspection is correct, encapsulate described XML file, the described object information of test is backfilled in described form, using as follow-up regression tested reference.
The invention has the beneficial effects as follows:
The present invention selects Python script to drive test, adopts Excel form management test data, and the class of an encapsulation Excel, calls http interface simultaneously, adopts the API that Python is packaged, and turns process to the http assembled character that test needs.The present invention realizes web interface test automation, merges case management function, improves test execution efficiency and reduces the artificial cost returned.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of the automated testing method of a kind of WEB interface of the present invention;
Fig. 2 is the structural representation of the automatization test system of a kind of WEB interface of the present invention.
Embodiment
It should be noted that, when not conflicting, following technical proposals, can combine between technical characteristic mutually.
Below in conjunction with accompanying drawing, the specific embodiment of the present invention is further described:
Embodiment one
As shown in Figure 1, present embodiments provide a kind of automated testing method of WEB interface, this automated testing method comprises: first download test case by Svn server, after the number of statistical test use-case, test case is inserted in defined Excel form, write by Python the class that Excel form introduced in language afterwards, the keyword of self-defined automatic test, writes the gauge outfit part of Excel form by keyword.
Before carrying out automatic test, call Http interface with implementation of test cases, by introducing API Checkpointing, the http assembled character that test needs, analyzing XML file, obtains rreturn value field, when carrying out automatic test afterwards first, check that whether XML file is correct; If correct, encapsulation XML file, is backfilled to the object information of test in Excel form, using as follow-up regression tested reference; If incorrect, preserve after manual correction.
In the present invention's preferred embodiment, the keyword of definition comprises: CaseID and/or whether run and/or file size and/or outcome record and/or test result and/or use case description.
Embodiment two
As shown in Figure 2, present embodiments provide a kind of automatization test system of WEB interface, the present embodiment mainly adopts python language compilation, the system of the present embodiment mainly comprises case management module, test data typing module, execution module, case management module in the present embodiment, the interface mainly through the present embodiment is clicked and is obtained from automation test case, is downloaded by svn server, and add up use-case number to be measured, insert in defined good excel form.Test data typing module, with case management model calling, introduces the class of excel by python, the self-defined relevant field that will need to test, run in program and start to define, as CaseID, whether run, file size, outcome record, test result, and the field such as use case description.The object information returned in program process writes excel form according to the keyword of correspondence and preserves.
Further, also execution module is comprised in the present embodiment, this module and test data typing model calling, perform the test case downloaded, call http interface, adopt the API that python is packaged, 2 checkpoints are set, the correctness (file contrast) of the rreturn value field (being obtained by analyzing XML) in XML file and XML file.Perform test first, adopt semi-automatic mode, i.e. whether the XML file of hand inspection output is correct, once correctly will seal XML file up for safekeeping, is follow-up regression tested expected results, if find the manual correction (test first can check) of mistake.During follow-up execution test, can be just standard according to the correct XML file of having sealed up for safekeeping, carry out result judgement.
In sum, the present invention selects Python script to drive test, adopts Excel form management test data, and the class of an encapsulation Excel, calls http interface simultaneously, adopts the API that Python is packaged, and turns process to the http assembled character that test needs.The present invention realizes web interface test automation, merges case management function, improves test execution efficiency and reduces the artificial cost returned.
By illustrating and accompanying drawing, giving the exemplary embodiments of the ad hoc structure of embodiment, based on the present invention's spirit, also can do other conversion.Although foregoing invention proposes existing preferred embodiment, but these contents are not as limitation.
For a person skilled in the art, after reading above-mentioned explanation, various changes and modifications undoubtedly will be apparent.Therefore, appending claims should regard the whole change and correction of containing true intention of the present invention and scope as.In Claims scope, the scope of any and all equivalences and content, all should think and still belong to the intent and scope of the invention.

Claims (8)

1. an automated testing method for WEB interface, is characterized in that, comprising:
Download test case by Svn server, after adding up the number of described test case, described test case is inserted in defined form;
Write by Python the class that described form introduced in language, the keyword of self-defined described automatic test, described keyword is write the gauge outfit part of described form;
During automatic test, the described keyword of the object information of described automatic test according to correspondence is saved in described form.
2. the automated testing method of WEB interface according to claim 1, is characterized in that, before automatic test, calls Http interface to perform described test case, by introducing API Checkpointing.
3. the automated testing method of WEB interface according to claim 2, is characterized in that, before automatic test, and the http assembled character that test needs.
4. the automated testing method of WEB interface according to claim 3, is characterized in that, described automated testing method comprises:
Analyzing XML file, obtains rreturn value field.
5. the automated testing method of WEB interface according to claim 3, is characterized in that, described automated testing method comprises,
When carrying out automatic test first, check that whether described XML file is correct; If correct, encapsulate described XML file, the described object information of test is backfilled in described form, using as follow-up regression tested reference; If incorrect, preserve after manual correction.
6. the automated testing method of WEB interface according to claim 1, is characterized in that, in described automated testing method, described form is Excel form.
7. the automated testing method of WEB interface according to claim 1, it is characterized in that, described automated testing method comprises, and the described keyword of definition comprises: CaseID and/or whether run and/or file size and/or outcome record and/or test result and/or use case description.
8. an automatization test system for WEB interface, is characterized in that, comprising:
Case management module, downloads test case and adds up the number of described test case, described test case being inserted in defined form;
Test data typing module, with described case management model calling, writes by Python the class that described form introduced in language, the keyword of self-defined described automatic test, described keyword to be write the gauge outfit part of described form;
Execution module, performs described test case, calls Http interface, adopts packaged API Checkpointing, and
When carrying out automatic test first, when the described XML file of inspection is correct, encapsulate described XML file, the described object information of test is backfilled in described form, using as follow-up regression tested reference.
CN201510833736.1A 2015-11-25 2015-11-25 Automatic test method and system of WEB interface Pending CN105468524A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510833736.1A CN105468524A (en) 2015-11-25 2015-11-25 Automatic test method and system of WEB interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510833736.1A CN105468524A (en) 2015-11-25 2015-11-25 Automatic test method and system of WEB interface

Publications (1)

Publication Number Publication Date
CN105468524A true CN105468524A (en) 2016-04-06

Family

ID=55606255

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510833736.1A Pending CN105468524A (en) 2015-11-25 2015-11-25 Automatic test method and system of WEB interface

Country Status (1)

Country Link
CN (1) CN105468524A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106407117A (en) * 2016-09-27 2017-02-15 浪潮软件集团有限公司 Universal interface test method
CN107807844A (en) * 2017-10-31 2018-03-16 北京新能源汽车股份有限公司 Generation method, device and the computer-readable recording medium of traffic test scene
CN108038125A (en) * 2017-11-07 2018-05-15 平安科技(深圳)有限公司 Automatic control methods, device, equipment and the storage medium of fund system test value
CN108897682A (en) * 2018-06-25 2018-11-27 郑州云海信息技术有限公司 A kind of iteration tests outcome evaluation method based on Python
CN109254988A (en) * 2018-08-03 2019-01-22 京信通信系统(中国)有限公司 Report automatic test approach, device, computer storage medium and equipment
CN110287119A (en) * 2019-06-28 2019-09-27 深圳市万睿智能科技有限公司 A kind of automatic interface testing method and device based on python
CN110297774A (en) * 2019-07-02 2019-10-01 四川长虹电器股份有限公司 A kind of automatic interface testing method based on python
CN111488274A (en) * 2020-03-27 2020-08-04 杭州海兴电力科技股份有限公司 Test case construction method, test equipment and storage medium
CN111813665A (en) * 2020-06-29 2020-10-23 四川长虹电器股份有限公司 Big data platform interface data testing method and system based on python
CN112367220A (en) * 2020-10-27 2021-02-12 深圳市优必选科技股份有限公司 Interface testing method and device, storage medium and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090199047A1 (en) * 2008-01-31 2009-08-06 Yahoo! Inc. Executing software performance test jobs in a clustered system
CN103516559A (en) * 2012-12-13 2014-01-15 Tcl集团股份有限公司 Method and system for testing application compatibility of intelligent terminal

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090199047A1 (en) * 2008-01-31 2009-08-06 Yahoo! Inc. Executing software performance test jobs in a clustered system
CN103516559A (en) * 2012-12-13 2014-01-15 Tcl集团股份有限公司 Method and system for testing application compatibility of intelligent terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张元礼: "http接口自动化测试框架实现", 《51TESTING软件测试网》 *

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106407117A (en) * 2016-09-27 2017-02-15 浪潮软件集团有限公司 Universal interface test method
CN107807844B (en) * 2017-10-31 2020-09-25 北京新能源汽车股份有限公司 Method and device for generating traffic test scene and computer readable storage medium
CN107807844A (en) * 2017-10-31 2018-03-16 北京新能源汽车股份有限公司 Generation method, device and the computer-readable recording medium of traffic test scene
CN108038125A (en) * 2017-11-07 2018-05-15 平安科技(深圳)有限公司 Automatic control methods, device, equipment and the storage medium of fund system test value
CN108038125B (en) * 2017-11-07 2021-06-01 平安科技(深圳)有限公司 Method, device, equipment and storage medium for automatically comparing fund system test values
CN108897682A (en) * 2018-06-25 2018-11-27 郑州云海信息技术有限公司 A kind of iteration tests outcome evaluation method based on Python
CN109254988A (en) * 2018-08-03 2019-01-22 京信通信系统(中国)有限公司 Report automatic test approach, device, computer storage medium and equipment
CN110287119A (en) * 2019-06-28 2019-09-27 深圳市万睿智能科技有限公司 A kind of automatic interface testing method and device based on python
CN110297774A (en) * 2019-07-02 2019-10-01 四川长虹电器股份有限公司 A kind of automatic interface testing method based on python
CN111488274A (en) * 2020-03-27 2020-08-04 杭州海兴电力科技股份有限公司 Test case construction method, test equipment and storage medium
CN111488274B (en) * 2020-03-27 2023-10-24 杭州海兴电力科技股份有限公司 Test case construction method, test equipment and storage medium
CN111813665A (en) * 2020-06-29 2020-10-23 四川长虹电器股份有限公司 Big data platform interface data testing method and system based on python
CN112367220A (en) * 2020-10-27 2021-02-12 深圳市优必选科技股份有限公司 Interface testing method and device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN105468524A (en) Automatic test method and system of WEB interface
CN106990952B (en) Form verification method and system based on Vue
CN103049320B (en) In browser, start the method and apparatus of external application
CN107133174A (en) Test case code automatically generating device and method
CN111930617B (en) Automatic test method and device based on data objectification
CN110221968A (en) Method for testing software and Related product
CN105589805B (en) Method and device for generating code coverage rate report
CN109710677A (en) Processing for Data Analysis in Physics, device, computer equipment and storage medium
CN107171897A (en) A kind of interface test method and data-interface test system
CN104915297B (en) A kind of automated testing method of the APP power consumption of android equipment
CN107239271A (en) Develop document structure tree method and device
CN105094878B (en) A kind of method and apparatus of integrated system library file
CN107957956A (en) Test method, device and the readable storage medium storing program for executing of software differences coverage rate
CN108255513A (en) Electronic device, the data-interface based on springmvc and its illustrate automatic generation method and storage medium
CN105094905A (en) Method and device for dynamically loading language resources
CN105404574B (en) Smart card and mobile terminal consistency test method and device
CN105791178A (en) Message assembly method and device
CN107643893A (en) A kind of program detecting method and device
CN109086091A (en) A kind of interface loading method, device and the equipment of software development kit
CN113672520A (en) Test case generation method and device, electronic equipment and storage medium
CN109739704A (en) A kind of interface test method, server-side and computer readable storage medium
CN104346376A (en) Method and system for dynamically inserting data mining algorithm into data mining platform
CN105723410A (en) Method and system for displaying house resources in real estate network
CN107797805A (en) A kind of code wrap method, apparatus and computer-readable recording medium
CN205318371U (en) Hardware test equipment towards ampere tall and erect system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into 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: 20160406