CN109189692A - A kind of webservice interface test method and device - Google Patents

A kind of webservice interface test method and device Download PDF

Info

Publication number
CN109189692A
CN109189692A CN201811216846.3A CN201811216846A CN109189692A CN 109189692 A CN109189692 A CN 109189692A CN 201811216846 A CN201811216846 A CN 201811216846A CN 109189692 A CN109189692 A CN 109189692A
Authority
CN
China
Prior art keywords
webservice
test
keyword
interface
connection
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
CN201811216846.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.)
Sunshine Life Insurance Co Ltd
Original Assignee
Sunshine Life Insurance 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 Sunshine Life Insurance Co Ltd filed Critical Sunshine Life Insurance Co Ltd
Priority to CN201811216846.3A priority Critical patent/CN109189692A/en
Publication of CN109189692A publication Critical patent/CN109189692A/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

Abstract

The embodiment of the present invention provides a kind of webservice interface test method and device.Method includes acquisition test parameter and test case, test case include the test method keyword write by natural language;Test method keyword is matched with the preset keyword in key word library, corresponding target webservice interface method is obtained according to matching result and test parameter, includes multiple preset keywords in key word library and corresponding for operating the mapping relations between webservice interface method;Based on target webservice interface method, the library webservice is called to carry out interface testing.Device is for executing the above method, the embodiment of the present invention supports the key word library of natural language to be tested by providing, the code of profession is write without tester, and the test to webservice interface only can be realized by natural language, reduce test threshold.

Description

A kind of webservice interface test method and device
Technical field
The present invention relates to webservice interface testing technical fields, in particular to a kind of webservice interface Test method and device.
Background technique
Webservice is a kind of new web application branch, can be executed from simple request to complicated commercial affairs Any function of processing, is used widely in internet.Webservice interface testing based on natural language, using certainly The mode of right language encapsulates keyword, is supplied to automatic test cases use, there is the advantages of simple realization, easy-to-read.
Fig. 1 is the webservice interface testing framework schematic diagram that the prior art provides, as shown in Figure 1, traditional Webservice interface automatic test.Tester's test frame that language (such as java, python) provides based on programming (such as junit, testNG, pytest etc.) writes automatic test cases, and test case is complete by calling the library webservice In pairs in the interface testing of webservice.Therefore, traditional method tested Webservice interface needs to test Personnel have higher program capability, and test threshold is higher.
Summary of the invention
In view of this, the embodiment of the present invention is designed to provide a kind of webservice interface test method and device, To solve the above technical problems.
In a first aspect, the embodiment of the invention provides a kind of webservice interface test methods, comprising:
Obtain the test parameter tested webservice interface to be tested and test case, the test case packet Include the test method keyword write by natural language;
The test method keyword is matched with the preset keyword in key word library, according to matching result and institute It states test parameter and obtains the corresponding target webservice interface method of the test method keyword, wherein the key word library In include that multiple preset keywords and each preset keyword are corresponding for operating between webservice interface method Mapping relations;
Based on the target webservice interface test method, call the library webservice to webservice to be tested Interface is tested.
Further, after calling the library webservice to test webservice interface to be tested, the side Method, further includes:
The test result to the webservice interface to be tested is obtained, and the test result is converted to XML pairs As;
The XML object is returned into the corresponding terminal of test case.
Further, after obtaining the test case tested webservice interface to be tested, the method, Further include:
Obtain the first connection request of the first webservice interface of connection in the test case, first connection Request includes the first concatenated key write by natural language;
First concatenated key is matched with the preset keyword in the key word library, obtains described first The corresponding first webservice connection method of concatenated key;
Corresponding first webservice interface creation first is called according to the first webservice connection method Webservice connection;
The first method list that the first webservice interface returns is obtained, and the first method list is carried out Storage.
Further, after obtaining the test case tested webservice interface to be tested, the method, Further include:
Obtain the second connection request of the 2nd webservice interface of connection in the test case, second connection Request includes the second concatenated key write by natural language;
Second concatenated key is matched with the preset keyword in the key word library, obtains described second The corresponding 2nd webservice connection method of concatenated key;
Corresponding 2nd webservice interface creation second is called according to the 2nd webservice connection method Webservice connection;
The second method list that the 2nd webservice interface returns is obtained, and the second method list is carried out Storage.
Further, the method, further includes:
The switching connection request in the test case is obtained, the switching connection request includes writing by natural language Switching keyword;
The switching keyword is matched with the preset keyword in key word library, obtains the switching keyword pair The target connection method answered;
Corresponding webservice interface will be connected according to the target connection method.
Second aspect, the embodiment of the invention provides a kind of webservice interface test devices, comprising:
First obtains module, for obtaining the test parameter tested webservice interface to be tested and test use Example, the test case includes the test method keyword write by natural language;
First matching module, for carrying out the preset keyword in the test method keyword and key word library Match, the interface side the test method keyword corresponding target webservice is obtained according to matching result and the test parameter Method, wherein including that multiple preset keywords and each preset keyword are corresponding for operating in the key word library Mapping relations between webservice interface method;
Test module calls the library webservice to be tested for being based on the target webservice interface method Webservice interface is tested.
Further, described device, further includes:
Second obtains module, for obtaining the test result to the webservice interface to be tested, and by the survey Test result is converted to XML object;
Return module, for the XML object to be returned to the corresponding terminal of test case.
Further, described device, further includes:
Third obtains module, for obtaining the first connection of the first webservice interface of connection in the test case Request, first connection request includes the first concatenated key write by natural language;
Second matching module, for carrying out the preset keyword in first concatenated key and the key word library Matching obtains the corresponding first webservice connection method of first concatenated key;
Link block is created, for calling corresponding first according to the first webservice connection method Webservice interface creates the first webservice connection;
Memory module, the first method list returned for obtaining the first webservice interface, and by described the One method list is stored.
The third aspect, the embodiment of the present invention provide a kind of electronic equipment, comprising: processor, memory and bus, wherein
The processor and the memory complete mutual communication by the bus;
The memory is stored with the program instruction that can be executed by the processor, and the processor calls described program to refer to Enable the method and step for being able to carry out first aspect.
Fourth aspect, the embodiment of the present invention provide a kind of non-transient computer readable storage medium, comprising:
The non-transient computer readable storage medium stores computer instruction, and the computer instruction makes the computer Execute the method and step of first aspect.
The embodiment of the present invention by obtaining the test method keyword write of natural language, then with it is pre- in key word library If keyword is matched, target webservice interface method is obtained, is based on target webservice interface method, is called Webservice interface to be tested is tested in the library webservice, the code of profession is write without tester, only The test to webservice interface can be realized by natural language, reduce test threshold.
Other features and advantages of the present invention will be illustrated in subsequent specification, also, partly be become from specification It is clear that by implementing understanding of the embodiment of the present invention.The objectives and other advantages of the invention can be by written theory Specifically noted structure is achieved and obtained in bright book, claims and attached drawing.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached Figure is briefly described, it should be understood that the following drawings illustrates only certain embodiments of the present invention, therefore is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 is the webservice interface testing framework schematic diagram that the prior art provides;
Fig. 2 is a kind of webservice interface test method flow diagram provided in an embodiment of the present invention;
Fig. 3 is webservice interface testing signaling interaction diagram provided in an embodiment of the present invention;
Fig. 4 is webservice connection hand off signaling interaction figure provided in an embodiment of the present invention;
Fig. 5 is a kind of webservice interface test device structural schematic diagram provided in an embodiment of the present invention;
Fig. 6 is test device block schematic illustration provided in an embodiment of the present invention;
Fig. 7 is electronic equipment entity structure schematic diagram provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with attached drawing in the embodiment of the present invention, technical solution in the embodiment of the present invention carries out clear, complete Ground description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Usually exist The component of the embodiment of the present invention described and illustrated in attached drawing can be arranged and be designed with a variety of different configurations herein.Cause This, is not intended to limit claimed invention to the detailed description of the embodiment of the present invention provided in the accompanying drawings below Range, but it is merely representative of selected embodiment of the invention.Based on the embodiment of the present invention, those skilled in the art are not doing Every other embodiment obtained under the premise of creative work out, shall fall within the protection scope of the present invention.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.Meanwhile of the invention In description, term " first ", " second " etc. are only used for distinguishing description, are not understood to indicate or imply relative importance.
Fig. 2 is a kind of webservice interface test method flow diagram provided in an embodiment of the present invention, such as Fig. 2 institute Show, this method comprises:
Step 201: obtaining the test parameter tested webservice interface to be tested and test case, the survey Example on probation includes the test method keyword write by natural language.
In the specific implementation process, test device obtains the test tested webservice interface to be tested and joins Several and test case, wherein test case is one group of condition or variable, and tester determines application software or software system according to it Whether system correctly works.Determine whether software program or system pass through the method for test and be called test philosophy.And in test case Including test method keyword, which is that tester is write by natural language.Test method keyword It can be to have made an appointment to method keyword corresponding to webservice interface progress test operation, such as can be " inquiry user " or " insertion user " etc..It should be noted that natural language refers to a kind of language to develop naturally with culture, It is corresponding with machine language, and natural language may include Chinese, English, Japanese etc..
Step 202: the test method keyword being matched with the preset keyword in key word library, according to matching As a result the corresponding target webservice interface method of the test method keyword is obtained with the test parameter, wherein described It include that multiple preset keywords and each preset keyword are corresponding for operating the interface side webservice in key word library Mapping relations between method.
In the specific implementation process, key word library is that the decorator provided by python is built in advance, and is closed It include multiple preset keywords in key character library, each preset keyword has its corresponding to connect for operating webservice Mouth method.It should be noted that preset keyword is also natural language, by test method keyword with it is each in key word library A preset keyword is matched, using the preset keyword of successful match as target keywords, according to incoming test parameter And target keywords are corresponding for operating webservice interface method acquisition target webservice interface method.Its In, webservice interface method can be one section of program segment, by running the program segment to realize the test of corresponding method.
Step 203: being based on the target webservice interface method, call the library webservice to be tested Webservice interface is tested.
In the specific implementation process, test device is called after getting target webservice interface method The library webservice accesses webservice interface, is tested with realizing webservice interface to be tested.
The embodiment of the present invention by obtaining the test method keyword write of natural language, then with it is pre- in key word library If keyword is matched, target webservice interface method is obtained, is based on target webservice interface method, is called Webservice interface to be tested is tested in the library webservice, the code of profession is write without tester, only The test to webservice interface can be realized by natural language, reduce test threshold.
On the basis of the above embodiments, the library webservice is being called to test webservice interface to be tested Later, the method, further includes:
The test result to the webservice interface to be tested is obtained, and the test result is converted to XML pairs As;
The XML object is returned into the corresponding terminal of test case.
In the specific implementation process, test device is to be measured after testing webservice interface to be tested It tries webservice interface and returns to corresponding test result to test device, test device upon receipt of the test results, will be surveyed The format analysis processing of test result to obtain XML object, and XML object is back at the format of the identifiable XML of test case The corresponding terminal of test case, so that test case carries out subsequent test according to XML object.
Fig. 3 is webservice interface testing signaling interaction diagram provided in an embodiment of the present invention, as shown in figure 3, main packet Include test case, key word library, the library webservice and webservice interface:
Step 301: obtaining connection request;Key word library receives the webservice connection request in test case, wherein The connection request is also to be write by natural language, can be " Create Soap Client ";
Step 302: keyword match;Key word library is closed after receiving connection request according to the connection in connection request Key word is matched with the preset keyword in key word library, obtains the corresponding webservice of preset keyword of successful match Connection method;
Step 303: creation connection;The library webservice creates webservice according to webservice connection method and connects It connects;
Step 304: acquisition methods list and parameter definition;After completing webservice connection, webservice is connect Mouth sends the parameter definition of the method list that the webservice interface is supported and method to the library webservice;
Step 305: acquisition methods list;Key word library acquisition methods list from the library webservice;
Step 306: storage method list;Key word library stores this method list;
Step 307: sending test method keyword;Test case sends the test side that natural language is write to key word library Method keyword, such as " Call Soap Method ";
Step 308: keyword match;Key word library matches test method keyword with preset keyword, and leads to The test parameter for crossing input obtains target webservice interface method;Target webservice interface method is the side " echo " Method;
Step 309: test;Webservice interface to be tested is surveyed using target webservice interface method Examination;
Step 310: returning to test result;Key word library obtains the return of webservice interface method, and is processed into XML pairs As;
Step 311: returning to test result;Keyword returns to XML object to test case.
Test result is processed into XML object, and XML object is returned by obtaining test result by the embodiment of the present invention It is back to test case, to improve the accuracy of test.
On the basis of the above embodiments, obtain test case that webservice interface to be tested is tested it Afterwards, the method, further includes:
Before testing webservice interface to be tested, the webservice interface pair to be tested is first connected The first webservice interface answered, therefore, test device obtain the first webservice of connection in the test case and connect First connection request of mouth, first connection request includes the first concatenated key write by natural language;
First concatenated key is matched with each preset keyword in key word library, obtains and connect pass with first The corresponding first webservice connection method of the preset keyword of key word successful match;
Corresponding first webservice interface creation first is called according to the first webservice connection method Webservice connection;
After the first webservice connection is completed in creation, the first webservice interface returns executable to test device Method list and method parameter definition, the parameter definition of this method list and method is stored in key by test device In character library.
The embodiment of the present invention is before testing the first webservice interface, it is necessary first to create first Webservice connection is realized when creating connection, and through natural language, test threshold is reduced, so that programming basis Lower tester also can be carried out test.
On the basis of the above embodiments, obtain test case that webservice interface to be tested is tested it Afterwards, the method, further includes: the embodiment of the present invention supports the connecting test of multiple webservice interfaces.
Therefore, the second connection that test device can also obtain the 2nd webservice interface of connection in test case is asked It asks, the second connection request includes the second concatenated key write by natural language;
Second concatenated key is matched with each of key word library preset keyword, acquisition is connect with second The corresponding 2nd webservice connection method of keyword;
Corresponding 2nd webservice interface creation second is called according to the 2nd webservice connection method Webservice connection;
After the 2nd webservice connection is completed in creation, the 2nd webservice interface returns executable to test device Method list and method parameter definition, the parameter definition of this method list and method is stored in key by test device In character library.
The embodiment of the present invention is before testing the 2nd webservice interface, it is necessary first to create second Webservice connection is realized when creating connection, and through natural language, test threshold is reduced, so that programming basis Lower tester also can be carried out test.
On the basis of the above embodiments, the method, further includes:
It, can be according to actual needs multiple after creating two or more webservice connections Switch over connection between webservice interface, when switching, test device obtains the switching connection request in test case, institute Stating switching connection request includes the switching keyword write by natural language.Test device will switch keyword and key word library In preset keyword matched, obtain the corresponding target connection method of the switching keyword.
Corresponding webservice interface will be connected according to the target connection method, such as: test case can pass through Switching keyword switches current webservice and is connected on the first webservice interface.
Fig. 4 is webservice connection hand off signaling interaction figure provided in an embodiment of the present invention, as shown in figure 4, signaling is handed over Mutual node includes: test case, key word library, the library webservice, the first webservice interface and second Webservice interface, specific as follows:
Step 401: creation webservice client;Test case creates webservice visitor in a manner of natural language Family end such as " Create Soap Client " connects the first Webservice interface, and alias is arranged;
Step 402: keyword match;Key word library matches keyword, and the library webservice API is called to create Webservice connection;
Step 403: establishing the first webservice connection;The creation of the library Webservice is connected and is returned
Step 404: storage;Webservice connection and alias are placed into cache pool by key word library
Step 405- step 408: establishing the 2nd webservice connection, and Establishing process is identical as step 401- step 404;
Step 409: sending switching request;It include switching keyword in switching request, by key, you switch test case Current webservice is connected to webservice interface, such as " Switch Soap Client ".
Step 410: switching;Key word library carries out keyword match to switching keyword, obtains switching method, and utilize and cut The method of changing switches over, and after the completion of switching, can call corresponding webservice interface.
The embodiment of the present invention facilitates the switching for realizing the connection of webservice interface by natural language.
Fig. 5 is a kind of webservice interface test device structural schematic diagram provided in an embodiment of the present invention, such as Fig. 5 institute Show, which includes: the first acquisition module 501, the first matching module 502 and test module 503, in which:
First acquisition module 501 is for obtaining the test parameter tested webservice interface to be tested and test Use-case, the test case include the test method keyword write by natural language;First matching module 502 is used for institute It states test method keyword to be matched with the preset keyword in key word library, be obtained according to matching result and the test parameter The corresponding target webservice interface method of the test method keyword is obtained, wherein including multiple pre- in the key word library If the mapping relations between keyword and the corresponding webservice interface method of each preset keyword;Test module 503 For being based on the target webservice interface method, the library webservice is called to carry out webservice interface to be tested Test.
On the basis of the above embodiments, described device, further includes:
Second obtains module, for obtaining the test result to the webservice interface to be tested, and by the survey Test result is converted to XML object;
Return module, for the XML object to be returned to the corresponding terminal of test case.
On the basis of the above embodiments, described device, further includes:
Third obtains module, for obtaining the first connection of the first webservice interface of connection in the test case Request, first connection request includes the first concatenated key write by natural language;
Second matching module, for carrying out the preset keyword in first concatenated key and the key word library Matching obtains the corresponding first webservice connection method of first concatenated key;
Link block is created, for calling corresponding first according to the first webservice connection method Webservice interface creates the first webservice connection;
Memory module, the first method list returned for obtaining the first webservice interface, and by described the One method list is stored.
It is apparent to those skilled in the art that for convenience and simplicity of description, the device of foregoing description Specific work process, no longer can excessively be repeated herein with reference to the corresponding process in preceding method.
In conclusion the embodiment of the present invention is by obtaining the test method keyword write of natural language, then with key Preset keyword in character library is matched, and target webservice interface method is obtained, and is based on target webservice interface Method calls the library webservice to test webservice interface to be tested, writes profession without tester Code, the test to webservice interface only can be realized by natural language, reduce test threshold.
Fig. 6 is test device block schematic illustration provided in an embodiment of the present invention, as shown in fig. 6, entire frame is three layers, bottom Layer webservice interface is tested object.The key word library of the second layer, by encapsulating the existing library webservice, with Webservice interface communication, and the keyword of natural language is provided, to facilitate upper layer to realize the automation based on natural language Test case.
The embodiment of the present invention is based on the existing library webservice, will by the decorator function of python Webservice interface method is packaged into the key word library of natural language.Test case passes through oneself for calling key word library to provide Right language realizes test case, tests webservice interface.
For the embodiment of the present invention by key word library, the mode for providing natural language writes automatic test cases, for Example writer, can be realized webservice automatic test cases without program capability, and threshold is low, and test case letter It is clean, pass through natural language description, easy-to-read.
Test case facilitates evaluation, and product manager, business personnel, client can understand product by reading test use-case Function, without program capability background.
Fig. 7 is electronic equipment entity structure schematic diagram provided in an embodiment of the present invention, as shown in fig. 7, the electronic equipment, It include: processor (processor) 701, memory (memory) 702 and bus 703;Wherein,
The processor 701 and memory 702 complete mutual communication by the bus 703;
The processor 701 is used to call the program instruction in the memory 702, to execute above-mentioned each method embodiment Provided method, for example, the test parameter tested webservice interface to be tested and test case are obtained, The test case includes the test method keyword write by natural language;By the test method keyword and keyword Preset keyword in library is matched, and it is corresponding to obtain the test method keyword according to matching result and the test parameter Target webservice interface method, wherein including multiple preset keywords and each default key in the key word library Word is corresponding for operating the mapping relations between webservice interface method;Based on the interface side the target webservice Method calls the library webservice to test webservice interface to be tested.
The present embodiment discloses a kind of computer program product, and the computer program product includes being stored in non-transient calculating Computer program on machine readable storage medium storing program for executing, the computer program include program instruction, when described program instruction is calculated When machine executes, computer is able to carry out method provided by above-mentioned each method embodiment, for example, obtains to be tested The test parameter and test case that webservice interface is tested, the test case include being write by natural language Test method keyword;The test method keyword is matched with the preset keyword in key word library, according to matching As a result the corresponding target webservice interface method of the test method keyword is obtained with the test parameter, wherein described It include that multiple preset keywords and each preset keyword are corresponding for operating the interface side webservice in key word library Mapping relations between method;Based on the target webservice interface test method, call the library webservice to be tested Webservice interface is tested.
The present embodiment provides a kind of non-transient computer readable storage medium, the non-transient computer readable storage medium Computer instruction is stored, the computer instruction makes the computer execute method provided by above-mentioned each method embodiment, example It such as include: to obtain the test parameter tested webservice interface to be tested and test case, the test case packet Include the test method keyword write by natural language;By the default key in the test method keyword and key word library Word is matched, and obtains the corresponding target of the test method keyword according to matching result and the test parameter Webservice interface method, wherein including that multiple preset keywords and each preset keyword are corresponding in the key word library For operating mapping relations between webservice interface method;Based on the interface testing side the target webservice Method calls the library webservice to test webservice interface to be tested.
In several embodiments provided herein, it should be understood that disclosed device and method can also pass through Other modes are realized.The apparatus embodiments described above are merely exemplary, for example, flow chart and block diagram in attached drawing Show the device of multiple embodiments according to the present invention, the architectural framework in the cards of method and computer program product, Function and operation.In this regard, each box in flowchart or block diagram can represent the one of a module, section or code Part, a part of the module, section or code, which includes that one or more is for implementing the specified logical function, to be held Row instruction.It should also be noted that function marked in the box can also be to be different from some implementations as replacement The sequence marked in attached drawing occurs.For example, two continuous boxes can actually be basically executed in parallel, they are sometimes It can execute in the opposite order, this depends on the function involved.It is also noted that every in block diagram and or flow chart The combination of box in a box and block diagram and or flow chart can use the dedicated base for executing defined function or movement It realizes, or can realize using a combination of dedicated hardware and computer instructions in the system of hardware.
In addition, each functional module in each embodiment of the present invention can integrate one independent portion of formation together Point, it is also possible to modules individualism, an independent part can also be integrated to form with two or more modules.
It, can be with if the function is realized and when sold or used as an independent product in the form of software function module It is stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention. And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, made any to repair Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.It should also be noted that similar label and letter exist Similar terms are indicated in following attached drawing, therefore, once being defined in a certain Xiang Yi attached drawing, are then not required in subsequent attached drawing It is further defined and explained.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.

Claims (10)

1. a kind of webservice interface test method characterized by comprising
The test parameter tested webservice interface to be tested and test case are obtained, the test case includes logical Cross the test method keyword that natural language is write;
The test method keyword is matched with the preset keyword in key word library, according to matching result and the survey The corresponding target webservice interface method of test method keyword described in gain of parameter is tried, wherein wrapping in the key word library It includes multiple preset keywords and each preset keyword is corresponding for operating the mapping between webservice interface method Relationship;
Based on the target webservice interface method, the library webservice is called to carry out webservice interface to be tested Test.
2. the method according to claim 1, wherein in the calling library webservice to webservice to be tested After interface is tested, the method, further includes:
The test result to the webservice interface to be tested is obtained, and the test result is converted into XML object;
The XML object is returned into the corresponding terminal of test case.
3. the method according to claim 1, wherein testing obtaining webservice interface to be tested Test case after, the method, further includes:
Obtain the first connection request of the first webservice interface of connection in the test case, first connection request Including the first concatenated key write by natural language;
First concatenated key is matched with the preset keyword in the key word library, obtains first connection The corresponding first webservice connection method of keyword;
Corresponding first webservice interface creation first is called according to the first webservice connection method Webservice connection;
The first method list that the first webservice interface returns is obtained, and the first method list is deposited Storage.
4. according to the method described in claim 3, it is characterized in that, testing obtaining webservice interface to be tested Test case after, the method, further includes:
Obtain the second connection request of the 2nd webservice interface of connection in the test case, second connection request Including the second concatenated key write by natural language;
Second concatenated key is matched with the preset keyword in the key word library, obtains second connection The corresponding 2nd webservice connection method of keyword;
Corresponding 2nd webservice interface creation second is called according to the 2nd webservice connection method Webservice connection;
The second method list that the 2nd webservice interface returns is obtained, and the second method list is deposited Storage.
5. according to the method described in claim 3, it is characterized in that, the method, further includes:
Obtain the switching connection request in the test case, the switching connection request includes cutting of writing by natural language Change keyword;
The switching keyword is matched with the preset keyword in key word library, it is corresponding to obtain the switching keyword Target connection method;
Corresponding webservice interface will be connected according to the target connection method.
6. a kind of webservice interface test device characterized by comprising
First obtains module, for obtaining the test parameter tested webservice interface to be tested and test case, The test case includes the test method keyword write by natural language;
First matching module, for the test method keyword to be matched with the preset keyword in key word library, root The corresponding target webservice interface method of the test method keyword is obtained according to matching result and the test parameter, Described in include that multiple preset keywords and each preset keyword are corresponding for operating webservice in key word library Mapping relations between interface method;
Test module calls the library webservice to be tested for being based on the target webservice interface method Webservice interface is tested.
7. device according to claim 6, which is characterized in that described device, further includes:
Second obtains module, ties for obtaining the test result to the webservice interface to be tested, and by the test Fruit is converted to XML object;
Return module, for the XML object to be returned to the corresponding terminal of test case.
8. device according to claim 6, which is characterized in that described device, further includes:
Third obtains module, and the first connection for obtaining the first webservice interface of connection in the test case is asked It asks, first connection request includes the first concatenated key write by natural language;
Second matching module, for carrying out the preset keyword in first concatenated key and the key word library Match, obtains the corresponding first webservice connection method of first concatenated key;
Link block is created, for calling corresponding first webservice to connect according to the first webservice connection method Mouth the first webservice connection of creation;
Memory module, the first method list returned for obtaining the first webservice interface, and by the first party Method list is stored.
9. a kind of electronic equipment characterized by comprising processor, memory and bus, wherein
The processor and the memory complete mutual communication by the bus;
The memory is stored with the program instruction that can be executed by the processor, and the processor calls described program to instruct energy Enough execute the method according to claim 1 to 5.
10. a kind of non-transient computer readable storage medium, which is characterized in that the non-transient computer readable storage medium is deposited Computer instruction is stored up, the computer instruction makes the computer execute the method according to claim 1 to 5.
CN201811216846.3A 2018-10-18 2018-10-18 A kind of webservice interface test method and device Pending CN109189692A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811216846.3A CN109189692A (en) 2018-10-18 2018-10-18 A kind of webservice interface test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811216846.3A CN109189692A (en) 2018-10-18 2018-10-18 A kind of webservice interface test method and device

Publications (1)

Publication Number Publication Date
CN109189692A true CN109189692A (en) 2019-01-11

Family

ID=64946103

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811216846.3A Pending CN109189692A (en) 2018-10-18 2018-10-18 A kind of webservice interface test method and device

Country Status (1)

Country Link
CN (1) CN109189692A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109818833A (en) * 2019-03-14 2019-05-28 北京信而泰科技股份有限公司 A kind of ethernet test system and ethernet test method
CN112631930A (en) * 2020-12-30 2021-04-09 平安证券股份有限公司 Dynamic system testing method and related device
CN113495831A (en) * 2020-04-03 2021-10-12 卫宁健康科技集团股份有限公司 Method, system, device and medium for generating test case based on keyword

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130097586A1 (en) * 2011-10-17 2013-04-18 International Business Machines Corporation System and Method For Automating Test Automation
CN103914371A (en) * 2012-12-31 2014-07-09 北京新媒传信科技有限公司 Application test method and device
CN106095677A (en) * 2016-06-08 2016-11-09 上海爱数信息技术股份有限公司 The RESTful Webservice automatic interface testing method realized based on Robot Framework
CN108459957A (en) * 2017-11-29 2018-08-28 平安科技(深圳)有限公司 Test method, device, equipment and the storage medium of fund system test case

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130097586A1 (en) * 2011-10-17 2013-04-18 International Business Machines Corporation System and Method For Automating Test Automation
CN103914371A (en) * 2012-12-31 2014-07-09 北京新媒传信科技有限公司 Application test method and device
CN106095677A (en) * 2016-06-08 2016-11-09 上海爱数信息技术股份有限公司 The RESTful Webservice automatic interface testing method realized based on Robot Framework
CN108459957A (en) * 2017-11-29 2018-08-28 平安科技(深圳)有限公司 Test method, device, equipment and the storage medium of fund system test case

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
FLAMES2016: ""Python3通过suds访问webservice"", 《HTTPS://BLOG.CSDN.NET/ZHUMINGYAN/ARTICLE/DETAILS/79080455》 *
乐鹏: "《网络地理信息系统和服务》", 31 July 2011, 武汉大学出版社 *
轻舟漫溯: ""python使用suds调用webservice接口"", 《HTTPS://WWW.CNBLOGS.COM/NOTTOBE/P/5718823.HTML》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109818833A (en) * 2019-03-14 2019-05-28 北京信而泰科技股份有限公司 A kind of ethernet test system and ethernet test method
CN109818833B (en) * 2019-03-14 2021-08-17 北京信而泰科技股份有限公司 Ethernet test system and Ethernet test method
CN113495831A (en) * 2020-04-03 2021-10-12 卫宁健康科技集团股份有限公司 Method, system, device and medium for generating test case based on keyword
CN112631930A (en) * 2020-12-30 2021-04-09 平安证券股份有限公司 Dynamic system testing method and related device

Similar Documents

Publication Publication Date Title
CN108595494B (en) Method and device for acquiring reply information
CN104683386B (en) The stake service implementing method and device of customizable response
CN109992498B (en) Test case generation method and system and computer system
CN106897361B (en) Label page grouping management system and method based on tree structure
CN109189692A (en) A kind of webservice interface test method and device
CN106095673A (en) Automated testing method based on WEB interface and system
CN106503172A (en) The method and apparatus that learning path recommended by knowledge based collection of illustrative plates
CN107341098A (en) Software performance testing method, platform, equipment and storage medium
CN109726098A (en) Interface test method, device and computer readable storage medium
CN107133174A (en) Test case code automatically generating device and method
CN109976995B (en) Method and apparatus for testing
CN105183630B (en) Applied program testing method and device
CN102323873B (en) In order to trigger the method and system that icon is replied in instant messaging
CN105099801B (en) The test system of information management system and test environment analogy method
CN108459964A (en) Test cases selection method, apparatus, equipment and computer readable storage medium
CN113590776A (en) Text processing method and device based on knowledge graph, electronic equipment and medium
CN107220274A (en) One kind visualization data-interface fairground implementation method
CN109933803B (en) Idiom information display method, idiom information display device, electronic equipment and storage medium
CN111159014A (en) Response method and device for exploratory test, computer equipment and storage medium
CN108063691A (en) One kind buries point data consistency detecting method, apparatus and system
CN107276842A (en) Interface test method and device and electronic equipment
CN110309498A (en) The implementation method and device of examination report, and the method for generating examination report using it are generated based on parameter
CN109446077A (en) A kind of data library test method and device
CN109587351B (en) Call testing method, device, equipment and storage medium
CN108111929A (en) A kind of method based on Python automatic tests, system and test terminal

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: 20190111

RJ01 Rejection of invention patent application after publication