Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and ExamplesThe present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, andIt is not used in the restriction present invention.
Fig. 1 is the applied environment figure of interface test method in one embodiment.Reference picture 1, the interface test method applicationIn interface test system.Interface test system includes terminal 110 and server 120, and wherein terminal 110 passes through network and server120 connections.Terminal 110 can be fixed terminal or mobile terminal, and fixed terminal can be specifically printer, scanner and monitoringAt least one of device, mobile terminal can be specifically in tablet personal computer, smart mobile phone, personal digital assistant and digital cameraIt is at least one.
As shown in Fig. 2 in one embodiment, there is provided a kind of interface test method, the present embodiment are applied in this wayServer 120 in Fig. 1 comes for example, this method specifically includes herein below:
S202, obtain interface testing instruction.
Specifically, the interface testing configuration page is shown in terminal 110, user can be defeated in interface testing configures the pageEnter test case configuration information, user clicks on the configuration in the interface testing configuration page by the input equipment of terminal 110 and completedButton.Terminal 110 obtains interface testing configuration when the configuration completing button in detecting the interface testing configuration page is clickedThe test case configuration information inputted in the page, interface testing instruction is generated according to test case configuration information.Wherein, test is usedExample configuration information identifies including test case, and the test case mark extracted can be one or more.Terminal 110 will generateInterface testing instruction send to server 120.
S204, the precondition information that the test case mark inquired about in being instructed with interface testing associates.
Wherein, test case library is provided with server 120, test case template, interface are stored with test case libraryMessaging parameter and precondition information.Test case template is the template of generation test case;Interface communication parameter interface to be measuredCorresponding messaging parameter, it can specifically include in interface communications protocol type, interface communication pattern and data transmission format extremelyFew one kind;The information or parameter that precondition information needs before for the current test case of execution.User is defeated by terminal 110The precondition information of configuration association can be identified in interface testing configures the page for test case by entering equipment.Server 120The precondition that test case can be identified to precondition information associated with it identifies corresponding be stored in test case.
Specifically, after interface testing instruction is got, docking port test instruction is parsed server 120, passes through solutionTest case mark in analysis extraction interface testing instruction, identifies according to the test case extracted and is inquired about in test case libraryWith the presence or absence of the precondition information of association.
In one embodiment, server 120 can inquire about inquiry with the presence or absence of corresponding with the test case mark extractedPrecondition mark, identified if inquiring corresponding with the test mark extracted precondition, then it represents that association be presentPrecondition information;If precondition mark corresponding with the test case mark extracted is not inquired, then it represents that do not depositIn the precondition information of association.
S206, according to use-case parameter information to be measured corresponding to precondition acquisition of information test case mark.
Specifically, use-case parameter letter to be measured corresponding to the test case mark extracted is included in precondition informationBreath.Server 120 is carried out when inquiring the test case corresponding precondition information of mark with extracting to preconditionParsing, to be measured use-case parameter information of the extraction with test case mark to drink.
In one embodiment, server 120 is inquiring the corresponding precondition of test case mark with extractingMark, according to the precondition mark inquiry precondition information inquired, extract the data query bar in preposition long narrow table informationPart.Wherein, data query conditions include Data Identification and database address.Number of the server 120 in data query conditionsDatabase connection is established according to storehouse address, the data according to corresponding to database connection inquires about Data Identification from database, with inquiryTo data identify corresponding use-case parameter information to be measured as with test case.
S208, obtained and the corresponding use-case template to be measured of test case mark and interface communication to be measured from test case libraryParameter.
Specifically, server 120 is looked into after test case mark is extracted in being instructed from interface testing in test case libraryAsk and the corresponding use-case template to be measured of test case mark extracted and interface communication parameter to be measured.
In one embodiment, server 120 is inquired about corresponding with the test case mark extracted in test case libraryUse-case template to be measured, from use-case template to be measured extract messaging parameter mark, according to the messaging parameter of extraction mark testingQuery interface messaging parameter in use-case.
S210, according to use-case parameter information to be measured and use-case template generation to be measured interface testing use-case to be measured.
Specifically, interface testing use-case to be measured is the test case for being tested interface to be measured.Use-case ginseng to be measuredNumber information includes required parameter information, return parameters information and expected test result, and use-case template to be measured is believed for test sceneBreath.Server 120 is merged according to use-case parameter information to be measured and use-case template to be measured, and test case mark is obtained by mergingTest case corresponding to knowledge.
In one embodiment, when the test case extracted is identified with multiple, server 120 is according to each test caseThe precondition acquisition of information use-case parameter information to be measured of association is identified, and each test case mark is obtained from test case libraryUse-case template to be measured corresponding to knowledge, merged according to use-case parameter to be measured and use-case template to be measured corresponding to each test case markGenerate interface testing use-case to be measured corresponding to each test case mark difference.
S212, according to interface testing use-case to be measured and interface communication parameter to be measured, to be measured in interface testing use-case to be measuredInterface to be measured corresponding to interface IP address is tested.
Specifically, server 120 extracts the test information in interface testing use-case to be measured and interface IP address to be measured, according to treatingSurvey interface communication parameter to be packaged the test information extracted, the test information after encapsulation is sent to what is extracted to be measuredInterface to be measured corresponding to interface IP address, to be tested according to the test information after encapsulation interface to be measured.
In one embodiment, server 120 is with extracting test information and the interface to be measured in interface testing use-case to be measuredLocation, interface testing to be measured is generated according to interface communication parameter to be measured and the test information extracted and asked, by interface testing to be measuredRequest is sent to interface to be measured corresponding to the interface IP address to be measured extracted, and interface to be measured is tested.
In the present embodiment, in interface test process, before test case corresponding to implementation of test cases mark, according toPrecondition acquisition of information use-case parameter information to be measured, given birth to according to the use-case parameter information to be measured got and use-case template to be measuredInto interface testing use-case to be measured, and according to interface testing use-case to be measured and interface communication parameter to be measured, to interface testing to be measured.NothingThe test case content of other interfaces associated with interface to be measured need to be write in interface testing use-case to be measured, only need to pass through surveyExample mark on probation and precondition information association, save repetition and write time spent by test case content, so as toImprove the testing efficiency for carrying out automatic test to interface to be measured according to test case.
As shown in figure 3, in one embodiment, the step of generation interface testing instructs, the step are specifically included before S202Suddenly herein below is specifically included:
S302, the test time started in monitoring and test plan information.
Wherein, test plan information is input equipment of the user by terminal 110, in the interface testing that terminal 110 is shownConfigure the test plan information of the input in the page.Terminal 110 sends the test plan information of input to server 120.ClothesThe test plan information that terminal 110 is sent can be stored in test case library by business device 120.Test plan information includes testTime and test case logo collection are performed, the test execution time includes test time started and test end time;Test is usedExample logo collection includes at least one test case mark.
Specifically, test plan information is store in the test case library of server 120, test plan information includes surveyingExamination performs time, test loop number and test case logo collection.The test that server 120 is obtained in test plan information is heldWhether row time, the extraction test time started from the test execution time, monitoring current time are equal to the test time started.
In one embodiment, test case library includes multiple test plan information.Server 120 periodically obtains currentIt is time, current to monitor by the current time got compared with the test time started in each test plan informationWhether the time is identical with the test time started.
S304, when monitor current time with test the time started it is identical when, from test plan information extract test openBegin test case mark corresponding to the time.
Specifically, server 120 monitor by current time with test the time started it is identical when, from the test time startedRead test use-case logo collection in corresponding test plan information, extract the test case mark in test case logo collectionKnow.
S306, interface testing to be measured is generated according to the test case mark extracted and instructed.
Specifically, server 120 seals after test case mark is extracted to the test case mark extractedDress, interface testing instruction to be measured is generated by encapsulating.
In the present embodiment, by the monitoring to the test time started in each test plan information, when monitoring currentBetween be equal to test the time started, according to corresponding to the test time started test plan information generation interface testing instruction, withoutTriggering interface testing instruction manually, reduces manually-operated intervention.Corresponding interface can be generated according to test plan informationTest instruction, improve the convenience of generation interface testing instruction.
As shown in figure 4, in one embodiment, S206 specifically includes the step of performing testing advanced use-case, step toolBody includes herein below:
S402, preposition use-case generation information corresponding with precondition information, preposition use-case are obtained from test case libraryTemplate and front interface messaging parameter.
Specifically, preposition use-case generation information, preposition use-case template, front interface messaging parameter and preposition bar conditional informationIt is corresponding to be stored in test case library.Server 120 is inquiring the corresponding precondition of test case mark with extractingAfter information, inquired about from test case library preposition use-case corresponding with precondition information generate information, preposition use-case template andFront interface messaging parameter.
In one embodiment, server 120 extracts preposition use-case generation information and preposition use from preposition conditional informationExample template identification, inquires about preposition use-case template corresponding with the preposition use-case template identification extracted in test case library, fromInterface parameters mark is extracted in preposition use-case template, inquiry and the corresponding front interface of interface parameters mark in test case libraryMessaging parameter.
S404, information and the preposition testing advanced use-case of use-case template generation are generated according to preposition use-case.
Specifically, preposition use-case generation information includes preposition required parameter information, preposition return parameters information and prepositionExpected test result, preposition use-case template are preposition scene information.Server 120 generates information and preposition use according to preposition use-caseExample template is merged, and testing advanced use-case is obtained by merging.
S406, testing advanced use-case is performed according to front interface messaging parameter, obtained to be measured corresponding to test case markUse-case parameter information.
Specifically, server 120 extracts the front interface address in testing advanced use-case, according to front interface messaging parameterTesting advanced use-case is packaged, sent the testing advanced use-case after encapsulation to front interface according to front interface address,Front interface is performed testing advanced use-case, and use-case to be measured corresponding with test case mark is generated according to testing advanced use-caseParameter information.The use-case parameter information to be measured that the interface front interface of server 120 returns.
In the present embodiment, when inquiring the precondition information of association, generated according to precondition information testing advancedUse-case, front interface is tested according to the testing advanced use-case of generation, obtain front interface and returned according to testing advanced use-caseThe corresponding use-case parameter information to be measured of test case mark returned, ensure that the accuracy of use-case parameter to be measured.
As shown in figure 5, in one embodiment, S406 specifically includes the step of obtaining use-case parameter information to be measured, the stepSuddenly herein below is specifically included:
S502, according to testing advanced use-case and front interface messaging parameter, to front interface address in testing advanced use-caseCorresponding front interface is tested, and obtains the parameter information that front interface returns.
Specifically, server 120 extracts the front interface address in testing advanced use-case, extracts front interface messaging parameterIn interface communications protocol type, interface communication pattern and interface data transmission form, according to the interface communications protocol extractedType, interface communication pattern and interface data transmission form encapsulate to testing advanced use-case, obtain front interface test request.ClothesBusiness device 120 sends front interface test request to front interface address, and interface front interface is according to front interface test requestThe parameter information of return.
S504, detect in precondition information and whether there is data query conditions.
Specifically, data query conditions include database address, Data Identification and data query sentence.Precondition informationIn may also include data query conditions.Server 120 is determined whether there is by the data query mark in preposition long narrow table informationData query conditions.
S506, if detecting in precondition information data query conditions be present, according to data query conditions from databaseMiddle inquiry data.
Specifically, server 120 is believed when data query conditions be present in detecting precondition information from preconditionData query conditions are extracted in breath.Database address of the server 120 in data query conditions is connected with Database,Data corresponding with Data Identification are inquired about from database by connecting according to data query sentence.
S508, with the parameter information got and the data inquired, as use-case to be measured corresponding to test case markParameter information.
Specifically, will after server 120 obtains the parameter information of front interface return and inquires data from databaseThe parameter information got and the data inquired merge into use-case parameter information to be measured corresponding to test case mark.
, can be according in precondition information after the parameter information of front interface return is got in the present embodimentData query conditions data are inquired about from database, used according to the parameter information that gets and the data inquired generation testUse-case parameter information to be measured corresponding to example mark, improve the acquisition efficiency of use-case parameter information to be measured.
As shown in fig. 6, in one embodiment, S212 specifically includes the step of testing interface to be measured, and the step is specifically wrappedInclude herein below:
S602, extract interface communications protocol type, interface communication pattern and interface data in interface communication parameter to be measuredTransformat.
Wherein, interface communication parameter to be measured includes interface communications protocol type, interface communication pattern and interface data biographyTransport format.The communication protocol that interface communications protocol type is supported by interface to be tested;Interface communication pattern is interface to be testedThe communication protocol supported;Interface data transmission form is the data transmission format that interface to be tested can be parsed and supported.
Specifically, server 120 parses to interface communication parameter to be measured, is carried by parsing from interface communication parameterTake interface communications protocol type, interface communication pattern and interface data transmission form.
S604, according to interface communications protocol type, interface communication pattern, interface data transmission form and interface testing to be measuredUse-case generates interface testing request to be measured.
Specifically, server 120 leads to interface testing use-case to be measured according to the interface communications protocol type extracted, interfaceLetter pattern and interface data transmission form are packaged, and encapsulation obtains the interface testing to be measured request that interface to be measured is supported.
S606, asked according to interface testing to be measured to be measured corresponding to interface IP address to be measured in interface testing use-case to be measuredInterface is tested.
Specifically, interface testing use-case to be measured includes interface IP address to be measured, interface IP address to be measured be interface to be measured onlyOne mark.Server 120 extracts interface IP address to be measured from interface testing use-case to be measured, is connect according to interface IP address to be measured by be measuredMouth test request is sent to interface to be measured, to test interface to be measured.
In the present embodiment, without considering to write interface testing use-case to be measured, direct root according to the interface type of interface to be measuredIt is packaged according to the interface communications protocol type in interface communication parameter to be measured, interface communication pattern and interface data transmission formInterface testing use-case to be measured is encapsulated, the interface testing to be measured request that interface to be tested is supported is generated, ensure that and connect according to be measuredSuccess rate of the mouth test request to interface testing to be measured.
As shown in fig. 7, in one embodiment, there is provided a kind of interface test device 700, the device are specifically included in followingHold:Test instruction acquisition module 702, precondition enquiry module 704, parameter information acquisition module 706, use-case module and obtain mouldBlock 708, Test cases technology module 710 and interface testing module 712 to be measured.
Instruction acquisition module 702 is tested, for obtaining interface testing instruction.
Precondition enquiry module 704, the test case mark for inquiring about in being instructed with interface testing associate prepositionConditional information.
Parameter information acquisition module 706, for the use to be measured according to corresponding to precondition acquisition of information test case markExample parameter information.
Use-case module acquisition module 708, for obtaining use to be measured corresponding with test case mark from test case libraryExample template and interface communication parameter to be measured.
Test cases technology module 710, for according to use-case parameter information to be measured and use-case template generation to be measured is to be measured connectsMouth test case.
Interface testing module 712 to be measured, for according to interface testing use-case to be measured and interface communication parameter to be measured, to be measuredInterface to be measured in interface testing use-case corresponding to interface IP address to be measured is tested.
In the present embodiment, in interface test process, before test case corresponding to implementation of test cases mark, according toPrecondition acquisition of information use-case parameter information to be measured, given birth to according to the use-case parameter information to be measured got and use-case template to be measuredInto interface testing use-case to be measured, and according to interface testing use-case to be measured and interface communication parameter to be measured, to interface testing to be measured.NothingThe test case content of other interfaces associated with interface to be measured need to be write in interface testing use-case to be measured, only need to pass through surveyExample mark on probation and precondition information association, save repetition and write time spent by test case content, so as toImprove the testing efficiency for carrying out automatic test to interface to be measured according to test case.
As shown in figure 8, in one embodiment, test case library includes multiple test plan information, test instruction obtainsHerein below is specifically included before modulus block 702:Test plan monitoring modular 714, use-case marker extraction module 716 and test refer toMake generation module 718.
Test plan monitoring modular 714, for the test time started in monitoring and test plan information.
Use-case marker extraction module 716, for when monitor current time with test the time started it is identical when, from testerDraw test case mark corresponding to the extraction test time started in information.
Directive generation module 718 is tested, for generating interface testing instruction to be measured according to the test case mark extracted.
In the present embodiment, by the monitoring to the test time started in each test plan information, when monitoring currentBetween be equal to test the time started, according to corresponding to the test time started test plan information generation interface testing instruction, withoutTriggering interface testing instruction manually, reduces manually-operated intervention.Corresponding interface can be generated according to test plan informationTest instruction, improve the convenience of generation interface testing instruction.
As shown in figure 9, in one embodiment, parameter information acquisition module 706 specifically includes herein below:Leading informationEnquiry module 706a, preposition use-case generation module 706b and use-case gain of parameter module 706c.
Leading information enquiry module 706a, for obtaining preposition use corresponding with precondition information from test case libraryExample generation information, preposition use-case template and front interface messaging parameter.
Preposition use-case generation module 706b, for generating information and the preposition preposition survey of use-case template generation according to preposition use-caseExample on probation.
Use-case gain of parameter module 706c, for performing testing advanced use-case according to front interface messaging parameter, surveyedUse-case parameter information to be measured corresponding to example mark on probation.
In the present embodiment, when inquiring the precondition information of association, generated according to precondition information testing advancedUse-case, front interface is tested according to the testing advanced use-case of generation, obtain front interface and returned according to testing advanced use-caseThe corresponding use-case parameter information to be measured of test case mark returned, ensure that the accuracy of use-case parameter to be measured.
In one embodiment, use-case gain of parameter module 706c also has and led according to testing advanced use-case and front interfaceBelieve parameter, front interface corresponding to front interface address in testing advanced use-case is tested, obtain what front interface returnedParameter information;It whether there is data query conditions in detection precondition information;If detect in precondition information number be presentAccording to querying condition, data are inquired about from database according to data query conditions;With the parameter information got and the number inquiredAccording to as use-case parameter information to be measured corresponding to test case mark.
, can be according in precondition information after the parameter information of front interface return is got in the present embodimentData query conditions data are inquired about from database, used according to the parameter information that gets and the data inquired generation testUse-case parameter information to be measured corresponding to example mark, improve the acquisition efficiency of use-case parameter information to be measured.
In one embodiment, interface testing module 712 to be measured is additionally operable to extract the interface in interface communication parameter to be measuredCommunication protocol type, interface communication pattern and interface data transmission form;According to interface communications protocol type, interface communication mouldFormula, interface data transmission form and interface testing use-case to be measured generate interface testing request to be measured;Please according to interface testing to be measuredAsk and the interface to be measured corresponding to interface IP address to be measured in interface testing use-case to be measured is tested.
In the present embodiment, without considering to write interface testing use-case to be measured, direct root according to the interface type of interface to be measuredIt is packaged according to the interface communications protocol type in interface communication parameter to be measured, interface communication pattern and interface data transmission formInterface testing use-case to be measured is encapsulated, the interface testing to be measured request that interface to be tested is supported is generated, ensure that and connect according to be measuredSuccess rate of the mouth test request to interface testing to be measured.
Figure 10 is the internal structure schematic diagram of the server 120 in Fig. 1 interface test systems in one embodiment.Such as Figure 10Shown, the server 120 includes connecing by processor, non-volatile memory medium, memory and the network that system bus connectsMouthful.The processor of server 120 is used to provide calculating and control ability, supports the operation of whole server 120, memory is used forData storage, code command etc., network interface are used to carry out network service with terminal 110.It is stored with memory at least oneComputer program, the computer program can be executed by processor, to realize that what is provided in the embodiment of the present application is applied to server120 interface test method.Memory may include magnetic disc, CD, read-only memory (Read-Only Memory, ROM)Deng non-volatile memory medium.For example, in one embodiment, memory includes non-volatile memory medium and built-in storage;Non-volatile memory medium is stored with operating system, database and computer program, and test case library is provided with database, shouldComputer program can be executed by processor to realize above-mentioned interface test method;Built-in storage is in non-volatile memory mediumOperating system and computer executable instructions provide cache running environment.
The embodiment of the present invention proposes a kind of computer equipment, and the computer equipment includes a series of be stored on memoryComputer program, when the computer program is executed by processor, it is possible to achieve various embodiments of the present invention propose declaration form match somebody with somebodySend method for allocating tasks.In certain embodiments, the specific operation realized based on the computer program each several part.
In one embodiment, computer equipment includes memory, processor and is stored on the memory and can beThe computer program run on the processor, following steps are realized during computer program described in the computing device:ObtainInterface testing instructs;The precondition information that the test case mark inquired about in being instructed with interface testing associates;According to preposition barUse-case parameter information to be measured corresponding to part acquisition of information test case mark;Obtain from test case library and identified with test caseCorresponding use-case template to be measured and interface communication parameter to be measured;Treated according to use-case parameter information to be measured and use-case template generation to be measuredSurvey interface testing use-case;According to interface testing use-case to be measured and interface communication parameter to be measured, to being treated in interface testing use-case to be measuredThe interface to be measured corresponding to interface IP address is surveyed to be tested.
In one embodiment, test case library includes multiple test plan information, before obtaining interface testing instruction,Described in the computing device following steps are realized during computer program:The test time started in monitoring and test plan information;When monitoring that current time is identical with the test time started, the survey corresponding to the extraction test time started from test plan informationExample mark on probation;Test case mark according to extracting generates interface testing instruction to be measured.
In one embodiment, the use-case parameter letter to be measured according to corresponding to precondition acquisition of information test case markBreath, including:Obtained from test case library preposition use-case corresponding with precondition information generate information, preposition use-case template andFront interface messaging parameter;Information and the preposition testing advanced use-case of use-case template generation are generated according to preposition use-case;According to prepositionInterface communication parameter performs testing advanced use-case, obtains use-case parameter information to be measured corresponding to test case mark.
In one embodiment, testing advanced use-case is performed according to front interface messaging parameter, obtains test case markCorresponding use-case parameter information to be measured, including:According to testing advanced use-case and front interface messaging parameter, to testing advanced use-caseFront interface corresponding to middle front interface address is tested, and obtains the parameter information that front interface returns;Detect preconditionIt whether there is data query conditions in information;If detecting in precondition information data query conditions be present, looked into according to dataInquiry condition inquires about data from database;With the parameter information got and the data inquired, as test case mark pairThe use-case parameter information to be measured answered.
In one embodiment, according to interface testing use-case to be measured and interface communication parameter to be measured, to interface testing to be measuredInterface to be measured in use-case corresponding to interface IP address to be measured is tested, including:Extract the interface in interface communication parameter to be measuredCommunication protocol type, interface communication pattern and interface data transmission form;According to interface communications protocol type, interface communication mouldFormula, interface data transmission form and interface testing use-case to be measured generate interface testing request to be measured;Please according to interface testing to be measuredAsk and the interface to be measured corresponding to interface IP address to be measured in interface testing use-case to be measured is tested.
In the present embodiment, in interface test process, before test case corresponding to implementation of test cases mark, according toPrecondition acquisition of information use-case parameter information to be measured, given birth to according to the use-case parameter information to be measured got and use-case template to be measuredInto interface testing use-case to be measured, and according to interface testing use-case to be measured and interface communication parameter to be measured, to interface testing to be measured.NothingThe test case content of other interfaces associated with interface to be measured need to be write in interface testing use-case to be measured, only need to pass through surveyExample mark on probation and precondition information association, save repetition and write time spent by test case content, so as toImprove the testing efficiency for carrying out automatic test to interface to be measured according to test case.
A kind of computer-readable recording medium, is stored thereon with computer program, it is characterised in that the computer programFollowing steps are realized when being executed by processor:Obtain interface testing instruction;Inquiry and the test case mark in interface testing instructionKnow the precondition information of association;According to use-case parameter information to be measured corresponding to precondition acquisition of information test case mark;Use-case template to be measured corresponding with test case mark and interface communication parameter to be measured are obtained from test case library;According to be measuredUse-case parameter information and use-case template generation to be measured interface testing use-case to be measured;According to interface testing use-case to be measured and interface to be measuredMessaging parameter, the interface to be measured corresponding to interface IP address to be measured in interface testing use-case to be measured is tested.
In one embodiment, test case library includes multiple test plan information, before obtaining interface testing instruction,Processor also performs following steps:The test time started in monitoring and test plan information;When monitor current time with testWhen time started is identical, the test case mark corresponding to the extraction test time started from test plan information;According to extractingTest case mark generate interface testing to be measured instruction.
In one embodiment, the use-case parameter letter to be measured according to corresponding to precondition acquisition of information test case markBreath, including:Obtained from test case library preposition use-case corresponding with precondition information generate information, preposition use-case template andFront interface messaging parameter;Information and the preposition testing advanced use-case of use-case template generation are generated according to preposition use-case;According to prepositionInterface communication parameter performs testing advanced use-case, obtains use-case parameter information to be measured corresponding to test case mark.
In one embodiment, testing advanced use-case is performed according to front interface messaging parameter, obtains test case markCorresponding use-case parameter information to be measured, including:According to testing advanced use-case and front interface messaging parameter, to testing advanced use-caseFront interface corresponding to middle front interface address is tested, and obtains the parameter information that front interface returns;Detect preconditionIt whether there is data query conditions in information;If detecting in precondition information data query conditions be present, looked into according to dataInquiry condition inquires about data from database;With the parameter information got and the data inquired, as test case mark pairThe use-case parameter information to be measured answered.
In one embodiment, according to interface testing use-case to be measured and interface communication parameter to be measured, to interface testing to be measuredInterface to be measured in use-case corresponding to interface IP address to be measured is tested, including:Extract the interface in interface communication parameter to be measuredCommunication protocol type, interface communication pattern and interface data transmission form;According to interface communications protocol type, interface communication mouldFormula, interface data transmission form and interface testing use-case to be measured generate interface testing request to be measured;Please according to interface testing to be measuredAsk and the interface to be measured corresponding to interface IP address to be measured in interface testing use-case to be measured is tested.
In the present embodiment, in interface test process, before test case corresponding to implementation of test cases mark, according toPrecondition acquisition of information use-case parameter information to be measured, given birth to according to the use-case parameter information to be measured got and use-case template to be measuredInto interface testing use-case to be measured, and according to interface testing use-case to be measured and interface communication parameter to be measured, to interface testing to be measured.NothingThe test case content of other interfaces associated with interface to be measured need to be write in interface testing use-case to be measured, only need to pass through surveyExample mark on probation and precondition information association, save repetition and write time spent by test case content, so as toImprove the testing efficiency for carrying out automatic test to interface to be measured according to test case.
One of ordinary skill in the art will appreciate that realize all or part of flow in above-described embodiment method, being can be withThe hardware of correlation is instructed to complete by computer program, the computer program can be stored in a computer-readable storage and be situated betweenIn matter, the program is upon execution, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, foregoing storage medium can beThe non-volatile memory mediums such as magnetic disc, CD, read-only memory (Read-Only Memory, ROM).
Each technical characteristic of embodiment described above can be combined arbitrarily, to make description succinct, not to above-mentioned realityApply all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not depositedIn contradiction, the scope that this specification is recorded all is considered to be.
Embodiment described above only expresses the several embodiments of the present invention, and its description is more specific and detailed, but simultaneouslyCan not therefore it be construed as limiting the scope of the patent.It should be pointed out that come for one of ordinary skill in the artSay, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the protection of the present inventionScope.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.