CN107291608A - The generation method of test script, subscription/register method of interface and device - Google Patents

The generation method of test script, subscription/register method of interface and device Download PDF

Info

Publication number
CN107291608A
CN107291608A CN201610201871.9A CN201610201871A CN107291608A CN 107291608 A CN107291608 A CN 107291608A CN 201610201871 A CN201610201871 A CN 201610201871A CN 107291608 A CN107291608 A CN 107291608A
Authority
CN
China
Prior art keywords
interface
tested
field
test script
selected classification
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.)
Granted
Application number
CN201610201871.9A
Other languages
Chinese (zh)
Other versions
CN107291608B (en
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.)
Cainiao Smart Logistics Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610201871.9A priority Critical patent/CN107291608B/en
Publication of CN107291608A publication Critical patent/CN107291608A/en
Application granted granted Critical
Publication of CN107291608B publication Critical patent/CN107291608B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

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)
  • Computer And Data Communications (AREA)

Abstract

This application discloses a kind of generation method of test script, the subscription/register method and device of interface, this method is related to network technique field.This method includes:Obtain the original description information of interface to be tested;The selected classification of the interface to be tested is determined according to the original description information;For the field assignment of the selected classification;According to the corresponding test script template of the communication protocol of the value of the field of the selected classification, the original description information and the interface to be tested, the test script of the interface to be tested is generated.In the program, the test script of interface to be tested can be automatically generated, is write without person skilled, even if the Field Count of interface to be tested is very more, the formation efficiency of test script is also very high, and greatly reduces error rate, it is to avoid situations such as field missing, mistake occur.

Description

The generation method of test script, subscription/register method of interface and device
Technical field
The application is related to network technique field, more particularly to a kind of generation method of test script, interface subscription/register method And device.
Background technology
With developing rapidly for network technology, many systems that service is provided are occurred in that, these systems are to outside by interface Service is provided.In order to ensure system each interface can normal work, set system each interface after, it is necessary to Each interface is tested.First, it will usually generate the test script of each interface, then using the test script of generation Test corresponding interface.
According to the generation method of dependence test script, the test script of each interface is write by person skilled.Some The field that interface is defined is very many, and Field Count can be up to 40 or 50 sometimes, and this is write in person skilled During the test script of a little interfaces, efficiency will be very low, and error rate can also be very high, it is easy to field missing, mistake occurs By mistake situations such as.
The content of the invention
The embodiment of the present application provides a kind of generation method of test script, the subscription/register method and device of interface, to solve Write present in correlation technique test script efficiency is very low and the problem of very high error rate.
According to the embodiment of the present application there is provided a kind of generation method of test script, including:
Obtain the original description information of interface to be tested;
The candidate categories of the interface to be tested are determined according to the original description information;
For the field assignment of the selected classification;
It is corresponding with the communication protocol of the interface to be tested according to the value of the field of the selected classification, the original description information Test script template, generate the test script of the interface to be tested.
Specifically, obtaining the original description information of interface to be tested, specifically include:
Obtain the interface name of interface to be tested;
Being searched in corresponding relation from interface name with original description information includes the first list item of the interface name;
If finding first list item, the original description information in first list item is obtained, described to be measured try is obtained The original description information of mouth.
Specifically, determining the selected classification of the interface to be tested according to the original description information, specifically include:
The corresponding request object of the interface to be tested and response object are obtained from the original description information in software development work Complete access path in tool bag SDK;
Classification and the response pair of the request object of the interface to be tested are obtained from the SDK based on the complete access path The classification of elephant, obtains the candidate categories of the interface to be tested;
The candidate categories of the interface to be tested are defined as to the selected classification of the interface to be tested;Or, obtain described wait The field of classification is selected, the candidate categories that field includes method attribute are defined as to the selected classification of the interface to be tested.
Specifically, being the field assignment of the selected class, specifically include:
The value of the field of the selected classification is searched from field default value storehouse;
If finding the value of the field of the selected classification, the value of the field of the selected classification is obtained;
If not finding the value of the field of the selected classification, according to the type of the field of the selected classification is self-defined The value of the field of selected class.
Specifically, according to the communication of the value of the field of the selected classification, the original description information and the interface to be tested The corresponding test script template of agreement, generates the test script of the interface to be tested, specifically includes:
Obtain the communication protocol of the interface to be tested;
Being searched from the corresponding relation of communication protocol and test script template includes the second list item of the communication protocol;
If finding second list item, the test script template in second list item is obtained, the communication protocol is obtained Corresponding test script template;
The value of the field of the selected classification, the original description information are added to the corresponding test script of the communication protocol In template, the test script of the interface to be tested is obtained.
Optionally, in addition to:
After subscription/registration to the interface to be tested is completed, using the test script of the interface to be tested to described to be measured Mouth of trying is tested;
Return to the test result of the interface to be tested.
According to the embodiment of the present application, a kind of subscription/register method of interface is also provided, including:
Receive user name, interface name, internet protocol address and communication protocol;
Obtain the corresponding subscription of the communication protocol/registration Script template;
The user name, interface name, the IP address and the communication protocol are added to the subscription/registration Script In template, interface corresponding to interface name subscribe to/register.
Optionally, in addition to:
The test script of the interface is generated according to the method described above;
The interface is tested using the test script of the interface;
Return to the test result of the interface.
According to the embodiment of the present application, a kind of generating means of test script are also provided, including:
Acquisition module, the original description information for obtaining interface to be tested;
Determining module, the selected classification for determining the interface to be tested according to the original description information;
Assignment module, for the field assignment for the selected classification;
Generation module, value, the original description information and the interface to be tested for the field according to the selected classification The corresponding test script template of communication protocol, generate the test script of the interface to be tested.
Specifically, the acquisition module, the original description information for obtaining interface to be tested, specifically for:
Obtain the interface name of interface to be tested;
Being searched in corresponding relation from interface name with original description information includes the first list item of the interface name;
If finding first list item, the original description information in first list item is obtained, described to be measured try is obtained The original description information of mouth.
Specifically, the determining module, the selected classification for determining the interface to be tested according to the original description information, Specifically for:
The corresponding request object of the interface to be tested and response object are obtained from the original description information in software development work Complete access path in tool bag SDK;
Classification and the response pair of the request object of the interface to be tested are obtained from the SDK based on the complete access path The classification of elephant, obtains the candidate categories of the interface to be tested;
The candidate categories of the interface to be tested are defined as to the selected classification of the interface to be tested;Or, obtain described wait The field of classification is selected, the candidate categories that field includes method attribute are defined as to the selected classification of the interface to be tested.
Specifically, the assignment module, for the field assignment for the selected classification, specifically for:
The value of the field of the selected classification is searched from field default value storehouse;
If finding the value of the field of the selected classification, the value of the field of the selected classification is obtained;
If not finding the value of the field of the selected classification, according to the type of the field of the selected classification is self-defined The value of the field of selected classification.
Specifically, the generation module, value, the original description information and institute for the field according to the selected classification The corresponding test script template of communication protocol of interface to be tested is stated, the test script of the interface to be tested is generated, it is specific to use In:
Obtain the communication protocol of the interface to be tested;
Being searched from the corresponding relation of communication protocol and test script template includes the second list item of the communication protocol;
If finding second list item, the test script template in second list item is obtained, the communication protocol is obtained Corresponding test script template;
The value of the field of the selected classification, the original description information are added to the corresponding test script of the communication protocol In template, the test script of the interface to be tested is obtained.
Optionally, in addition to:
Test module, for after subscription/registration to the interface to be tested is completed, using the test of the interface to be tested Script is tested the interface to be tested;
Return to module, the test result for returning to the interface to be tested.
According to the embodiment of the present application, a kind of subscription/register device of interface is also provided, including:
Receiving module, for receiving user name, interface name, internet protocol address and communication protocol;
Acquisition module, for obtaining the corresponding subscription of the communication protocol/registration Script template;
Subscription/Registering modules, for the user name, interface name, the IP address and the communication protocol to be added Into the subscription/registration Script template, interface corresponding to interface name subscribe to/register.
Optionally, in addition to:
Generation module, the test script of the interface is generated for the method according to above-mentioned test script;
Test module, is tested the interface for the test script using the interface;
Return to module, the test result for returning to the interface.
The embodiment of the present application is provided in a kind of generation method of test script, the subscription/register method and device of interface, this method, Obtain the original description information of interface to be tested;The selected classification of the interface to be tested is determined according to the original description information; For the field assignment of the selected classification;According to the value of the field of the selected classification, the original description information and described treat The corresponding test script template of communication protocol of test interface, generates the test script of the interface to be tested.In the program, The test script of interface to be tested can be automatically generated, is write without person skilled, even if the Field Count of interface to be tested Very many, the formation efficiency of test script is also very high, and greatly reduces error rate, it is to avoid field missing, mistake occur By mistake situations such as.
Brief description of the drawings
Accompanying drawing described herein is used for providing further understanding of the present application, constitutes the part of the application, the application's Schematic description and description is used to explain the application, does not constitute the improper restriction to the application.In the accompanying drawings:
Fig. 1 is a kind of flow chart of the generation method of test script in the embodiment of the present application;
The flow chart that Fig. 2 is S11 in the embodiment of the present application;
The flow chart that Fig. 3 is S12 in the embodiment of the present application;
The flow chart that Fig. 4 is S13 in the embodiment of the present application;
The flow chart that Fig. 5 is S14 in the embodiment of the present application;
Fig. 6 is a kind of flow chart of subscription/register method of interface in the embodiment of the present application;
Fig. 7 is a kind of structural representation of the generating means of test script in the embodiment of the present application;
Fig. 8 is a kind of structural representation of subscription/register device of interface in the embodiment of the present application.
Embodiment
In order that technical problems to be solved in this application, technical scheme and beneficial effect are clearer, clear, below in conjunction with Drawings and examples, the application is further elaborated.It should be appreciated that specific embodiment described herein is only To explain the application, it is not used to limit the application.
In order to which the efficiency for solving to write test script present in correlation technique is very low and the problem of very high error rate, this Shen Please embodiment a kind of generation method of test script is provided, this method can be, but not limited to be applied in server, this method Flow is as shown in figure 1, comprise the following steps:
S11:Obtain the original description information of interface to be tested.
At present, many systems are provided with multiple external interfaces for providing service, access center (Partner below with connecting platform Access Center, PAC) exemplified by illustrate.Multiple external interfaces for providing service can be set in PAC, and these connect Mouth is required to acceptance test, and the interface for being currently needed for acceptance test is interface to be tested.
Generally, each interface is required for defining many requests, response etc. field, original of these field records in each interface In beginning description information, therefore, it is necessary to obtain the original description information of corresponding interface when generating the test script of each interface, The original description information of each interface can be, but not limited to change (eXtensible using XSL Stylesheet Language Transformations, XSLT) language.
S12:The selected classification of interface to be tested is determined according to original description information.
The request object and response object of interface to be tested have affiliated classification, and these classifications are properly termed as interface to be tested Classification, due to being not that all categories of interface to be tested can participate in and generate the test script of interface to be tested, therefore, is needed A part of classification therefrom to be selected as the selected classification of interface to be tested.
S13:To select the field assignment of classification.
Each selected classification generally includes many fields, and can be followed successively by the field assignment of selected classification, correlation technique needs Want technical staff to be followed successively by the field assignment of these selected classifications, and can be realized in the embodiment of the present application automatically selected for these The field assignment of classification, so as to save substantial amounts of human resources, and greatly reduces error rate, it is to avoid field occur Situations such as missing, mistake.
S14:According to the corresponding test pin of the communication protocol of the value of the field of selected classification, original description information and interface to be tested This template, generates the test script of interface to be tested.
Each interface has the communication protocol of setting, can be specifically distributed service framework (High-Speed Service Framework, HSF) or HTTP (HyperText Transfer Protocol, HTTP) etc., can To preset the corresponding test script template of every kind of communication protocol, wherein, the communication protocol of interface to be tested can be defined as Communication protocol, then directly according to value, original description information and the corresponding test script of communication protocol of the field of selected classification The test script of template generation interface to be tested.
In the program, the test script of interface to be tested can be automatically generated, is write without person skilled, even if to be measured Try mouth Field Count it is very many, the formation efficiency of test script is also very high, and greatly reduces error rate, it is to avoid go out Situations such as existing field missing, mistake.
Each step of the above method is described in detail below.
Specifically, the implementation process of the original description information of interface to be tested is obtained in above-mentioned S11, as shown in Fig. 2 specifically Comprise the following steps:
S111:Obtain the interface name of interface to be tested.
When user needs to test some interface, the interface name of interface to be tested, first terminal can be inputted on first terminal The interface name that user is inputted is sent to server, and interface name is obtained by server.
S112:Being searched in corresponding relation from interface name with original description information includes the first list item of interface name.
The corresponding relation of interface name and original description information can be pre-set, all interface names are preserved in the corresponding relation And its corresponding original description information.After the interface name of interface to be tested is obtained, can be searched in the corresponding relation includes The list item of the interface name of interface to be tested, the list item can be defined as the first list item.
S113:If finding the first list item, the original description information in the first list item is obtained, the original of interface to be tested is obtained Beginning description information.
If finding the first list item, the original description information in the first list item is exactly the original description information of interface to be tested. The original description information for obtaining interface to be tested can be realized by S111-S113.
Specifically, the implementation process of the selected classification of interface to be tested, such as Fig. 3 are determined in above-mentioned S12 according to original description information It is shown, specifically include following steps:
S121:The corresponding request object of interface to be tested and response object are obtained from original description information in SDK Wrap the complete access path in (Software Development Kit, SDK).
S122:The classification and the class of response object of the request object of interface to be tested are obtained from SDK based on complete access path Not, the candidate categories of interface to be tested are obtained.
Because the original description information of interface to be tested includes asking the complete access path of object and response object in SDK, Therefore these complete access paths can be obtained from original description information, is then obtained again based on complete access path from SDK Take interface to be tested request object classification and response object classification, these classifications can as interface to be tested candidate Classification.
S123:The candidate categories of interface to be tested are defined as to the selected classification of interface to be tested;Or, obtain candidate categories Field, the candidate categories that field includes method attribute are defined as to the selected classification of interface to be tested.
It is determined that interface to be tested selected classification when, can use various ways, two ways is set forth below and illustrates. First way, all regard all candidate categories as the selected classification of interface to be tested;The second way, some candidate's classes Other field includes not including method attribute in method attribute, the field of some candidate categories, and each time can be determined one by one Whether include method attribute, then choosing field includes the candidate categories of method attribute as to be tested if selecting in the field of classification The selected classification of interface.
Specifically, being the implementation process of the field assignment of selected classification in above-mentioned S13, as shown in figure 4, specifically including as follows Step:
S131:The value of the field of selected classification is searched from field default value storehouse, if finding the value of the field of selected classification, Perform S132;If not finding the value of the field of selected classification, S133 is performed.
S132:Obtain the value of the field of selected classification.
S133:According to the value of the field of the self-defined selected class of the type of the field of selected classification.
Because the field that the PAC most of interfaces set are defined has certain rule and implication, therefore can be in advance in data Field default value storehouse is set in storehouse, for example, for order number, being defaulted as LBXxxxxxxx forms.
In the field assignment to select classification, the value of the field of selected classification can be inquired about first in field default value storehouse, If finding the value of the field of selected class, the value of the field of selected classification can be directly obtained;Due in field default value storehouse simultaneously Not necessarily include the value of the field of all selected classifications, therefore, if not finding the value of the field of selected classification, Ke Yigen The value of the type, the then field of self-defined selected classification of the field of selected classification is obtained according to original description information, for example, right In string types, the value of field can be customized for " string ", for value type, and the value of field can be with self-defined For " 0 ".
Specifically, according to the communication protocols of the value, original description information and interface to be tested of the field of selected classification in above-mentioned S14 Corresponding test script template is discussed, the implementation process of the test script of interface to be tested is generated, as shown in figure 5, specifically including Following steps:
S141:Obtain the communication protocol of interface to be tested.
The communication protocol of interface can be distributed service framework (High-Speed Service Framework, HSF) or HTTP (HyperText Transfer Protocol, HTTP) etc..
S142:Being searched from the corresponding relation of communication protocol and test script template includes the second list item of communication protocol.
The corresponding relation of communication protocol and test script template can be pre-set, all communications are preserved in the corresponding relation Agreement and its corresponding test script template., can be in the corresponding relation after the communication protocol of interface to be tested is got The list item for the communication protocol for including interface to be tested is searched, the list item can be defined as the second list item.
S143:If finding the second list item, the test script template in the second list item is obtained, communication protocol is obtained corresponding Test script template.
S144:The value of the field of selected classification, original description information are added in the corresponding test script template of communication protocol, Obtain the test script of interface to be tested.
Obtain after the corresponding test script template of communication protocol, the value of the field of selected classification, original description information can be added It is added in the template, so as to generate the test script of interface to be tested.
Optionally, the generation method of above-mentioned test script also includes:After completing to treat subscription/registration of test interface, use The test script of interface to be tested is treated test interface and tested;Return to the test result of interface to be tested.Due to be tested The test script of interface is without manually generated, so as to save the testing time, lifts testing efficiency.
The embodiment of the present application also provides a kind of subscription/register method of interface, and the flow of this method is as shown in fig. 6, specifically include Following steps:
S61:Receive user name, interface name, Internet protocol (Internet Protocol, IP) address and communication protocol.
Test script for each interface can be generated by S11-S14, when needing to test these interfaces, also Need in corresponding interface completes subscription/registration, correlation technique, it is necessary to which technical staff subscribe to/register, this is accomplished by The very familiar PAC of technical staff application method, and process known to technical staff generally requires consuming many time and essence Power, this, which is resulted in, can expend many human resources when interface carries out and subscribes to/register, the efficiency of reduction interface subscription/registration; Automatic subscription/registration of mouth and the embodiment of the present application can achieve a butt joint, so as to largely save human resources, is carried The efficiency of high interface subscription/registration.
Firstly, it is necessary to which user provides user name, interface name, IP address and communication protocol etc. information, user can be second Terminal inputs these information, and transmits these information to server by second terminal, and second terminal specifically can be by these Information carries and is sent to server in subscription/registration request.
S62:Obtain the corresponding subscription/registration Script template of communication protocol.
Because the corresponding subscription of each communication protocol/registration Script template is different, it is therefore desirable to obtain the corresponding subscription of communication protocol / registration Script template.
S63:User name, interface name, IP address and communication protocol are added in subscription/registration Script template, docking port name Corresponding interface subscribe to/register.
After subscription/registration of the corresponding interface of docking port name is completed, subscription/registration can be sent to second terminal and responded, from And can be tested in order to the corresponding interface of second terminal docking port name.
It should be noted that due on PAC can simultaneously to businessman and offering customers service, therefore above-mentioned first terminal and Second terminal can be the terminal of the terminal of businessman, i.e. service provider;Can also be the terminal of client, i.e. demand for services side Terminal.
In the program, it is possible to achieve automatic subscription/registration of docking port, carry out subscribing to/registering without person skilled, connect Subscription/registration efficiency of mouth is very high, and greatly reduces error rate, it is to avoid situations such as field missing, mistake occur.
Optionally, subscription/register method of above-mentioned interface, in addition to:The survey of interface is generated according to the method for above-mentioned test script Training sheet;Tested using the test script docking port of interface;Return to the test result of interface.Due to subscription/note of interface Volume and test script, so as to save subscription/hour of log-on and testing time, had both lifted subscription/note without manually generated Volume efficiency, lifts testing efficiency again.
Based on same inventive concept, the embodiment of the present application also provides a kind of generating means of test script, the device and such as Fig. 1 The generation method of shown test script is corresponding, can be, but not limited to be applied in server, structure such as 7 figures of the device It is shown, including acquisition module 71, determining module 72, assignment module 73 and generation module 74, wherein:
Above-mentioned acquisition module 71, the original description information for obtaining interface to be tested;
Above-mentioned determining module 72, the selected classification for determining interface to be tested according to original description information;
Above-mentioned assignment module 73, for the field assignment for selected classification;
Above-mentioned generation module 74, the communication for the value, original description information and interface to be tested of the field according to selected classification The corresponding test script template of agreement, generates the test script of interface to be tested.
In the program, the test script of interface to be tested can be automatically generated, is write without person skilled, even if to be measured Try mouth Field Count it is very many, the formation efficiency of test script is also very high, and greatly reduces error rate, it is to avoid go out Situations such as existing field missing, mistake.
Specifically, above-mentioned acquisition module 71, the original description information for obtaining interface to be tested, specifically for:
Obtain the interface name of interface to be tested;
Being searched in corresponding relation from interface name with original description information includes the first list item of interface name;
If finding the first list item, the original description information in the first list item is obtained, the original description of interface to be tested is obtained Information.
Specifically, above-mentioned determining module 72, the selected classification for determining interface to be tested according to original description information, specifically For:
Complete access road of the corresponding request object and response object of interface to be tested in SDK is obtained from original description information Footpath;
The classification and the classification of response object of the request object of interface to be tested are obtained from SDK based on complete access path, is obtained To the candidate categories of interface to be tested;
The candidate categories of interface to be tested are defined as to the selected classification of interface to be tested;Or, the field of candidate categories is obtained, The candidate categories that field includes method attribute are defined as to the selected classification of interface to be tested.
Specifically, above-mentioned assignment module 73, for select the field assignment of classification, specifically for:
The value of the field of selected classification is searched from field default value storehouse;
If finding the value of the field of selected classification, the value of the field of selected classification is obtained;
If not finding the value of the field of selected classification, according to the word of the self-defined selected classification of type of the field of selected classification The value of section.
Specifically, above-mentioned generation module 74, for the value of the field according to selected classification, original description information and to be measured try The corresponding test script template of communication protocol of mouth, generates the test script of interface to be tested, specifically for:
Obtain the communication protocol of interface to be tested;
Being searched from the corresponding relation of communication protocol and test script template includes the second list item of communication protocol;
If finding the second list item, the test script template in the second list item is obtained, the corresponding test pin of communication protocol is obtained This template;
The value of the field of selected classification, original description information are added in the corresponding test script template of communication protocol, obtained The test script of interface to be tested.
Optionally, the generation method of above-mentioned test script, in addition to:
Test module, for after completing to treat subscription/registration of test interface, being treated using the test script of interface to be tested Test interface is tested;
Return to module, the test result for returning to interface to be tested.
The embodiment of the present application also provides a kind of subscription/register device of interface, and the subscription of the device and interface as shown in Figure 6/ Register method is corresponding, can be, but not limited to be applied in server, and the structure of the device is as shown in figure 8, including receiving mould Block 81, acquisition module 82 and subscription/Registering modules 83, wherein:
Above-mentioned receiving module 81, for receiving user name, interface name, IP address and communication protocol;
Above-mentioned acquisition module 82, for obtaining the corresponding subscription of communication protocol/registration Script template;
Above-mentioned subscription/Registering modules 83, for user name, interface name, IP address and communication protocol to be added into subscription/registration In script template, the corresponding interface of docking port name subscribe to/register.
In the program, it is possible to achieve automatic subscription/registration of docking port, carry out subscribing to/registering without person skilled, connect Subscription/registration of mouth is very high, and greatly reduces error rate, it is to avoid situations such as field missing, mistake occur.
Optionally, subscription/register device of above-mentioned interface also includes:
Generation module, the test script of interface is generated for the generation method according to above-mentioned test script;
Test module, for being tested using the test script docking port of interface;
Return to module, the test result for returning to interface.
The preferred embodiment of the application has shown and described in described above, but as previously described, it should be understood that the application not limits to In form disclosed herein, be not to be taken as the exclusion to other embodiment, and available for various other combinations, modification and Environment, and can be changed in invention contemplated scope described herein by the technology or knowledge of above-mentioned teaching or association area It is dynamic., then all should be appended by the application and the change and change that those skilled in the art are carried out do not depart from spirit and scope In scope of the claims.

Claims (16)

1. a kind of generation method of test script, it is characterised in that including:
Obtain the original description information of interface to be tested;
The selected classification of the interface to be tested is determined according to the original description information;
For the field assignment of the selected classification;
It is corresponding with the communication protocol of the interface to be tested according to the value of the field of the selected classification, the original description information Test script template, generate the test script of the interface to be tested.
2. the method as described in claim 1, it is characterised in that obtain the original description information of interface to be tested, specific bag Include:
Obtain the interface name of interface to be tested;
Being searched in corresponding relation from interface name with original description information includes the first list item of the interface name;
If finding first list item, the original description information in first list item is obtained, described to be measured try is obtained The original description information of mouth.
3. the method as described in claim 1, it is characterised in that determine described to be measured try according to the original description information The selected classification of mouth, is specifically included:
The corresponding request object of the interface to be tested and response object are obtained from the original description information in software development work Complete access path in tool bag SDK;
Classification and the response pair of the request object of the interface to be tested are obtained from the SDK based on the complete access path The classification of elephant, obtains the candidate categories of the interface to be tested;
The candidate categories of the interface to be tested are defined as to the selected classification of the interface to be tested;Or, obtain described wait The field of classification is selected, the candidate categories that field includes method attribute are defined as to the selected classification of the interface to be tested.
4. the method as described in claim 1, it is characterised in that be the field assignment of the selected classification, specifically include:
The value of the field of the selected classification is searched from field default value storehouse;
If finding the value of the field of the selected classification, the value of the field of the selected classification is obtained;
If not finding the value of the field of the selected classification, according to the type of the field of the selected classification is self-defined The value of the field of selected classification.
5. the method as described in claim 1, it is characterised in that according to the value of the field of the selected classification, described original Description information and the corresponding test script template of the communication protocol of the interface to be tested, generate the test of the interface to be tested Script, is specifically included:
Obtain the communication protocol of the interface to be tested;
Being searched from the corresponding relation of communication protocol and test script template includes the second list item of the communication protocol;
If finding second list item, the test script template in second list item is obtained, the communication protocol is obtained Corresponding test script template;
The value of the field of the selected classification, the original description information are added to the corresponding test script of the communication protocol In template, the test script of the interface to be tested is obtained.
6. the method as described in claim 1-5 is any, it is characterised in that also include:
After subscription/registration to the interface to be tested is completed, using the test script of the interface to be tested to described to be measured Mouth of trying is tested;
Return to the test result of the interface to be tested.
7. a kind of subscription/register method of interface, it is characterised in that including:
Receive user name, interface name, internet protocol address and communication protocol;
Obtain the corresponding subscription of the communication protocol/registration Script template;
The user name, interface name, the IP address and the communication protocol are added to the subscription/registration Script In template, interface corresponding to interface name subscribe to/register.
8. method as claimed in claim 7, it is characterised in that also include:
The test script of the interface is generated according to the method described in claim 1-5;
The interface is tested using the test script of the interface;
Return to the test result of the interface.
9. a kind of generating means of test script, it is characterised in that including:
Acquisition module, the original description information for obtaining interface to be tested;
Determining module, the selected classification for determining the interface to be tested according to the original description information;
Assignment module, for the field assignment for the selected classification;
Generation module, value, the original description information and the interface to be tested for the field according to the selected classification The corresponding test script template of communication protocol, generate the test script of the interface to be tested.
10. device as claimed in claim 9, it is characterised in that the acquisition module, for obtaining interface to be tested Original description information, specifically for:
Obtain the interface name of interface to be tested;
Being searched in corresponding relation from interface name with original description information includes the first list item of the interface name;
If finding first list item, the original description information in first list item is obtained, described to be measured try is obtained The original description information of mouth.
11. device as claimed in claim 9, it is characterised in that the determining module, for according to the original description Information determines the selected classification of the interface to be tested, specifically for:
The corresponding request object of the interface to be tested and response object are obtained from the original description information in software development work Complete access path in tool bag SDK;
Classification and the response pair of the request object of the interface to be tested are obtained from the SDK based on the complete access path The classification of elephant, obtains the candidate categories of the interface to be tested;
The candidate categories of the interface to be tested are defined as to the selected classification of the interface to be tested;Or, obtain described wait The field of classification is selected, the candidate categories that field includes method attribute are defined as to the selected classification of the interface to be tested.
12. device as claimed in claim 9, it is characterised in that the assignment module, for for the selected classification Field assignment, specifically for:
The value of the field of the selected classification is searched from field default value storehouse;
If finding the value of the field of the selected classification, the value of the field of the selected classification is obtained;
If not finding the value of the field of the selected classification, according to the type of the field of the selected classification is self-defined The value of the field of selected classification.
13. device as claimed in claim 9, it is characterised in that the generation module, for according to the selected classification Field the corresponding test script template of value, the communication protocol of the original description information and the interface to be tested, generation The test script of the interface to be tested, specifically for:
Obtain the communication protocol of the interface to be tested;
Being searched from the corresponding relation of communication protocol and test script template includes the second list item of the communication protocol;
If finding second list item, the test script template in second list item is obtained, the communication protocol is obtained Corresponding test script template;
The value of the field of the selected classification, the original description information are added to the corresponding test script of the communication protocol In template, the test script of the interface to be tested is obtained.
14. the device as described in claim 9-13 is any, it is characterised in that also include:
Test module, for after subscription/registration to the interface to be tested is completed, using the test of the interface to be tested Script is tested the interface to be tested;
Return to module, the test result for returning to the interface to be tested.
15. a kind of subscription/register device of interface, it is characterised in that including:
Receiving module, for receiving user name, interface name, internet protocol address and communication protocol;
Acquisition module, for obtaining the corresponding subscription of the communication protocol/registration Script template;
Subscription/Registering modules, for the user name, interface name, the IP address and the communication protocol to be added Into the subscription/registration Script template, interface corresponding to interface name subscribe to/register.
16. device as claimed in claim 15, it is characterised in that also include:
Generation module, the test script for generating the interface according to the method described in claim 1-5;
Test module, is tested the interface for the test script using the interface;
Return to module, the test result for returning to the interface.
CN201610201871.9A 2016-03-31 2016-03-31 Test script generation method, interface subscription/registration method and device Active CN107291608B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610201871.9A CN107291608B (en) 2016-03-31 2016-03-31 Test script generation method, interface subscription/registration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610201871.9A CN107291608B (en) 2016-03-31 2016-03-31 Test script generation method, interface subscription/registration method and device

Publications (2)

Publication Number Publication Date
CN107291608A true CN107291608A (en) 2017-10-24
CN107291608B CN107291608B (en) 2021-01-26

Family

ID=60087574

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610201871.9A Active CN107291608B (en) 2016-03-31 2016-03-31 Test script generation method, interface subscription/registration method and device

Country Status (1)

Country Link
CN (1) CN107291608B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109240923A (en) * 2018-08-31 2019-01-18 福建天泉教育科技有限公司 The generation method and computer readable storage medium of interface testing script
CN109710537A (en) * 2019-01-02 2019-05-03 郑州云海信息技术有限公司 A kind of intelligent automation test method and system
CN109815107A (en) * 2017-11-22 2019-05-28 北京京东尚科信息技术有限公司 The method and apparatus of automatic test
CN110955600A (en) * 2019-11-27 2020-04-03 中国银行股份有限公司 Interface test method and device
CN111435227A (en) * 2018-12-25 2020-07-21 中移(杭州)信息技术有限公司 Smart home equipment testing method, device, equipment and medium
CN113572833A (en) * 2021-07-21 2021-10-29 北京百度网讯科技有限公司 Cloud mobile phone maintenance method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001093043A1 (en) * 2000-03-27 2001-12-06 Accenture Llp System, method, and article of manufacture for an automated scripting solution for enterprise testing
CN102694701A (en) * 2012-06-13 2012-09-26 青岛海信传媒网络技术有限公司 Testing method and system based on message
CN103995720A (en) * 2014-05-22 2014-08-20 广东威创视讯科技股份有限公司 Method and device for achieving centralized visual display control on mosaic wall system
CN102550054B (en) * 2009-09-30 2015-06-17 阿尔卡特朗讯公司 Registration notification for SMS over LTE

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001093043A1 (en) * 2000-03-27 2001-12-06 Accenture Llp System, method, and article of manufacture for an automated scripting solution for enterprise testing
CN102550054B (en) * 2009-09-30 2015-06-17 阿尔卡特朗讯公司 Registration notification for SMS over LTE
CN102694701A (en) * 2012-06-13 2012-09-26 青岛海信传媒网络技术有限公司 Testing method and system based on message
CN103995720A (en) * 2014-05-22 2014-08-20 广东威创视讯科技股份有限公司 Method and device for achieving centralized visual display control on mosaic wall system

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815107A (en) * 2017-11-22 2019-05-28 北京京东尚科信息技术有限公司 The method and apparatus of automatic test
CN109815107B (en) * 2017-11-22 2022-06-07 北京京东尚科信息技术有限公司 Method and device for automatic testing
CN109240923A (en) * 2018-08-31 2019-01-18 福建天泉教育科技有限公司 The generation method and computer readable storage medium of interface testing script
CN109240923B (en) * 2018-08-31 2021-06-04 福建天泉教育科技有限公司 Interface test script generation method and computer readable storage medium
CN111435227A (en) * 2018-12-25 2020-07-21 中移(杭州)信息技术有限公司 Smart home equipment testing method, device, equipment and medium
CN111435227B (en) * 2018-12-25 2023-07-21 中移(杭州)信息技术有限公司 Smart home equipment testing method, device, equipment and medium
CN109710537A (en) * 2019-01-02 2019-05-03 郑州云海信息技术有限公司 A kind of intelligent automation test method and system
CN110955600A (en) * 2019-11-27 2020-04-03 中国银行股份有限公司 Interface test method and device
CN110955600B (en) * 2019-11-27 2023-11-10 中国银行股份有限公司 Interface testing method and device
CN113572833A (en) * 2021-07-21 2021-10-29 北京百度网讯科技有限公司 Cloud mobile phone maintenance method and device, electronic equipment and storage medium
CN113572833B (en) * 2021-07-21 2024-05-14 北京百度网讯科技有限公司 Cloud mobile phone maintenance method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN107291608B (en) 2021-01-26

Similar Documents

Publication Publication Date Title
CN107291608A (en) The generation method of test script, subscription/register method of interface and device
RU2648966C2 (en) Apparatus and method for processing multiple open api
CN102694857B (en) Method and apparatus for giving over data networks
US10678516B2 (en) Chatbot builder user interface
CN108574604B (en) Test method and device
CN105099811A (en) Interface testing method and device
CN101193007A (en) Testing method, scenario testing method and corresponding device for URL command
CN110798380B (en) Data acquisition method, system, device, test equipment and test server
CN109726108B (en) Front-end code testing method, device, system and medium based on analog data
US11263542B2 (en) Technologies for auto discover and connect to a rest interface
CN109726098A (en) Interface test method, device and computer readable storage medium
CN106682949A (en) Service recommending method and service information receiving method, device and system
CN113227976A (en) Methods, systems, and computer readable media for data transformation using representational state transfer (REST) Application Programming Interfaces (APIs)
CN107463453A (en) Method, apparatus, equipment and the storage medium to be communicated between same terminal different application
US11797271B2 (en) Dynamic web-based integrated development environment
CN107171889A (en) Network application interface test method and device and electronic equipment
CN106658666A (en) Method and device for building wireless connection
US20170272318A1 (en) Dynamic product installation based on user feedback
CN103248654A (en) Negotiation method, device and system for virtual desktop service parameters
CN106998277A (en) Web service method of testing and device
CN105955790A (en) Data processing method and apparatus
US11470167B2 (en) Method and apparatus for generating information
US20230252242A1 (en) Question based chatbot generator from api specifications
CN105703964A (en) Online application system test method and equipment
CN107483294A (en) Monitor the method and device of network request

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20180411

Address after: Four story 847 mailbox of the capital mansion of Cayman Islands, Cayman Islands, Cayman

Applicant after: CAINIAO SMART LOGISTICS HOLDING Ltd.

Address before: Grand Cayman, Cayman Islands

Applicant before: ALIBABA GROUP HOLDING Ltd.

GR01 Patent grant
GR01 Patent grant