CN108388514A - Automatic interface testing method, device, equipment and computer readable storage medium - Google Patents

Automatic interface testing method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN108388514A
CN108388514A CN201810156599.6A CN201810156599A CN108388514A CN 108388514 A CN108388514 A CN 108388514A CN 201810156599 A CN201810156599 A CN 201810156599A CN 108388514 A CN108388514 A CN 108388514A
Authority
CN
China
Prior art keywords
template
script
test
test case
script template
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810156599.6A
Other languages
Chinese (zh)
Other versions
CN108388514B (en
Inventor
彭明强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN201810156599.6A priority Critical patent/CN108388514B/en
Priority to PCT/CN2018/084310 priority patent/WO2019161619A1/en
Publication of CN108388514A publication Critical patent/CN108388514A/en
Application granted granted Critical
Publication of CN108388514B publication Critical patent/CN108388514B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • 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/3692Test management for test results analysis

Abstract

An embodiment of the present invention provides a kind of automatic interface testing method, device, equipment and computer readable storage mediums.This method includes:Test case is generated according to preset test case description scheme;Obtain the corresponding test assignment list of the test case;The corresponding test assignment of the test assignment list is executed successively, to generate implementing result;Test report is generated according to the implementing result.Implement the embodiment of the present invention, the maintenance cost of interface testing can be reduced and promotes the working efficiency of interface testing.

Description

Automatic interface testing method, device, equipment and computer readable storage medium
Technical field
The present invention relates to field of computer data processing more particularly to a kind of automatic interface testing method, device, equipment And computer readable storage medium.
Background technology
Interface testing is generally used in interaction exploitation between multisystem, or possess the application system development of multiple subsystems Test.Interface testing is suitable for providing the bottom frame system and center service system of service for other systems, mainly tests this The interface that a little system external portions provide, verifies its correctness and stability.
Interface automated test frame in the prior art is higher to the script edit Capability Requirement of user and service efficiency Low, such as need to write the similar functions program code largely repeated, causing that maintenance cost is high and testing efficiency is low etc. asks Topic.Therefore, automatic test how is realized to solve the defects of prior art is higher to user's script edit Capability Requirement, is had become For technical problem urgently to be resolved hurrily.
Invention content
The present invention provides a kind of automatic interface testing method, device, equipment and computer readable storage mediums, it is intended to Solve the problems, such as that interface testing maintenance cost height and testing efficiency are low.
In a first aspect, the present invention provides a kind of automatic interface testing methods comprising:
Test case is generated according to preset test case description scheme;
Obtain the corresponding test assignment list of the test case;
The corresponding test assignment of the test assignment list is executed successively, to generate implementing result;
Test report is generated according to the implementing result.
Second aspect, the present invention provides a kind of interface automatic test devices comprising:
Use-case generation unit, for generating test case according to preset test case description scheme;
Task acquiring unit, for obtaining the corresponding test assignment list of the test case;
As a result generation unit executes knot for executing the corresponding test assignment of the test assignment list successively to generate Fruit;
Report generation unit, for generating test report according to the implementing result.
The third aspect invention further provides a kind of computer equipment, including memory, processor and is stored in described deposit On reservoir and the computer program that can run on the processor, which is characterized in that when the processor executes described program Realize any one of them automatic interface testing method that invention provides.
Fourth aspect, the present invention also provides a kind of computer readable storage mediums, wherein the computer-readable storage It includes program instruction that media storage, which has computer program, the computer program, and described program instructs when being executed by a processor The processor is set to execute any one of them automatic interface testing method that invention provides.
A kind of automatic interface testing method of present invention offer, device, computer equipment and computer readable storage medium. This method includes generating test case according to preset test case description scheme;The corresponding test of the test case is obtained to appoint Business list;The corresponding test assignment of the test assignment list is executed successively, to generate implementing result;According to the implementing result Generate test report.Implement the embodiment of the present invention, by generating test case, and root according to preset test case description scheme According to the obtained test result of the corresponding test assignment of implementation of test cases, you can generate test report, interface testing can be reduced Maintenance cost and promoted interface testing working efficiency.
Description of the drawings
Technical solution in order to illustrate the embodiments of the present invention more clearly, below will be to needed in embodiment description Attached drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the invention, general for this field For logical technical staff, without creative efforts, other drawings may also be obtained based on these drawings.
Fig. 1 is a kind of flow diagram for automatic interface testing method that one embodiment of the invention provides;
Fig. 2 is a kind of sub-process schematic diagram for automatic interface testing method that one embodiment of the invention provides;
Fig. 3 is a kind of sub-process schematic diagram for automatic interface testing method that one embodiment of the invention provides;
Fig. 4 is a kind of sub-process schematic diagram for automatic interface testing method that one embodiment of the invention provides;
Fig. 5 is a kind of sub-process schematic diagram for automatic interface testing method that one embodiment of the invention provides;
Fig. 6 is a kind of schematic block diagram for interface automatic test device that one embodiment of the invention provides;
Fig. 7 is a kind of schematic frame of use-case generation unit for interface automatic test device that one embodiment of the invention provides Figure;
Fig. 8 is a kind of schematic frame of the first judging unit for interface automatic test device that one embodiment of the invention provides Figure;
Fig. 9 is a kind of schematic frame of first processing units for interface automatic test device that one embodiment of the invention provides Figure;
Figure 10 is that a kind of report generation unit for interface automatic test device that one embodiment of the invention provides is schematic Block diagram;
Figure 11 is a kind of schematic block diagram for computer equipment that one embodiment of the invention provides.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation describes, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
It should be appreciated that ought use in this specification and in the appended claims, term " comprising " and "comprising" instruction Described feature, entirety, step, operation, the presence of element and/or component, but one or more other spies are not precluded Sign, entirety, step, operation, element, component and/or its presence or addition gathered.
It is also understood that the term used in this description of the invention is merely for the sake of the mesh for describing specific embodiment And be not intended to limit the present invention.As description of the invention and it is used in the attached claims, unless on Other situations are hereafter clearly indicated, otherwise " one " of singulative, "one" and "the" are intended to include plural form.
Interface refers to the module between system and system or in system and the interaction point between module.Interface testing is mainly used Whether correct in data interaction, transmission and the logic function of detection interaction point, interface testing is substantially to send one Request messages ask interface to be tested to server-side, and receive the Response messages that server-side response returns, and being based on should Whether the function of the Response message analysis interface to be tested is correctly realized.
Fig. 1 is please referred to, for a kind of flow diagram for automatic interface testing method that one embodiment of the invention provides. The automatic interface testing method can be applied to server, desktop computer, laptop computer, tablet computer, personal digital assistant (PDA), in the terminals such as smart mobile phone (such as Android phone, IOS mobile phones).Specifically, the method comprising the steps of S110- S140。
S110 generates test case according to preset test case description scheme.
Specifically, test case description scheme includes that interface calls structure and interface control structure.Wherein, the interface Structure is called to be used to describe the input parameter that test interface calls execution action required;The interface control structure is surveyed for describing The control logic that mouth of trying is called.
Wherein, the Control Cooling of interface control structure includes but not limited to loop control structure, condition execution structure, delay Control structure, registration variable structure and assert control structure.Specifically, the loop control structure is for describing the test The number for calling execution action in proper order of interface;The conditional control structure executes action for describing the test interface calling Precondition;The registration variable be used to store the test interface call it is after execution action as a result, in order to it is follow-up its It is used in his test case;It is described to assert that control structure calls the survey generated after execution action for describing the test interface Test result.
The interface control structure of each Control Cooling corresponds to unique control identifier.For example, loop control structure pair The identifier answered is retries;The corresponding identifier of conditional control structure is until;The corresponding identifier of delay control architecture For delay;The corresponding identifier of registration variable structure is register;Assert that the corresponding identifier of control structure is assert.
Fig. 2 specifically is please referred to, for a kind of sub-process for automatic interface testing method that one embodiment of the invention provides Schematic diagram.Further, the test case description scheme includes script template, and the script template includes parameter input interface And pre-set code section, test case, including step are generated according to preset test case description scheme in step S110 S111-S114。
In specific implementation, different test case description schemes corresponds to different pre-set code sections.For example, if this is preset Test case description scheme is interface calling structure, and the corresponding pre-set code section of interface calling structure can be:
include:
name:
Accordingly, which calls the corresponding parameter input interface of structure to be set to " name:" below.The parameter inputs boundary Face is Text Entry, is believed so that user inputs corresponding parameter according to the pre-set code section in the Text Entry Breath.
S111, judges whether the script template is active.
Fig. 3 specifically is please referred to, for a kind of sub-process for automatic interface testing method that one embodiment of the invention provides Schematic diagram.Further, the test case description scheme further includes for showing the alternative frame of the template of script template, step Judge whether the script template is active in S111, including step S1111-S1115.
S1111 obtains character input by user by the alternative frame of the template.
In specific implementation, can one alternative frame of template be set in every a line, the alternative frame of the template can be used for obtaining user defeated The character entered, and the pre-set code section to be matched to user's displaying with the character according to acquired character.
S1112 obtains the script template to match with the character according to the character input by user.
In specific implementation, the script template to be matched according to the character machining input by user and the character specifically may be used Think:
Judge whether the corresponding template identifier of the script template includes the character input by user;
If the corresponding template identifier of the script template includes the character input by user, which is determined For the script template to match with the character.
Wherein, each script template corresponds to only one template identifier.If the test case description scheme is interface The template identifier of control structure, the corresponding script template of the interface control structure can be that the interface control structure corresponds to control Identifier.For example, the interface control structure is loop control structure, then the template of the corresponding script template of the loop control structure Identifier is the corresponding control identifier of loop control structure, i.e., the template identifier is " retries ".
If the character input by user is " r ", by the way that the character " r " is matched one by one with all template identifiers, It judges whether the template identifier containing character " r ", if there is the template identifier containing character " r ", character will be contained The corresponding script template of template identifier of " r " is determined as the script template to match with the character.
S1113 is showed in the alternative frame of the template by described with the script template that the character matches.
In specific implementation, if the first character of template identifier is identical as the character input by user, by the template Character priority is showed in the alternative frame of template.The mode preferentially shown includes but not limited to that top set shows, is highlighted.
Whether S1114, the script template that the alternative frame of the template is showed in described in judgement are selected.
In specific implementation, determine that the script template is selected if the script template for being showed in the alternative frame of the template is clicked In.
S1115 judges selected script template if the script template for being showed in the alternative frame of the template is selected It is active.
Implement the embodiment of the present invention, by obtaining character input by user, automatic detection and character phase input by user The script template matched, and the script template is showed in the alternative frame of template, for selection by the user.Quick obtaining script can be achieved Template improves input efficiency.
S112 obtains pre-set code section corresponding with the script template if the script template is active.
In specific implementation, the script template includes parameter input interface and pre-set code section.If the script template It is active, then generates the corresponding pre-set code section of the script template and the script template corresponding parameter input circle Face.
S113 obtains script argument corresponding with the pre-set code section by the parameter input interface.
In specific implementation, which can be used for receiving script argument input by user, be inputted by the parameter Interface can obtain script argument corresponding with the pre-set code section input by user.
S114 generates test assignment according to the pre-set code section and script argument.
Fig. 4 specifically is please referred to, for a kind of sub-process for automatic interface testing method that one embodiment of the invention provides Schematic diagram.Further, test case, including step are generated according to the pre-set code section and script argument in step S114 Rapid S1141-S1143.
S1141 obtains the script template that the parameter input interface is null value.
Specifically, if the parameter input interface is null value, show that the parameter input interface is not received by user's input Script argument.
S1142, delete the parameter input interface be null value script template, with obtain remaining pre-set code section and Script argument corresponding with the remaining pre-set code section.
S1143 gives birth to according to remaining pre-set code section and script argument corresponding with the remaining pre-set code section At test case.
In specific implementation, the test case can be stored in by the form of script file in preset test catalogue, The file format of the script file can be YAML formats.By searching for the YAML formatted files in the preset test catalogue, Can quick obtaining to corresponding test case.
Implement the embodiment of the present invention, effectively prevent the problem of test case malfunctions caused by extra script template, improves The speed and accuracy that test case is write.
S120 obtains the corresponding test assignment list of the test case.
In specific implementation, a test case may include one or more than one test assignment.Each test is appointed Business is marked by preset task identifier, and the first row which may be disposed at each test assignment is most left Side, to realize the differentiation to different test assignments and improve the speed of identification test assignment.The task identifier can be "-". The script file of the test case is preserved by load, and identifies preset task identifier, can obtain the test case Corresponding test assignment list.
S130 executes the corresponding test assignment of the test assignment list, to generate implementing result successively.
Wherein, different types of test assignment can be generated according to different types of test case description scheme.If test is used Example description scheme is that interface calls structure, and it is interface calling task which, which calls structure to correspond to the test assignment generated, this connects Mouth calling task is used to call the input parameter needed for execution action.It, should if test case description scheme is interface control structure It is Interface Controller task that interface control structure, which corresponds to the test assignment generated, which is used for according to corresponding control Logic executes control action.
In specific implementation, the script file of test case is preserved by load, such as by searching for the preset test YAML formatted files in catalogue, and according to corresponding filename is retrieved, to acquire and load corresponding script file, It can be obtained the corresponding test assignment list of the test case.The corresponding test assignment of the test assignment list is executed successively It can be specially putting in order according to the task identifier, execute the test assignment successively in accordance with the order from top to bottom.
S140 generates test report according to the implementing result.
Fig. 5 specifically is please referred to, for a kind of sub-process for automatic interface testing method that one embodiment of the invention provides Schematic diagram.Further, test report, including step S141-S142 are generated according to the implementing result in step S140.
S141 obtains the success rate of the implementing result.
In specific implementation, by obtaining total successful execution number for executing number and the test assignment of test assignment, And successful execution number is divided by with total execution number and can be obtained the success rate of the implementing result.
S142 generates corresponding test report according to the success rate of the implementing result.
In specific implementation, if the success rate is less than preset first threshold, the first test report is generated;If the success rate is big In or equal to preset first threshold, the second test report is generated.For example, the first threshold can be 90%.If success rate Less than 90%, the first test report of generation is test crash.If success rate is more than or equal to 90%, the second test of generation It is reported as being successfully tested.
Fig. 6 is please referred to, for a kind of schematic block diagram for interface automatic test device that one embodiment of the invention provides. The interface automatic test device 100 include use-case generation unit 110, task acquiring unit 120, result generation unit 130 with And report generation unit 140.
Specifically, test case description scheme includes that interface calls structure and interface control structure.Wherein, the interface Structure is called to be used to describe the input parameter that test interface calls execution action required;The interface control structure is surveyed for describing The control logic that mouth of trying is called.
Wherein, the Control Cooling of interface control structure includes but not limited to loop control structure, condition execution structure, delay Control structure, registration variable structure and assert control structure.Specifically, the loop control structure is for describing the test The number for calling execution action in proper order of interface;The conditional control structure executes action for describing the test interface calling Precondition;The registration variable be used to store the test interface call it is after execution action as a result, in order to it is follow-up its It is used in his test case;It is described to assert that control structure calls the survey generated after execution action for describing the test interface Test result.
The interface control structure of each Control Cooling corresponds to unique control identifier.For example, loop control structure pair The identifier answered is retries;The corresponding identifier of conditional control structure is until;The corresponding identifier of delay control architecture For delay;The corresponding identifier of registration variable structure is register;Assert that the corresponding identifier of control structure is assert.
Use-case generation unit 110, for generating test case according to preset test case description scheme.
Fig. 7 specifically is please referred to, for a kind of use-case life for interface automatic test device that one embodiment of the invention provides At unit schematic block diagram.Further, the test case description scheme includes script template, and the script template includes ginseng Number input interface and pre-set code section, the use-case generation unit 110 include the first judging unit 111, first acquisition unit 112, second acquisition unit 113 and first processing units 114.
In specific implementation, different test case description schemes corresponds to different pre-set code sections.For example, if this is preset Test case description scheme is interface calling structure, and the corresponding pre-set code section of interface calling structure can be:
include:
name:
Accordingly, which calls the corresponding parameter input interface of structure to be set to " name:" below.The parameter inputs boundary Face is Text Entry, is believed so that user inputs corresponding parameter according to the pre-set code section in the Text Entry Breath.
First judging unit 111, for judging whether the script template is active.
Fig. 8 specifically is please referred to, is that the first of a kind of interface automatic test device that one embodiment of the invention provides is sentenced 111 schematic block diagram of disconnected unit.Further, the test case description scheme further includes the template for showing script template Alternative frame, first judging unit 111 include third acquiring unit 1111, the 4th acquiring unit 1112, display unit 1113, Second judgment unit 1114 and second processing unit 1115.
Third acquiring unit 1111, for obtaining character input by user by the alternative frame of the template.
In specific implementation, can one alternative frame of template be set in every a line, the alternative frame of the template can be used for obtaining user defeated The character entered, and the pre-set code section to be matched to user's displaying with the character according to acquired character.
4th acquiring unit 1112, for obtaining the script to match with the character according to the character input by user Template.
In specific implementation, the script template to be matched according to the character machining input by user and the character specifically may be used Think:
Judge whether the corresponding template identifier of the script template includes the character input by user.
If the corresponding template identifier of the script template includes the character input by user, which is determined For the script template to match with the character.
Wherein, each script template corresponds to only one template identifier.If the test case description scheme is interface The template identifier of control structure, the corresponding script template of the interface control structure can be that the interface control structure corresponds to control Identifier.For example, the interface control structure is loop control structure, then the template of the corresponding script template of the loop control structure Identifier is the corresponding control identifier of loop control structure, i.e., the template identifier is " retries ".
If the character input by user is " r ", by the way that the character " r " is matched one by one with all template identifiers, It judges whether the template identifier containing character " r ", if there is the template identifier containing character " r ", character will be contained The corresponding script template of template identifier of " r " is determined as the script template to match with the character.
Display unit 1113, it is alternative for the script template to match with the character to be showed in the template Frame.
In specific implementation, if the first character of template identifier is identical as the character input by user, by the template Character priority is showed in the alternative frame of template.The mode preferentially shown includes but not limited to that top set shows, is highlighted.
Second judgment unit 1114, for judging whether the script template for being showed in the alternative frame of the template is chosen In.
In specific implementation, determine that the script template is selected if the script template for being showed in the alternative frame of the template is clicked In.
Second processing unit 1115, if selected for the script template for being showed in the alternative frame of the template, judgement Selected script template is active.
Implement the embodiment of the present invention, by obtaining character input by user, automatic detection and character phase input by user The script template matched, and the script template is showed in the alternative frame of template, for selection by the user.Quick obtaining script can be achieved Template improves input efficiency.
First acquisition unit 112 obtains corresponding with the script template if being active for the script template Pre-set code section.
In specific implementation, the script template includes parameter input interface and pre-set code section.If the script template It is active, then generates the corresponding pre-set code section of the script template and the script template corresponding parameter input circle Face.
Second acquisition unit 113, for obtaining foot corresponding with the pre-set code section by the parameter input interface This parameter.
In specific implementation, which can be used for receiving script argument input by user, be inputted by the parameter Interface can obtain script argument corresponding with the pre-set code section input by user.
First processing units 114, for generating test case according to the pre-set code section and script argument.
Fig. 9 specifically is please referred to, is at the first of a kind of interface automatic test device that one embodiment of the invention provides Manage 114 schematic block diagram of unit.Further, the first processing units 114 include the 5th acquiring unit 1141, deleting unit 1142 and third processing unit 1143.
5th acquiring unit 1141, for obtaining the script template that the parameter input interface is null value.
Specifically, if the parameter input interface is null value, show that the parameter input interface is not received by user's input Script argument.
Deleting unit 1142, it is remaining pre- to obtain for deleting the script template that the parameter input interface is null value If code segment and script argument corresponding with the remaining pre-set code section.
Third processing unit 1143, for right according to remaining pre-set code section and with the remaining pre-set code section The script argument answered generates test case.
In specific implementation, the test case can be stored in by the form of script file in preset test catalogue, The file format of the script file can be YAML formats.By searching for the YAML formatted files in the preset test catalogue, Can quick obtaining to corresponding test case.
Implement the embodiment of the present invention, effectively prevent the problem of test case malfunctions caused by extra script template, improves The speed and accuracy that test case is write.
Task acquiring unit 120, for obtaining the corresponding test assignment list of the test case.
In specific implementation, a test case may include one or more than one test assignment.Each test is appointed Business is marked by preset task identifier, and the first row which may be disposed at each test assignment is most left Side, to realize the differentiation to different test assignments and improve the speed of identification test assignment.The task identifier can be "-". The script file of the test case is preserved by load, and identifies preset task identifier, can obtain the test case Corresponding test assignment list.
As a result generation unit 130 are executed for executing the corresponding test assignment of the test assignment list successively with generating As a result.
Wherein, different types of test assignment can be generated according to different types of test case description scheme.If test is used Example description scheme is that interface calls structure, and it is interface calling task which, which calls structure to correspond to the test assignment generated, this connects Mouth calling task is used to call the input parameter needed for execution action.It, should if test case description scheme is interface control structure It is Interface Controller task that interface control structure, which corresponds to the test assignment generated, which is used for according to corresponding control Logic executes control action.
In specific implementation, the script file of test case is preserved by load, such as by searching for the preset test YAML formatted files in catalogue, and according to corresponding filename is retrieved, to acquire and load corresponding script file, It can be obtained the corresponding test assignment list of the test case.The corresponding test assignment of the test assignment list is executed successively It can be specially putting in order according to the task identifier, execute the test assignment successively in accordance with the order from top to bottom.
Report generation unit 140, for generating test report according to the implementing result.
Figure 10 specifically is please referred to, for a kind of report life for interface automatic test device that one embodiment of the invention provides At 140 schematic block diagram of unit.Further, report generation unit 140 includes the 6th acquiring unit 141 and fourth process list Member 142.
6th acquiring unit 141, the success rate for obtaining the implementing result;
In specific implementation, by obtaining total successful execution number for executing number and the test assignment of test assignment, And successful execution number is divided by with total execution number and can be obtained the success rate of the implementing result.
Fourth processing unit 142, for generating corresponding test report according to the success rate of the implementing result.
In specific implementation, if the success rate is less than preset first threshold, the first test report is generated;If the success rate is big In or equal to preset first threshold, the second test report is generated.For example, the first threshold can be 90%.If success rate Less than 90%, the first test report of generation is test crash.If success rate is more than or equal to 90%, the second test of generation It is reported as being successfully tested.
Above-mentioned apparatus 100 can be implemented as a kind of form of computer program, and computer program can be as shown in figure 11 Computer equipment on run.
Please refer to Fig.1 the schematic block diagram that 1, Figure 11 is a kind of computer equipment provided in an embodiment of the present invention.The calculating 500 equipment of machine equipment can be terminal.The terminal can be smart mobile phone, tablet computer, laptop, desktop computer, a Personal digital assistant and Wearable etc. have the electronic equipment of communication function.
The computer equipment 500 includes processor 520, memory and the network interface connected by system bus 510 550, wherein memory may include non-volatile memory medium 530 and built-in storage 540.
The non-volatile memory medium 530 can storage program area 531 and computer program 532.The computer program 532 It is performed, processor 520 may make to execute a kind of automatic interface testing method.
The processor 520 supports the operation of entire computer equipment 500 for providing calculating and control ability.
The built-in storage 540 provides environment for the operation of the computer program in non-volatile memory medium, the computer When program is executed by processor 520, processor 520 may make to execute a kind of automatic interface testing method.
The network interface 550 such as sends the task dispatching of distribution for carrying out network communication.Those skilled in the art can manage Solution, the schematic block diagram of the computer equipment are only the block diagram with the relevant part-structure of the present invention program, composition pair The restriction for the computer equipment 500 that the present invention program is applied thereon, specific computer equipment 500 may include than in figure Shown more or fewer components either combine certain components or are arranged with different components.
Wherein, the processor 520 is for running program code stored in memory, to implement function such as:
Test case is generated according to preset test case description scheme;
Obtain the corresponding test assignment list of the test case;
The corresponding test assignment of the test assignment list is executed successively, to generate implementing result;
Test report is generated according to the implementing result.
In one embodiment, the test case description scheme includes script template, and the script template includes that parameter is defeated Enter interface and pre-set code section, processor 520 tests use in described generated according to preset test case description scheme of execution When the step of example, following steps are specifically executed:
Judge whether the script template is active;
If the script template is active, pre-set code section corresponding with the script template is obtained;
Script argument corresponding with the pre-set code section is obtained by the parameter input interface;
Test case is generated according to the pre-set code section and script argument.
In one embodiment, the test case description scheme further include for showing the alternative frame of the template of script template, Processor 520 execute it is described judge the step whether script template is active when, specifically execute following steps:
Character input by user is obtained by the alternative frame of the template;
The script template to match with the character is obtained according to the character input by user;
By described the alternative frame of the template is showed in the script template that the character matches;
Whether the script template that the alternative frame of the template is showed in described in judgement is selected;
If the script template for being showed in the alternative frame of the template is selected, judges that selected script template is in and swash State living.
In one embodiment, processor 520 is surveyed in described generated according to the pre-set code section and script argument of execution When the step of example on probation, following steps are specifically executed:
Obtain the script template that the parameter input interface is null value;
Delete the parameter input interface be null value script template, with obtain remaining pre-set code section and with it is described The corresponding script argument of remaining pre-set code section;
It generates and tests according to remaining pre-set code section and script argument corresponding with the remaining pre-set code section Use-case.
In one embodiment, processor 520 execute it is described according to the implementing result generate test report step when, It is specific to execute following steps:
Obtain the success rate of the implementing result;
Corresponding test report is generated according to the success rate of the implementing result.
It should be appreciated that in embodiments of the present invention, processor 520 can be central processing unit (Central ProcessingUnit, CPU), which can also be other general processors, digital signal processor (Digital Signal Processor, DSP), application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable GateArray, FPGA) or other programmable logic devices Part, discrete gate or transistor logic, discrete hardware components etc..Wherein, general processor can be microprocessor or The processor can also be any conventional processor etc..
It will be understood by those skilled in the art that the schematic block diagram of the computer equipment 500 is not constituted and is set to computer Standby 500 restriction may include either combining certain components or different component cloth than illustrating more or fewer components It sets.
A kind of computer readable storage medium is provided in another embodiment of the invention, the computer readable storage medium It is stored with computer program, wherein computer program includes program instruction.Described program instruction is realized such as when being executed by processor Lower step:
Test case is generated according to preset test case description scheme;
Obtain the corresponding test assignment list of the test case;
The corresponding test assignment of the test assignment list is executed successively, to generate implementing result;
Test report is generated according to the implementing result.
In one embodiment, the test case description scheme includes script template, and the script template includes that parameter is defeated Enter interface and pre-set code section, described program instruction is executed by processor described according to the description of preset test case to realize When the step of structural generation test case, it is implemented as follows step:
Judge whether the script template is active;
If the script template is active, pre-set code section corresponding with the script template is obtained;
Script argument corresponding with the pre-set code section is obtained by the parameter input interface;
Test case is generated according to the pre-set code section and script argument.
In one embodiment, the test case description scheme further include for showing the alternative frame of the template of script template, Described program instruction be executed by processor with realize it is described judge the step whether script template is active when, have Body realizes following steps:
Character input by user is obtained by the alternative frame of the template;
The script template to match with the character is obtained according to the character input by user;
By described the alternative frame of the template is showed in the script template that the character matches;
Whether the script template that the alternative frame of the template is showed in described in judgement is selected;
If the script template for being showed in the alternative frame of the template is selected, judges that selected script template is in and swash State living.
In one embodiment, described program instruction be executed by processor with realize it is described according to the pre-set code section and When script argument generates the step of test case, it is implemented as follows step:
Obtain the script template that the parameter input interface is null value;
Delete the parameter input interface be null value script template, with obtain remaining pre-set code section and with it is described The corresponding script argument of remaining pre-set code section;
It generates and tests according to remaining pre-set code section and script argument corresponding with the remaining pre-set code section Use-case.
In one embodiment, described program instruction is executed by processor to realize that described generated according to the implementing result is surveyed When trying the step of report, it is implemented as follows step:
Obtain the success rate of the implementing result;
Corresponding test report is generated according to the success rate of the implementing result.
The computer readable storage medium can be USB flash disk, mobile hard disk, read-only memory (ROM, Read- OnlyMemory), the various media that can store program code such as magnetic disc or CD.
Those of ordinary skill in the art may realize that lists described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware With the interchangeability of software, each exemplary composition and step are generally described according to function in the above description.This A little functions are implemented in hardware or software actually, depend on the specific application and design constraint of technical solution.Specially Industry technical staff can use different methods to achieve the described function each specific application, but this realization is not It is considered as beyond the scope of this invention.
It is apparent to those skilled in the art that for convenience of description and succinctly, the dress of foregoing description The specific work process with unit is set, can refer to corresponding processes in the foregoing method embodiment, details are not described herein.
In several embodiments provided by the present invention, it should be understood that disclosed device and method can pass through it Its mode is realized.For example, the apparatus embodiments described above are merely exemplary.For example, the division of each unit, only Only a kind of division of logic function, formula that in actual implementation, there may be another division manner.Such as more than one unit or component can To combine or be desirably integrated into another system, or some features can be ignored or not executed.
The steps in the embodiment of the present invention can be sequentially adjusted, merged and deleted according to actual needs.This hair Unit in bright embodiment device can be combined, divided and deleted according to actual needs.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also It is that each unit physically exists alone, can also be during two or more units are integrated in one unit.It is above-mentioned integrated The form that hardware had both may be used in unit is realized, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and when sold or used as an independent product, It can be stored in a computer read/write memory medium.Based on this understanding, technical scheme of the present invention substantially or Person says that all or part of the part that contributes to existing technology or the technical solution can body in the form of software products Reveal and, which is stored in a storage medium, including some instructions are with so that a computer is set Standby (can be personal computer, terminal or the network equipment etc.) execute each embodiment the method for the present invention whole or Part steps.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can readily occur in various equivalent modifications or replace It changes, these modifications or substitutions should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with right It is required that protection domain subject to.

Claims (10)

1. a kind of automatic interface testing method, which is characterized in that including:
Test case is generated according to preset test case description scheme;
Obtain the corresponding test assignment list of the test case;
The corresponding test assignment of the test assignment list is executed successively, to generate implementing result;
Test report is generated according to the implementing result.
2. the method as described in claim 1, which is characterized in that the test case description scheme includes script template, described Script template includes parameter input interface and pre-set code section, and described generated according to preset test case description scheme is tested Use-case, including:
Judge whether the script template is active;
If the script template is active, pre-set code section corresponding with the script template is obtained;
Script argument corresponding with the pre-set code section is obtained by the parameter input interface;
Test case is generated according to the pre-set code section and script argument.
3. method as claimed in claim 2, which is characterized in that the test case description scheme further includes for showing script The alternative frame of template of template, it is described to judge whether the script template is active, including:
Character input by user is obtained by the alternative frame of the template;
The script template to match with the character is obtained according to the character input by user;
By described the alternative frame of the template is showed in the script template that the character matches;
Whether the script template that the alternative frame of the template is showed in described in judgement is selected;
If the script template for being showed in the alternative frame of the template is selected, judge that selected script template is in activation shape State.
4. such as claim 2 to 3 any one of them method, which is characterized in that described according to the pre-set code section and foot This parameter generates test case, including:
Obtain the script template that the parameter input interface is null value;
Delete the parameter input interface be null value script template, with obtain remaining pre-set code section and with the residue The corresponding script argument of pre-set code section;
Test case is generated according to remaining pre-set code section and script argument corresponding with the remaining pre-set code section.
5. the method as described in claim 1, which is characterized in that it is described that test report is generated according to the implementing result, including:
Obtain the success rate of the implementing result;
Corresponding test report is generated according to the success rate of the implementing result.
6. a kind of interface automatic test device, which is characterized in that including:
Use-case generation unit, for generating test case according to preset test case description scheme;
Task acquiring unit, for obtaining the corresponding test assignment list of the test case;
As a result generation unit, for executing the corresponding test assignment of the test assignment list successively, to generate implementing result;
Report generation unit, for generating test report according to the implementing result.
7. device as claimed in claim 6, which is characterized in that the test case description scheme includes script template, described Script template includes parameter input interface and pre-set code section, and the use-case generation unit includes:
First judging unit, for judging whether the script template is active;
First acquisition unit obtains corresponding with the script template default if being active for the script template Code segment;
Second acquisition unit, for obtaining script argument corresponding with the pre-set code section by the parameter input interface;
First processing units, for generating test case according to the pre-set code section and script argument.
8. device as claimed in claim 7, which is characterized in that the test case description scheme further includes for showing script The alternative frame of template of template, first judging unit include:
Third acquiring unit, for obtaining character input by user by the alternative frame of the template;
4th acquiring unit, for obtaining the script template to match with the character according to the character input by user;
Display unit, for being showed in the alternative frame of the template with the script template that the character matches by described;
Second judgment unit, for judging whether the script template for being showed in the alternative frame of the template is selected;
Second processing unit judges selected if selected for the script template for being showed in the alternative frame of the template Script template is active.
9. a kind of computer equipment, including memory, processor and it is stored on the memory and can be on the processor The computer program of operation, which is characterized in that the processor is realized when executing described program as any in claim 1 to 5 The automatic interface testing method of item.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has computer journey Sequence, the computer program include program instruction, and described program instruction makes the processor execute such as when being executed by a processor Claim 1-5 any one of them automatic interface testing methods.
CN201810156599.6A 2018-02-24 2018-02-24 Interface automation test method, device, equipment and computer readable storage medium Active CN108388514B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810156599.6A CN108388514B (en) 2018-02-24 2018-02-24 Interface automation test method, device, equipment and computer readable storage medium
PCT/CN2018/084310 WO2019161619A1 (en) 2018-02-24 2018-04-25 Automatic interface test method and apparatus, and device and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810156599.6A CN108388514B (en) 2018-02-24 2018-02-24 Interface automation test method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108388514A true CN108388514A (en) 2018-08-10
CN108388514B CN108388514B (en) 2021-02-23

Family

ID=63068478

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810156599.6A Active CN108388514B (en) 2018-02-24 2018-02-24 Interface automation test method, device, equipment and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN108388514B (en)
WO (1) WO2019161619A1 (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710532A (en) * 2018-12-28 2019-05-03 北京金山安全软件有限公司 Test case management method and device and electronic equipment
CN109783298A (en) * 2019-01-18 2019-05-21 上海磐启微电子有限公司 A kind of flexible controllable software-hardware synergism SoC verification method of process
CN109783367A (en) * 2018-12-15 2019-05-21 中国平安人寿保险股份有限公司 Interface test method, device, computer installation and storage medium
CN110046088A (en) * 2019-02-19 2019-07-23 阿里巴巴集团控股有限公司 A kind of interface test method, device and equipment
CN110069735A (en) * 2019-03-20 2019-07-30 平安普惠企业管理有限公司 JS code is anti-to be repeatedly injected method, apparatus, computer equipment and storage medium
CN111026631A (en) * 2018-10-09 2020-04-17 顺丰科技有限公司 Automatic interface detection method and device and server
CN111104312A (en) * 2019-11-21 2020-05-05 苏州浪潮智能科技有限公司 Test case variable storage management method, system, terminal and storage medium
CN111199146A (en) * 2020-01-10 2020-05-26 深圳前海环融联易信息科技服务有限公司 Test report generation method and device, computer equipment and storage medium
CN112231210A (en) * 2020-10-13 2021-01-15 中移(杭州)信息技术有限公司 Test method, equipment and storage medium under network function virtualization environment
CN112286825A (en) * 2020-11-24 2021-01-29 北斗星通智联科技有限责任公司 Screen testing method and device for intelligent cabin and electronic equipment
CN113918395A (en) * 2021-09-29 2022-01-11 浪潮(山东)计算机科技有限公司 Test report generation method, device and medium
CN114448665A (en) * 2021-12-22 2022-05-06 天翼云科技有限公司 Method and device for detecting WEB application firewall rules and electronic equipment

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11132273B1 (en) * 2020-12-15 2021-09-28 International Business Machines Corporation System testing infrastructure with hidden variable, hidden attribute, and hidden value detection

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107301122A (en) * 2017-05-10 2017-10-27 深圳市小牛在线互联网信息咨询有限公司 interface test method, device, storage medium and computer equipment
CN107391379A (en) * 2017-07-28 2017-11-24 武汉斗鱼网络科技有限公司 Interface automatic test approach and device
CN107506294A (en) * 2017-07-04 2017-12-22 深圳市小牛在线互联网信息咨询有限公司 Visualize automated testing method, device, storage medium and computer equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104834595B (en) * 2015-02-15 2017-09-12 网易(杭州)网络有限公司 A kind of Visual Automatic Test method and system
CN105335293B (en) * 2015-11-30 2019-08-30 努比亚技术有限公司 A kind of automatization test system and method based on interface concurrent
CN106095673B (en) * 2016-06-07 2018-12-14 深圳市泰久信息系统股份有限公司 Automated testing method and system based on WEB interface

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107301122A (en) * 2017-05-10 2017-10-27 深圳市小牛在线互联网信息咨询有限公司 interface test method, device, storage medium and computer equipment
CN107506294A (en) * 2017-07-04 2017-12-22 深圳市小牛在线互联网信息咨询有限公司 Visualize automated testing method, device, storage medium and computer equipment
CN107391379A (en) * 2017-07-28 2017-11-24 武汉斗鱼网络科技有限公司 Interface automatic test approach and device

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111026631A (en) * 2018-10-09 2020-04-17 顺丰科技有限公司 Automatic interface detection method and device and server
CN111026631B (en) * 2018-10-09 2024-03-26 顺丰科技有限公司 Automatic interface detection method, device and server
CN109783367B (en) * 2018-12-15 2023-10-27 中国平安人寿保险股份有限公司 Interface testing method, device, computer device and storage medium
CN109783367A (en) * 2018-12-15 2019-05-21 中国平安人寿保险股份有限公司 Interface test method, device, computer installation and storage medium
CN109710532A (en) * 2018-12-28 2019-05-03 北京金山安全软件有限公司 Test case management method and device and electronic equipment
CN109783298A (en) * 2019-01-18 2019-05-21 上海磐启微电子有限公司 A kind of flexible controllable software-hardware synergism SoC verification method of process
CN110046088A (en) * 2019-02-19 2019-07-23 阿里巴巴集团控股有限公司 A kind of interface test method, device and equipment
CN110069735A (en) * 2019-03-20 2019-07-30 平安普惠企业管理有限公司 JS code is anti-to be repeatedly injected method, apparatus, computer equipment and storage medium
CN111104312A (en) * 2019-11-21 2020-05-05 苏州浪潮智能科技有限公司 Test case variable storage management method, system, terminal and storage medium
CN111199146B (en) * 2020-01-10 2023-09-26 深圳前海环融联易信息科技服务有限公司 Test report generation method, device, computer equipment and storage medium
CN111199146A (en) * 2020-01-10 2020-05-26 深圳前海环融联易信息科技服务有限公司 Test report generation method and device, computer equipment and storage medium
CN112231210A (en) * 2020-10-13 2021-01-15 中移(杭州)信息技术有限公司 Test method, equipment and storage medium under network function virtualization environment
CN112286825A (en) * 2020-11-24 2021-01-29 北斗星通智联科技有限责任公司 Screen testing method and device for intelligent cabin and electronic equipment
CN113918395A (en) * 2021-09-29 2022-01-11 浪潮(山东)计算机科技有限公司 Test report generation method, device and medium
CN114448665A (en) * 2021-12-22 2022-05-06 天翼云科技有限公司 Method and device for detecting WEB application firewall rules and electronic equipment

Also Published As

Publication number Publication date
WO2019161619A1 (en) 2019-08-29
CN108388514B (en) 2021-02-23

Similar Documents

Publication Publication Date Title
CN108388514A (en) Automatic interface testing method, device, equipment and computer readable storage medium
US20080065928A1 (en) Technique for supporting finding of location of cause of failure occurrence
CN109815111A (en) Gray scale test method, device, computer equipment and storage medium
CN107948744A (en) Interface detection method, interface detection device and computer-readable recording medium
EP4182796B1 (en) Machine learning-based techniques for providing focus to problematic compute resources represented via a dependency graph
CN109684213A (en) A kind of test method, device and storage medium
CN109634838A (en) Position method, apparatus, storage medium and the electronic equipment of application failure
CN113391970A (en) Chip testing method and device for heterogeneous many-core processor
CN109388420A (en) Application upgrade test method, device, computer equipment and storage medium
CN109086427A (en) Data comparison method, apparatus, computer equipment and storage medium
CN111008031B (en) Component updating method and device, electronic equipment and computer readable storage medium
JP2008009496A (en) Maintenance service operation system and maintenance service operation method
CN117009221A (en) Processing method, device, equipment, storage medium and program product for product test
CN113112217B (en) Business process configuration method, device, electronic equipment and computer readable medium
CN110517026A (en) It prevents the method, apparatus for repeating to cash, cash system and readable storage medium storing program for executing
CN114218072A (en) Test script generation method and device, storage medium and computer equipment
CN109325851A (en) Methods of exhibiting, system, computer equipment and the readable storage medium storing program for executing of probability of cheating
US20230141642A1 (en) Work assignment device
CN114253920A (en) Transaction reordering method, device, equipment and readable storage medium
CN112787910A (en) Message processing method and device, electronic equipment and storage medium
JP2018026056A (en) Software quality determination method
CN114513686A (en) Method and device for determining video information and storage medium
CN112583660A (en) Main domain and standby domain test comparison method, device and system of recommendation platform
CN117610505B (en) Data processing method and device based on standard model
CN108712284A (en) A kind of localization method, device and the service server of failure business

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
GR01 Patent grant
GR01 Patent grant