CN110532169A - Interface testing case generation method, device, computer equipment and storage medium - Google Patents

Interface testing case generation method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN110532169A
CN110532169A CN201910611213.0A CN201910611213A CN110532169A CN 110532169 A CN110532169 A CN 110532169A CN 201910611213 A CN201910611213 A CN 201910611213A CN 110532169 A CN110532169 A CN 110532169A
Authority
CN
China
Prior art keywords
interface
case
parameter
interface testing
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910611213.0A
Other languages
Chinese (zh)
Inventor
杨雨晨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910611213.0A priority Critical patent/CN110532169A/en
Priority to PCT/CN2019/103224 priority patent/WO2021003818A1/en
Publication of CN110532169A publication Critical patent/CN110532169A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • 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)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the present application belongs to Test cases technology field, is related to method for generating test case, comprising: calls UI automatic test engineering according to the pre-set mission bit stream of user, the mission bit stream includes UI automatic test information and monitoring interface parameters;In UI automatic test engineering test, the corresponding interface of monitoring interface parameters preconfigured in the mission bit stream is monitored;After the completion of the UI automatic test engineering, the monitored data of the interface is obtained;Interface testing use-case parameter is extracted from the monitored data according to the value range of interface testing parameter and the interface testing parameter in the monitoring interface parameters;Interface testing use-case is generated according to the interface testing use-case parameter.The application also provides a kind of Test cases technology device, computer equipment and storage medium.The application is converted into interface testing use-case using existing UI automatic test engineering, and human cost, the time cost of construction interface testing use-case is greatly decreased.

Description

Interface testing case generation method, device, computer equipment and storage medium
Technical field
This application involves Test cases technology technical field more particularly to a kind of interface testing case generation method, device, Computer equipment and storage medium.
Background technique
Software test be it is indispensable in software development process, be by testing tool according to certain testing scheme and Process carries out test operation, the purpose is to find latent defect in software, reduces software development and maintenance cost, promotes soft Part increased quality.And automatic test is a kind of process for the behavioral test taking human as driving being converted into machine execution.In general, After devising test case and passing through evaluation, survey is executed as tester's regulation according to described in test case step by step Examination, obtains actual result compared with expected result.In the process, it in order to save manpower, time or hardware resource, improves and surveys Efficiency is tried, the concept of automatic test is just introduced.
Automatic test include the unit automatic test of data analysis layer, Business Logic interface automatic test and The UI (User Interface, user interface) of GUI (Graphical User Interface, graphic interface) boundary layer is certainly Dynamicization test, in which: unit automatic test, which refers to, to be checked and verified to testable unit the smallest in software;Interface is certainly Dynamicization tests the test for referring to test system components interface, the main calling return checked between authentication module and not homology Data exchange between system, service;UI tests the test referred to user interface, including user friendly, hommization, easily behaviour automatically The test such as property made.
In the prior art, it is all independently carried out between different automatic tests.For example, usually using WEBDRIVER (drive software in webpage) carries out UI automatic test and has to manually walk again if to carry out corresponding interface testing Process carries out manual packet capturing and extracts interface message, and design interface test case, this results in repeated works and inefficiency.
Summary of the invention
The purpose of the embodiment of the present application be to propose a kind of interface testing case generation method, device, computer equipment and Storage medium, to solve, the prior art carries out repeated work caused by independent test to UI automatic test and inefficiency is asked Topic.
In order to solve the above-mentioned technical problem, the embodiment of the present application provides a kind of interface testing case generation method, uses Technical solution as described below:
UI automatic test engineering is called according to the pre-set mission bit stream of user, the mission bit stream includes UI automatic Change test information and monitors interface parameters;
It is corresponding to monitoring interface parameters preconfigured in the mission bit stream in UI automatic test engineering test Interface is monitored;
After the completion of the UI automatic test engineering, the monitored data of the interface is obtained;
According to the value range of interface testing parameter and the interface testing parameter in the monitoring interface parameters from institute State extraction interface testing use-case parameter in monitored data;
Interface testing use-case is generated according to the interface testing use-case parameter.
Further, the UI automatic test information includes calling title, the information in path of UI automation engineering, institute Stating the step of calling UI automatic test engineering according to the pre-set mission bit stream of user includes:
Corresponding UI automatic test engineering is called according to the title of the UI automation engineering and path.
Further, interface testing case generation method according to claim 1, which is characterized in that the monitoring Interface parameters includes monitoring interface IP address, described to the corresponding interface of monitoring interface parameters preconfigured in the mission bit stream The step of being monitored specifically includes:
The request data of the corresponding interface of the interface IP address is monitored according to interface IP address is monitored;
Packet capturing is carried out to the request of the corresponding interface and response data by Fiddler tool.
Further, described after the completion of the UI automatic test engineering, obtain the step of the monitored data of the interface Suddenly it specifically includes:
The packet capturing data that packet capturing is carried out to the interface are recorded in snoop procedure;
The packet capturing data are exported as into text file and are stored into specified store path;
The text file is read from the specified path;
The text file is parsed to obtain test parameter and test parameter template is written;
The test parameter that parsing obtains, the monitored data as the interface are read from the test parameter template.
Further, the step of parsing text file obtains test parameter and test parameter template is written is specific Include:
It parses interface requests therein and response contents obtains the request and response parameter of interface;
Test parameter template is written in the request that will acquire and response parameter.
Further, if only obtaining an interface testing use-case in the UI automatic test engineering, described according to institute After stating the step of interface testing use-case parameter generates interface testing use-case, the method also includes:
According to the interface testing use-case of generation and preset interface testing use-case parameter create-rule, new test is generated Interface use-case parameter;
New interface testing use-case is generated according to the new test interface use-case parameter.
Further, the specific steps packet that interface testing use-case is generated according to the interface testing use-case parameter of extraction It includes:
The interface testing use-case parameter of the extraction is written in preset interface testing use-case template.
In order to solve the above-mentioned technical problem, the embodiment of the present application also provides a kind of interface testing use-case generating means, comprising:
Calling module, for calling UI automatic test engineering according to the pre-set mission bit stream of user, the task Information includes UI automatic test information and monitoring interface parameters;
Module is monitored, is used in UI automatic test engineering test, to preconfigured monitoring in the mission bit stream The corresponding interface of interface parameters is monitored;
Data acquisition module, for obtaining the monitored data of the interface after the completion of UI automatic test engineering;
Parameter extraction module, for according to the interface testing parameter and interface testing ginseng in the monitoring interface parameters Several value ranges extracts interface testing use-case parameter from the monitored data;
Use-case generation module, for generating interface testing use-case according to the interface testing use-case parameter.
In order to solve the above-mentioned technical problem, the embodiment of the present application also provides a kind of computer equipment, including memory and place Device is managed, computer program is stored in the memory, the processor is realized as described above when executing the computer program Interface testing case generation method the step of.
In order to solve the above-mentioned technical problem, the embodiment of the present application also provides a kind of computer readable storage medium, the meter It is stored with computer program on calculation machine readable storage medium storing program for executing, is realized when the computer program is executed by processor as described above The step of interface testing case generation method.
Compared with prior art, the embodiment of the present application mainly have it is following the utility model has the advantages that
When carrying out UI automatic test, the interface of UI automatic test is monitored, the sieve to monitored data is passed through Choosing, can be obtained interface testing use-case, can reduce the repeated work of UI automation and interface testing automation intersection of the two;It is high Effect is converted into interface testing use-case using the UI automatic test engineering of existing maturation, and construction interface testing is greatly decreased The human cost of use-case, time cost.
Detailed description of the invention
It, below will be to needed in the embodiment of the present application description in order to illustrate more clearly of the scheme in the application Attached drawing makees a simple introduction, it should be apparent that, the accompanying drawings in the following description is some embodiments of the present application, for this field For those of ordinary skill, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is that this application can be applied to exemplary system architecture figures therein;
Fig. 2 is according to the flow chart of one embodiment of the interface testing case generation method of the application;
Fig. 3 is the citing of a task list in embodiment illustrated in fig. 2;
Fig. 4 is the citing of a range of parameter values self-defining data table in embodiment illustrated in fig. 2;
Fig. 5 is the citing of parameter value code name allocation list;
Fig. 6 is the structural schematic diagram according to one embodiment of the interface testing use-case generating means of the application;
Fig. 7 is the structural schematic diagram according to one embodiment of the computer equipment of the application.
Specific embodiment
Unless otherwise defined, all technical and scientific terms used herein and the technical field for belonging to the application The normally understood meaning of technical staff is identical;It is specific that description is intended merely in the term used in the description of application herein Embodiment purpose, it is not intended that in limitation the application;The description and claims of this application and above-mentioned Detailed description of the invention In term " includes " and " having " and their any deformation, it is intended that cover and non-exclusive include.The application's says Bright book and claims or term " first " in above-mentioned attached drawing, " second " etc. rather than are used for distinguishing different objects In description particular order.
Referenced herein " embodiment " is it is meant that a particular feature, structure, or characteristic described can wrap in conjunction with the embodiments It is contained at least one embodiment of the application.Each position in the description occur the phrase might not each mean it is identical Embodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art explicitly and Implicitly understand, embodiment described herein can be combined with other embodiments.
In order to make those skilled in the art more fully understand application scheme, below in conjunction with attached drawing, to the application reality The technical solution applied in example is clearly and completely described.
As shown in Figure 1, system architecture 100 may include terminal device 101,102,103, network 104 and server 105. Network 104 between terminal device 101,102,103 and server 105 to provide the medium of communication link.Network 104 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 101,102,103 and be interacted by network 104 with server 105, to receive or send out Send message etc..Various telecommunication customer end applications can be installed, such as web browser is answered on terminal device 101,102,103 With, shopping class application, searching class application, instant messaging tools, mailbox client, social platform software etc..
Terminal device 101,102,103 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart phone, tablet computer, E-book reader, MP3 player (Moving Picture Experts Group Audio Layer III, dynamic image expert's compression standard audio level 3), MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image expert's compression standard audio level 4) it is player, on knee portable Computer and desktop computer etc..
Server 105 can be to provide the server of various services, such as to showing on terminal device 101,102,103 The page provides the background server supported.
It should be noted that interface testing case generation method provided by the embodiment of the present application is generally held by terminal device Row, correspondingly, interface testing use-case generating means are generally positioned in terminal device.
It should be understood that the number of terminal device, network and server in Fig. 1 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
With continued reference to Fig. 2, the process of one embodiment of the interface testing case generation method according to the application is shown Figure.The interface testing case generation method, comprising the following steps:
Step 201, UI automatic test engineering, the mission bit stream packet are called according to the pre-set mission bit stream of user It includes UI automatic test information and monitors interface parameters.
In the present embodiment, electronic equipment (such as the end shown in FIG. 1 of interface testing case generation method operation thereon End equipment).It should be pointed out that above-mentioned radio connection can include but is not limited to 3G/4G connection, WiFi connection, bluetooth Connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection and other currently known or exploitations in the future Radio connection.
In practical application, user needs to establish mission bit stream in task list, when mission bit stream includes that task starts to execute Between, task execution information etc..Task execution information may include UI automatic test information and monitoring interface parameters.Wherein, UI automatic test information includes calling the title, path or the information of call method etc. of UI automation engineering (or script); Monitoring interface parameters includes: interface IP address (such as packet capturing domain name/path ip), interface parameters assignment and its assignment generation for needing to monitor Number, interface testing parameter and the value range of interface testing parameter etc..
One task list citing is as shown in the task list of Fig. 3.Wherein, the major parameter of setting is as follows:
Automatized script path: refer to the path of the UI automatized script of calling;
Automatized script executes order: referring to the order for calling UI automatized script;
Packet capturing domain name/the path ip: refer to the address for the interface that needs are monitored;
It generates outgoing route: referring to and the data listened to are generated into text and are output to specified address;
Use-case number: refer to that each tested interface needs to generate 5 test cases.
In the present embodiment, step 201 calls UI automatic test engineering according to the pre-set mission bit stream of user, can To realize with the following method:
Corresponding UI automatic test work is called according to the title of the UI automation engineering in the mission bit stream and path Journey.
In practical application, UI automatic test engineering (can be surveyed using existing UI automated test tool as common Trial work has WEBDRIVER or PWATIR), the engineering of new UI automation can also be write.
Step 202, in UI automatic test engineering test, monitoring interface preconfigured in the mission bit stream is joined The corresponding interface of number is monitored.
In the present embodiment, monitoring interface parameters includes monitoring interface IP address, the step 202, comprising: according to monitoring interface Address is monitored by the request data of the corresponding interface of the interface IP address.
In practical application, if during entire UI automatic operating, it only can be in http://www.baidu.com It is executed under domain name, then the interface IP address configured is exactly http://www.baidu.com, so that it may monitor all requests To the interface IP address of this domain name prefix, such as http://www.baidu.com/interface.
In practical application, if monitoring interface is not configured in mission bit stream, interface all when the engineering executes will be monitored.
In the present embodiment, the request of the corresponding interface and response data can also be carried out by Fiddler tool Packet capturing.
Fiddler is that a http protocol debugging acts on behalf of tool, it is able to record and checks between computer and internet Http communication, is arranged breakpoint, checks the data of all " disengaging " Fiddler.
In practical application, it can first start Fiddler monitoring at the beginning of generating test case, then open at once Dynamic WEBDRIVER engineering has a series of interface calling in the implementation procedure that the UI of WEBDRIVER engineering is automated and holds Row, packet capturing result will be recorded by Fiddler, generate interface testing use-case further according to record.
Step 203, after the completion of the UI automatic test engineering, the monitored data of the interface is obtained.The present embodiment In, step 203 includes the following steps:
Step A, the packet capturing data that packet capturing is carried out to the interface are recorded in snoop procedure.
Step B, the packet capturing data are exported as into text file and stored into specified store path.
In practical application, after Fiddler starting, it will record the data of Fiddler packet capturing from the background, when UI automatic test After the completion, packet capturing data can be exported as text file.
Step C, the text file is read from the specified path, test parameter is obtained by parsing and test is written Parameterized template.
The specific implementation of this step are as follows: parse interface requests therein and response contents obtain the request of interface and response is joined Number, and test parameter template is written in the request that will acquire and response parameter.
In practical application, the better address that test parameter may include: request interface, header letter are obtained by parsing Breath, request data, returns and joins necessary interface requests parameter informations such as information etc. at request method.
Step D, monitored data is read from test parameter template, which is the test parameter for parsing and obtaining.
In the present embodiment, after step C, also packet may include into step of playing:
It will be under the specified output directory of test parameter template deposit.
Practical application is various, and output directory can be customized, and uniform template is written in test parameter and is stored, is in order to just It in classification and collects, and the screening to follow-up test data.
Step 204 is joined according to pre-set interface testing parameter in the monitoring interface parameters and the interface testing Several value ranges extracts interface testing use-case parameter from the monitored data.
In practical application, the only request, such as type of credential=identity card that each packet capturing comes out, certificate number= 123, but in the test case automatically generated, only this " type of credential ", a test case can not play covering The requirement of interface testing.Therefore it needs to be extended the test for generating and being more applicable in the interface from the test case of generation Use-case.For example, it is desired to which specified parameter type of credential randomly chooses in these types of " identity card "/" passport "/" officer's identity card ", demonstrate,prove Piece number then is gone to automatically generate at random by identity card rule, passport rule, officer's identity card rule, generates more covering interfaces with this Test case.For example, in a packet capturing, data type of credential=identity card of acquisition, certificate number=123, then can be This packet capturing generate test case basis on, randomly choose a type of credential, such as " passport ", then according to passport rule with Machine generates the certificate number of passport, i.e. the passport is not true packet capturing as a result, but being extended according to generated test case As a result.
Therefore, in the present embodiment, if an interface testing use-case is only obtained in the UI automatic test engineering, in institute After stating the step of generating interface testing use-case according to the interface testing use-case parameter, the method also includes:
According to the interface testing use-case of generation and preset interface testing use-case parameter create-rule, new test is generated Interface use-case parameter;
New interface testing use-case is generated according to the new test interface use-case parameter.
By the above method, can the use-case lazy weight that actually obtains or it is on the low side when, used according to generated test Example extension, no longer needs to individually test.
Ginseng Fig. 4 please be read, the test parameter for generating interface testing use-case can be added in the task list information of Fig. 3.By It includes: that applno (compile by request that Fig. 4, which can be seen that the interface testing parameter (i.e. self defined interface parameter assignment) that needs extract, Number), ID type (type of credential), ID numbe (passport NO.).Value range (assignment code name) includes: Z (regular expressions Formula), DIY (customized), CER identification card number/PAS passport No./SOL officer's identity card number etc..
Wherein, assignment code name can be by being defined and searching in the parameter value code name allocation list that prestores, as shown in Figure 5.
In conjunction with Fig. 3 and Fig. 4, a specific packet capturing is as follows:
1, it according to interface IP address (http://www.baidu.com/webtest), obtains packet capturing raw requests parameter, grab Packet original response parameter and packet capturing HEADER (head file).
Specifically, packet capturing raw requests parameter includes: { " applno ": " JK123 ", " ID type ": " identity card ", " ID Number ": " 123456198001018888 ", " salarybase ": " 5000 ", " city ": " Chengdu " };
Packet capturing original response parameter includes: that { " applno ": " JK123 " " successFlag ": " is provided successfully!"};
Packet capturing HEADER includes: User-Agent:Mozilla/5.0 (Windows NT 6.1;WOW64) AppleWebKit/537.36(KHTML,like Gecko)Chrome/49.0.2623.110Safari/537.36
Content-Type:application/x-www-form-urlencoded。
It 2, include applno (request is numbered), ID type (card according to the interface testing use-case parameter for needing to extract in Fig. 4 Part type), ID numbe (passport NO.), therefore, from above-mentioned packet capturing parameter, the test case parameter of extraction is as follows:
"applno":"JK456";
" ID type ": " identity card ";
"ID number":"511200198001018888"。
Step 205, interface testing use-case is generated according to the interface testing use-case parameter of extraction.
In the present embodiment, the implementation method of the step is: the interface testing use-case parameter write-in of the extraction is preset In interface testing use-case template.
In practical application, the monitorings of multiple interfaces can be realized in the mission bit stream of a task, only needed at this time in office Increase the monitoring interface parameters of multiple interfaces for needing to monitor in business information.It is closed if necessary to the logic between multiple interfaces It is use-case, relation identity between interface can be write exactly in monitoring interface parameters, then in the prison according to each interface of crawl Data and relation identity are listened, the monitored data for the interface for having logical relation is integrated, generates logical relation test case.
In the present embodiment, when carrying out UI automatic test, the interface of UI automatic test is monitored, by right The screening of monitored data can be obtained interface testing use-case, can reduce UI automation and interface testing automates intersection of the two Repeated work;It efficiently is converted into interface testing use-case using the UI automatic test engineering of existing maturation, is substantially subtracted Human cost, the time cost of interface testing use-case are constructed less.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, which can be stored in a computer-readable storage and be situated between In matter, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, storage medium above-mentioned can be The non-volatile memory mediums such as magnetic disk, CD, read-only memory (Read-Only Memory, ROM) or random storage note Recall body (Random Access Memory, RAM) etc..
It should be understood that although each step in the flow chart of attached drawing is successively shown according to the instruction of arrow, These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps Execution there is no stringent sequences to limit, can execute in the other order.Moreover, at least one in the flow chart of attached drawing Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps Completion is executed, but can be executed at different times, execution sequence, which is also not necessarily, successively to be carried out, but can be with other At least part of the sub-step or stage of step or other steps executes in turn or alternately.
With further reference to Fig. 6, as the realization to method shown in above-mentioned Fig. 2, this application provides a kind of interface testing use One embodiment of example generating means, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which specifically can be with Applied in various electronic equipments.
As shown in fig. 6, interface testing use-case generating means 600 described in the present embodiment include:
Calling module 601 is used to call UI automatic test engineering according to the pre-set mission bit stream of user, described Business information includes UI automatic test information and monitoring interface parameters;
Module 602 is monitored, is used in UI automatic test engineering test, to preconfigured prison in the mission bit stream The corresponding interface of interface parameters is listened to be monitored;
Data acquisition module 603, for obtaining the monitoring number of the interface after the completion of UI automatic test engineering According to;
Parameter extraction module 604, for according to the interface testing parameter and interface survey in the monitoring interface parameters The value range of examination parameter extracts interface testing use-case parameter from the monitored data;
Use-case generation module 605, for generating interface testing use-case according to the interface testing use-case parameter.
In practical application, user needs to establish mission bit stream in task list, when mission bit stream includes that task starts to execute Between, task execution information etc..Task execution information may include UI automatic test information and monitoring interface parameters.Wherein, UI automatic test information includes calling the title, path or the information of call method etc. of UI automation engineering (or script); Monitoring interface parameters includes: interface IP address (such as packet capturing domain name/path ip), interface parameters assignment and its assignment generation for needing to monitor Number, value range etc..
One task list citing is as shown in the task list of Fig. 3.Wherein, the major parameter of setting is as follows: automation foot This path: refer to the path of the UI automatized script of calling;Automatized script executes order: referring to the life for calling UI automatized script It enables;Packet capturing domain name/the path ip: the address for the interface that needs are monitored is indicated;It generates outgoing route: referring to the data listened to are raw At text and it is output to specified address.
In the present embodiment, calling module 601 is further used for the name according to the UI automation engineering in the mission bit stream Claim and corresponding UI automatic test engineering is called in path.
In practical application, UI automatic test engineering can use existing UI automated test tool (such as WEBDRIVER Or PWATIR), the engineering of new UI automation can also be write.
In the present embodiment, the monitoring interface parameters includes monitoring interface IP address, and the monitoring module 602 is further used The request data of the corresponding interface of the interface IP address is monitored according to monitoring interface IP address.
In practical application, if during entire UI automatic operating, it only can be in http://www.baidu.com It is executed under domain name, then the interface IP address configured is exactly http://www.baidu.com, so that it may monitor all requests To the interface IP address of this domain name prefix, such as http://www.baidu.com/interface.
In practical application, if monitoring interface is not configured in mission bit stream, interface all when the engineering executes will be monitored.
In the present embodiment, the monitoring module 602 is further used for through Fiddler tool to the corresponding interface Request and response data carry out packet capturing.
Fiddler is that a http protocol debugging acts on behalf of tool, it is able to record and checks between computer and internet Http communication, is arranged breakpoint, checks the data of all " disengaging " Fiddler.
In practical application, it can first start Fiddler monitoring at the beginning of generating test case, then open at once Dynamic WEBDRIVER engineering has a series of interface calling in the implementation procedure that the UI of WEBDRIVER engineering is automated and holds Row, packet capturing result will be recorded by Fiddler, generate interface testing use-case further according to record.
It is described after the completion of the UI automatic test engineering in the present embodiment, the data acquisition module 603, comprising:
Data record submodule, for recording the packet capturing data for carrying out packet capturing to the interface in snoop procedure;
Data export submodule, for the packet capturing data to be exported as text file and are stored to specified store path In;
Parameter acquisition submodule obtains test by parsing for reading the text file from the specified path Simultaneously test parameter template is written in parameter;
Parameter reading submodule, for reading monitored data from the test parameter template, which is to solve Analyse the test parameter obtained.
In the present embodiment, parameter acquisition submodule is further used for parsing interface requests therein and response contents obtains The request and response parameter of interface, and test parameter template is written in the request that will acquire and response parameter.
In practical application, the better address that test parameter may include: request interface, header letter are obtained by parsing Breath, request data, returns and joins necessary interface requests parameter informations such as information etc. at request method.
In practical application, which can also include sub-module stored, in parameter acquisition submodule from the finger The text file is read in fixed path, and after obtaining test parameter by parsing and test parameter template is written, test is joined Under the specified output directory of digital-to-analogue plate deposit.
Practical application is various, and output directory can be customized, and uniform template is written in test parameter and is stored, is in order to just It in classification and collects, and the screening to follow-up test data.
In the present embodiment, parameter acquisition submodule includes at least one in following parameter by parsing the test parameter obtained Kind:
The necessary interfaces such as better address, header information, request method, request data and time ginseng information of request interface Required parameter information.
In the present embodiment, the use-case generation module 605 is further used for the interface testing use-case parameter of the extraction It is written in preset interface testing use-case template.
In practical application, the only request, such as type of credential=identity card that each packet capturing comes out, certificate number= 123, but in the test case automatically generated, only this " type of credential ", a test case can not play covering The requirement of interface testing.Therefore it needs to be extended the test for generating and being more applicable in the interface from the test case of generation Use-case.For example, it is desired to which specified parameter type of credential randomly chooses in these types of " identity card "/" passport "/" officer's identity card ", demonstrate,prove Piece number then is gone to automatically generate at random by identity card rule, passport rule, officer's identity card rule, generates more covering interfaces with this Test case.
It please join Fig. 4, the test parameter for generating interface testing use-case can be added in task list information.It can be with by Fig. 4 Find out, the interface testing parameter (i.e. self defined interface parameter assignment) for needing to extract includes: applno (request number), ID Type (type of credential), ID numbe (passport NO.).Value range (assignment code name) includes: Z (regular expression), and DIY is (certainly Definition), CER identification card number/PAS passport No./SOL officer's identity card number.
Wherein, assignment code name can by being defined in the parameter value code name allocation list parameter value code name allocation list that prestores and It searches.
The interface testing use-case generating means of the present embodiment, when carrying out UI automatic test, to UI automatic test Interface is monitored, and by the screening to monitored data, can be obtained interface testing use-case, can reduce UI automation and interface The repeated work of test automation intersection of the two;It is efficiently converted into and is connect using the UI automatic test engineering of existing maturation Human cost, the time cost of construction interface testing use-case is greatly decreased in mouth test case.
In order to solve the above technical problems, the embodiment of the present application also provides computer equipment.It is this referring specifically to Fig. 6, Fig. 7 Embodiment computer equipment basic structure block diagram.
The computer equipment 7 includes that connection memory 71, processor 72, network interface are in communication with each other by system bus 73.It should be pointed out that the computer equipment 7 with component 71-73 is illustrated only in figure, it should be understood that simultaneously should not Realistic to apply all components shown, the implementation that can be substituted is more or less component.Wherein, those skilled in the art of the present technique It is appreciated that computer equipment here is that one kind can be automatic to carry out numerical value calculating according to the instruction for being previously set or storing And/or the equipment of information processing, hardware include but is not limited to microprocessor, specific integrated circuit (Application Specific Integrated Circuit, ASIC), programmable gate array (Field-Programmable Gate Array, FPGA), digital processing unit (Digital Signal Processor, DSP), embedded device etc..
The computer equipment can be the calculating such as desktop PC, notebook, palm PC and cloud server and set It is standby.The computer equipment can carry out people by modes such as keyboard, mouse, remote controler, touch tablet or voice-operated devices with user Machine interaction.
The memory 71 include at least a type of readable storage medium storing program for executing, the readable storage medium storing program for executing include flash memory, Hard disk, multimedia card, card-type memory (for example, SD or DX memory etc.), random access storage device (RAM), static random are visited It asks memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), may be programmed read-only deposit Reservoir (PROM), magnetic storage, disk, CD etc..In some embodiments, the memory 71 can be the computer The internal storage unit of equipment 7, such as the hard disk or memory of the computer equipment 7.In further embodiments, the memory 71 are also possible to the plug-in type hard disk being equipped on the External memory equipment of the computer equipment 7, such as the computer equipment 7, Intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Certainly, the memory 71 can also both including the computer equipment 7 internal storage unit and also including outside it Portion stores equipment.In the present embodiment, the memory 71 is installed on the operating system of the computer equipment 7 commonly used in storage With types of applications software, such as the program code of interface testing case generation method etc..In addition, the memory 71 can also be used In temporarily storing the Various types of data that has exported or will export.
The processor 72 can be in some embodiments central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor or other data processing chips.The processor 72 is commonly used in the control meter Calculate the overall operation of machine equipment 7.In the present embodiment, the processor 72 is for running the program generation stored in the memory 71 Code or processing data, such as run the program code of the interface testing case generation method.
The network interface 73 may include radio network interface or wired network interface, which is commonly used in Communication connection is established between the computer equipment 7 and other electronic equipments.
Present invention also provides another embodiments, that is, provide a kind of computer readable storage medium, the computer Readable storage medium storing program for executing is stored with interface testing use-case and generates program, and the interface testing use-case generates program can be by least one It manages device to execute, so that at least one described processor is executed such as the step of above-mentioned interface testing case generation method.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, the technical solution of the application substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in a storage medium In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, computer, clothes Business device, air conditioner or the network equipment etc.) execute method described in each embodiment of the application.
Obviously, embodiments described above is merely a part but not all of the embodiments of the present application, attached The preferred embodiment of the application is given in figure, but is not intended to limit the scope of the patents of the application.The application can be with many differences Form realize, on the contrary, purpose of providing these embodiments is keeps the understanding to disclosure of this application more thorough Comprehensively.Although the application is described in detail with reference to the foregoing embodiments, for coming for those skilled in the art, Can still modify to technical solution documented by aforementioned each specific embodiment, or to part of technical characteristic into Row equivalence replacement.All equivalent structures done using present specification and accompanying drawing content, are directly or indirectly used in other Relevant technical field, similarly within the application scope of patent protection.

Claims (10)

1. a kind of interface testing case generation method, which is characterized in that include the following steps:
UI automatic test engineering is called according to the pre-set mission bit stream of user, the mission bit stream includes that UI automation is surveyed It tries information and monitors interface parameters;
In UI automatic test engineering test, interface corresponding to monitoring interface parameters preconfigured in the mission bit stream It is monitored;
After the completion of the UI automatic test engineering, the monitored data of the interface is obtained;
According to the value range of interface testing parameter and the interface testing parameter in the monitoring interface parameters from the prison Listen extraction interface testing use-case parameter in data;
Interface testing use-case is generated according to the interface testing use-case parameter.
2. interface testing case generation method according to claim 1, which is characterized in that the UI automatic test information Title, the information in path including calling UI automation engineering, it is described that UI is called certainly according to the pre-set mission bit stream of user The step of dynamicization testing engineering includes:
Corresponding UI automatic test engineering is called according to the title of the UI automation engineering and path.
3. interface testing case generation method according to claim 1, which is characterized in that the monitoring interface parameters includes Interface IP address is monitored, it is described to the step monitoring the corresponding interface of interface parameters and being monitored preconfigured in the mission bit stream Suddenly it specifically includes:
The request data of the corresponding interface of the interface IP address is monitored according to interface IP address is monitored;
Packet capturing is carried out to the request of the corresponding interface and response data by Fiddler tool.
4. interface testing case generation method according to claim 1, which is characterized in that described when UI automation is surveyed After the completion of trial work journey, the step of obtaining the monitored data of the interface, is specifically included:
The packet capturing data that packet capturing is carried out to the interface are recorded in snoop procedure;
The packet capturing data are exported as into text file and are stored into specified store path;
The text file is read from the specified path;
The text file is parsed to obtain test parameter and test parameter template is written;
The test parameter that parsing obtains, the monitored data as the interface are read from the test parameter template.
5. interface testing case generation method according to claim 4, which is characterized in that the parsing text file It obtains test parameter and is specifically included the step of test parameter template is written:
It parses interface requests therein and response contents obtains the request and response parameter of interface;
Test parameter template is written in the request that will acquire and response parameter.
6. interface testing case generation method according to claim 1, which is characterized in that if the UI automatic test work An interface testing use-case is only obtained in journey, in the step for generating interface testing use-case according to the interface testing use-case parameter After rapid, the method also includes:
According to the interface testing use-case of generation and preset interface testing use-case parameter create-rule, new test interface is generated Use-case parameter;
New interface testing use-case is generated according to the new test interface use-case parameter.
7. interface testing case generation method according to claim 1, which is characterized in that described to be surveyed according to the interface of extraction The specific steps that example parameter on probation generates interface testing use-case include:
The interface testing use-case parameter of the extraction is written in preset interface testing use-case template.
8. a kind of interface testing use-case generating means characterized by comprising
Calling module, for calling UI automatic test engineering according to the pre-set mission bit stream of user, the mission bit stream Including UI automatic test information and monitor interface parameters;
Module is monitored, is used in UI automatic test engineering test, to monitoring interface preconfigured in the mission bit stream The corresponding interface of parameter is monitored;
Data acquisition module, for obtaining the monitored data of the interface after the completion of UI automatic test engineering;
Parameter extraction module, for according to the interface testing parameter and the interface testing parameter in the monitoring interface parameters Value range extracts interface testing use-case parameter from the monitored data;
Use-case generation module, for generating interface testing use-case according to the interface testing use-case parameter.
9. a kind of computer equipment, which is characterized in that including memory and processor, computer journey is stored in the memory Sequence, the processor realize the interface testing use-case as described in any one of claims 1 to 7 when executing the computer program The step of generation method.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium Program realizes the interface testing use-case as described in any one of claims 1 to 7 when the computer program is executed by processor The step of generation method.
CN201910611213.0A 2019-07-08 2019-07-08 Interface testing case generation method, device, computer equipment and storage medium Pending CN110532169A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910611213.0A CN110532169A (en) 2019-07-08 2019-07-08 Interface testing case generation method, device, computer equipment and storage medium
PCT/CN2019/103224 WO2021003818A1 (en) 2019-07-08 2019-08-29 Interface test case generating method and apparatus, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910611213.0A CN110532169A (en) 2019-07-08 2019-07-08 Interface testing case generation method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110532169A true CN110532169A (en) 2019-12-03

Family

ID=68659562

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910611213.0A Pending CN110532169A (en) 2019-07-08 2019-07-08 Interface testing case generation method, device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN110532169A (en)
WO (1) WO2021003818A1 (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111274153A (en) * 2020-02-14 2020-06-12 香港乐蜜有限公司 Automatic testing method and device and electronic equipment
CN111522728A (en) * 2019-12-31 2020-08-11 支付宝实验室(新加坡)有限公司 Method for generating automatic test case, electronic device and readable storage medium
CN112181836A (en) * 2020-09-30 2021-01-05 中国平安财产保险股份有限公司 Test case generation method, system, device and storage medium
CN113138929A (en) * 2021-05-12 2021-07-20 平安国际智慧城市科技股份有限公司 Distributed interface testing method and device, electronic equipment and storage medium
CN113342689A (en) * 2021-07-01 2021-09-03 中诚信征信有限公司 Automatic testing method and device for interface, electronic equipment and storage medium
CN113407450A (en) * 2021-06-22 2021-09-17 平安国际智慧城市科技股份有限公司 Interface testing method, device, equipment and medium based on automatic parameter identification
CN113434395A (en) * 2021-06-22 2021-09-24 中国平安人寿保险股份有限公司 Automatic generation method, device, equipment and medium of test case
CN113505068A (en) * 2021-07-09 2021-10-15 杭州遥望网络科技有限公司 Automatic test method, device, equipment and storage medium for HTTP (hyper text transport protocol) interface
CN113778895A (en) * 2021-09-18 2021-12-10 上海中通吉网络技术有限公司 Automatic interface testing method and device
CN114356785A (en) * 2022-03-11 2022-04-15 中航信移动科技有限公司 Data processing method and device, electronic equipment and storage medium
CN114721970A (en) * 2022-06-08 2022-07-08 广州易方信息科技股份有限公司 Method and device for automatic testing and accurate testing of construction interface
CN114880242A (en) * 2022-06-08 2022-08-09 北京百度网讯科技有限公司 Test case extraction method, device, equipment and medium

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112835808A (en) * 2021-03-12 2021-05-25 中国平安财产保险股份有限公司 Interface testing method and device, computer equipment and storage medium
CN113010425B (en) * 2021-03-18 2024-04-02 中国平安人寿保险股份有限公司 System quality monitoring method, device, computer equipment and storage medium
CN113505054B (en) * 2021-04-08 2023-12-12 中国航空无线电电子研究所 Network data static test system and test method for unmanned aerial vehicle control station
CN113535223B (en) * 2021-07-19 2023-10-24 长鑫存储技术有限公司 Configuration method, device, storage medium and equipment of test flow
CN113704095A (en) * 2021-08-08 2021-11-26 中国航空工业集团公司沈阳飞机设计研究所 Automatic generation method and device for automatic interface test case
CN113746840A (en) * 2021-09-03 2021-12-03 中国银行股份有限公司 JSON format message generation method and device
CN114490202B (en) * 2021-12-21 2023-06-23 北京密码云芯科技有限公司 Password equipment testing method and device, electronic equipment and storage medium
CN114584500B (en) * 2022-02-25 2024-03-22 网易(杭州)网络有限公司 Asynchronous communication testing method and device and electronic equipment
CN115225551B (en) * 2022-07-14 2024-03-29 北京邮电大学 Fuzzy test method, device, equipment and storage medium
CN115883431A (en) * 2022-11-29 2023-03-31 重庆长安汽车股份有限公司 Terminal communication protocol performance test system, method, vehicle and storage medium
CN117130941B (en) * 2023-10-24 2024-03-26 易方信息科技股份有限公司 Interface automation method, system, equipment and medium based on browser plug-in

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106951368A (en) * 2017-03-12 2017-07-14 北京工业大学 Automatic example generation method based on UML timing diagrams
US20180024914A1 (en) * 2016-07-20 2018-01-25 International Business Machines Corporation Generating test scripts for testing a network-based application
CN108984388A (en) * 2018-06-01 2018-12-11 平安壹钱包电子商务有限公司 A kind of method and terminal device generating automatic test cases
CN109062788A (en) * 2018-07-17 2018-12-21 招银云创(深圳)信息技术有限公司 Method for generating test case, device, computer equipment and storage medium
CN109828903A (en) * 2018-12-14 2019-05-31 中国平安人寿保险股份有限公司 Automated testing method, device, computer installation and storage medium
US20190196944A1 (en) * 2017-12-22 2019-06-27 International Business Machines Corporation System for writing and executing unit test cases

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9864674B2 (en) * 2015-01-23 2018-01-09 Accenture Global Services Limited Test case generation system
CN107894952A (en) * 2017-11-08 2018-04-10 中国平安人寿保险股份有限公司 Generation method, device, equipment and the readable storage medium storing program for executing of interface testing use-case
CN108415832B (en) * 2018-02-07 2021-03-02 平安科技(深圳)有限公司 Interface automation test method, device, equipment and storage medium
CN109408398A (en) * 2018-11-13 2019-03-01 郑州云海信息技术有限公司 A kind of interface automatic test device and method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180024914A1 (en) * 2016-07-20 2018-01-25 International Business Machines Corporation Generating test scripts for testing a network-based application
CN106951368A (en) * 2017-03-12 2017-07-14 北京工业大学 Automatic example generation method based on UML timing diagrams
US20190196944A1 (en) * 2017-12-22 2019-06-27 International Business Machines Corporation System for writing and executing unit test cases
CN108984388A (en) * 2018-06-01 2018-12-11 平安壹钱包电子商务有限公司 A kind of method and terminal device generating automatic test cases
CN109062788A (en) * 2018-07-17 2018-12-21 招银云创(深圳)信息技术有限公司 Method for generating test case, device, computer equipment and storage medium
CN109828903A (en) * 2018-12-14 2019-05-31 中国平安人寿保险股份有限公司 Automated testing method, device, computer installation and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
不再有的年月: "如何记录selenium自动化测试过程中接口的调用信息", 《HTTPS://WWW.CNBLOGS.COM/HHUDAQIANG/P/6635494.HTML》 *

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111522728A (en) * 2019-12-31 2020-08-11 支付宝实验室(新加坡)有限公司 Method for generating automatic test case, electronic device and readable storage medium
CN111274153A (en) * 2020-02-14 2020-06-12 香港乐蜜有限公司 Automatic testing method and device and electronic equipment
CN112181836A (en) * 2020-09-30 2021-01-05 中国平安财产保险股份有限公司 Test case generation method, system, device and storage medium
CN113138929A (en) * 2021-05-12 2021-07-20 平安国际智慧城市科技股份有限公司 Distributed interface testing method and device, electronic equipment and storage medium
CN113407450B (en) * 2021-06-22 2024-03-15 平安国际智慧城市科技股份有限公司 Interface testing method, device, equipment and medium based on parameter automatic identification
CN113407450A (en) * 2021-06-22 2021-09-17 平安国际智慧城市科技股份有限公司 Interface testing method, device, equipment and medium based on automatic parameter identification
CN113434395A (en) * 2021-06-22 2021-09-24 中国平安人寿保险股份有限公司 Automatic generation method, device, equipment and medium of test case
CN113434395B (en) * 2021-06-22 2024-04-30 中国平安人寿保险股份有限公司 Automatic generation method, device, equipment and medium for test cases
CN113342689A (en) * 2021-07-01 2021-09-03 中诚信征信有限公司 Automatic testing method and device for interface, electronic equipment and storage medium
CN113505068A (en) * 2021-07-09 2021-10-15 杭州遥望网络科技有限公司 Automatic test method, device, equipment and storage medium for HTTP (hyper text transport protocol) interface
CN113778895A (en) * 2021-09-18 2021-12-10 上海中通吉网络技术有限公司 Automatic interface testing method and device
CN114356785B (en) * 2022-03-11 2022-05-20 中航信移动科技有限公司 Data processing method and device, electronic equipment and storage medium
CN114356785A (en) * 2022-03-11 2022-04-15 中航信移动科技有限公司 Data processing method and device, electronic equipment and storage medium
CN114721970A (en) * 2022-06-08 2022-07-08 广州易方信息科技股份有限公司 Method and device for automatic testing and accurate testing of construction interface
CN114880242A (en) * 2022-06-08 2022-08-09 北京百度网讯科技有限公司 Test case extraction method, device, equipment and medium
CN114721970B (en) * 2022-06-08 2022-10-04 易方信息科技股份有限公司 Method and device for automatic testing and accurate testing of construction interface
CN114880242B (en) * 2022-06-08 2023-01-13 北京百度网讯科技有限公司 Test case extraction method, device, equipment and medium

Also Published As

Publication number Publication date
WO2021003818A1 (en) 2021-01-14

Similar Documents

Publication Publication Date Title
CN110532169A (en) Interface testing case generation method, device, computer equipment and storage medium
CN109669688A (en) Based on visual software development methodology, device, terminal device and storage medium
CN107133174A (en) Test case code automatically generating device and method
CN107608901B (en) Jmeter-based testing method and device, storage medium and electronic equipment
CN109542758B (en) Method and device for testing fault tolerance of application program and computer readable storage medium
CN107526676B (en) Cross-system test method and device
CN107092555A (en) A kind of method and system of test application program
CN104424089A (en) Terminal testing method and device
CN111552633A (en) Interface abnormal call testing method and device, computer equipment and storage medium
CN111930617B (en) Automatic test method and device based on data objectification
CN108228444A (en) A kind of test method and device
CN107045475A (en) Method of testing and device
CN115065652B (en) Message reply method and device, storage medium and computer equipment
CN112463634A (en) Software testing method and device under micro-service architecture
CN110532165A (en) Application program installation kit characteristic detecting method, device, equipment and storage medium
CN109284227A (en) A kind of automation method for testing pressure and device calculate equipment and storage medium
CN113435608A (en) Method and device for generating federated learning model, computer equipment and storage medium
CN107402878B (en) Test method and device
CN107368407A (en) Information processing method and device
CN111797008B (en) Automatic verification method, equipment and storage medium for mobile terminal embedded point data
CN104008043B (en) Cross-terminal method of testing, end to be tested and test lead
CN112988600A (en) Service scene testing method and device, electronic equipment and storage medium
CN110287070A (en) ESB specialized protocol interface test method, server and computer readable storage medium
CN109582580A (en) For debugging system, the method and apparatus of the page
CN110990275B (en) Page display test method and device for mobile banking

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20191203

RJ01 Rejection of invention patent application after publication