CN108763083A - Automated testing method, device, computer equipment and storage medium - Google Patents

Automated testing method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN108763083A
CN108763083A CN201810540124.7A CN201810540124A CN108763083A CN 108763083 A CN108763083 A CN 108763083A CN 201810540124 A CN201810540124 A CN 201810540124A CN 108763083 A CN108763083 A CN 108763083A
Authority
CN
China
Prior art keywords
test
case
parsing
initialization
cases
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
CN201810540124.7A
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 Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201810540124.7A priority Critical patent/CN108763083A/en
Publication of CN108763083A publication Critical patent/CN108763083A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

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

This application discloses a kind of automated testing method, device, computer equipment and storage mediums.This method includes:Build test frame;The test data uploaded is obtained, the test data is assembled in the test frame to obtain initialization test case;Initialization case is parsed, the test cases after being parsed;Test cases after parsing is distributed to corresponding load end;The test result for obtaining the load end feedback, the test result is filled to preset report template and generates test report, the test report is sent to preset associated end.The method achieve the automatic assemblings of test data, and carry out large batch of automatic test, improve the efficiency of automatic test.

Description

Automated testing method, device, computer equipment and storage medium
Technical field
This application involves automatization testing technique fields more particularly to a kind of automated testing method, device, computer to set Standby and storage medium.
Background technology
Currently, when testing during the test test case, it is usually enterprising in the local terminal of tester The test of row manually or automatically, this results in split it in large-scale test event, be split as multiple small-sized It is redistributed to each tester after test assignment to test, this, which is resulted in, is difficult centralized and unified and obtains each test assignment automatically Testing progress.
Invention content
This application provides a kind of automated testing method, device, computer equipment and storage mediums, it is intended to solve existing It can only be split in the medium-and-large-sized test event of technology, each survey is redistributed to after being split as multiple small-sized test assignments Examination personnel test, this result in be difficult testing progress that is centralized and unified and obtaining each test assignment automatically the problem of.
In a first aspect, this application provides a kind of automated testing methods comprising:
Build test frame;
The test data uploaded is obtained, the test data is assembled in the test frame to obtain initialization survey Try case;
Initialization case is parsed, the test cases after being parsed;
Test cases after parsing is distributed to corresponding load end;
The test result for obtaining the load end feedback, the test result is filled to preset report template to generate and is surveyed Examination report, preset associated end is sent to by the test report.
Second aspect, this application provides a kind of automatic test devices comprising:
Frame builds unit, for building test frame;
Case module units, for obtains upload test data, in the test frame to the test data into Row assembling obtains initialization test case;
Example analysis unit, for being parsed to initialization case, the test cases after being parsed;
Case Dispatching Unit, for the test cases after parsing to be distributed to corresponding load end;
As a result feedback unit, the test result for obtaining the load end feedback, the test result is filled to pre- If report template generate test report, the test report is sent to preset associated end.
The third aspect, the application provide a kind of computer equipment again, including memory, processor and are stored in described deposit On reservoir and the computer program that can run on the processor, the processor realize this when executing the computer program Any one of them automated testing method provided is provided.
Fourth aspect, present invention also provides a kind of storage mediums, wherein the storage medium is stored with computer program, The computer program includes program instruction, and described program instruction makes the processor execute the application when being executed by a processor Any one of them automated testing method of offer.
A kind of automated testing method of the application offer, device, computer equipment and storage medium.This method is by building Test frame;The test data uploaded is obtained, the test data is assembled in the test frame and is initialized Test cases;Initialization case is parsed, the test cases after being parsed;Test cases after parsing is distributed to pair Answer load end;The test result for obtaining the load end feedback, the test result is filled to preset report template and is generated The test report is sent to preset associated end by test report.The method achieve the automatic assemblings of test data, go forward side by side The large batch of automatic test of row, improves the efficiency of automatic test.
Description of the drawings
It, below will be to needed in embodiment description in order to illustrate more clearly of the embodiment of the present application technical solution Attached drawing is briefly described, it should be apparent that, the accompanying drawings in the following description is some embodiments of the present application, 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 schematic flow diagram of automated testing method provided by the embodiments of the present application;
Fig. 2 is a kind of sub-process schematic diagram of automated testing method provided by the embodiments of the present application;
Fig. 3 is a kind of another schematic flow diagram of automated testing method provided by the embodiments of the present application;
Fig. 4 is a kind of another sub-process schematic diagram of automated testing method provided by the embodiments of the present application;
Fig. 5 is a kind of another schematic flow diagram of automated testing method provided by the embodiments of the present application;
Fig. 6 is a kind of schematic block diagram of automatic test device provided by the embodiments of the present application;
Fig. 7 is a kind of subelement schematic block diagram of automatic test device provided by the embodiments of the present application;
Fig. 8 is a kind of another schematic block diagram of automatic test device provided by the embodiments of the present application;
Fig. 9 is a kind of another subelement schematic block diagram of automatic test device provided by the embodiments of the present application;
Figure 10 is a kind of another schematic block diagram of automatic test device provided by the embodiments of the present application;
Figure 11 is a kind of schematic block diagram of computer equipment provided by the embodiments of the present application.
Specific implementation mode
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete Site preparation describes, it is clear that described embodiment is some embodiments of the present application, instead of all the embodiments.Based on this Shen Please in embodiment, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall in the protection scope of this application.
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 of the other feature, whole is not precluded Body, step, operation, element, component and/or its presence or addition gathered.
It is also understood that the term used in this present specification is merely for the sake of the mesh for describing specific embodiment And be not intended to limit the application.As present specification 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.
It will be further appreciated that the term "and/or" used in present specification and the appended claims is Refer to any combinations and all possible combinations of one or more of associated item listed, and includes these combinations.
Referring to Fig. 1, Fig. 1 is a kind of schematic flow diagram of automated testing method provided by the embodiments of the present application.The party Method is applied in server.As shown in Figure 1, the method comprising the steps of S101~S105.
S101, test frame is built.
In the present embodiment, quality technology cloud platform (can be understood as server) need to be first built, the quality technology cloud is flat It is integrated with automated test frame on platform, when building automated test frame, needs to build each API module (to be specifically interface Call API module, database API module, Excel Form Handles API module, the date handle API module), data management module, Interface administration module, journal output module, exception processing module, concurrent processing module, distributed processing modules, case manage mould Block, result report output module.
Wherein, interface calls API module, and encapsulating http, https, esg agreement, (esg agreements are Zookeeper agreements A kind of warping protocols) the interface requests mode such as GET, POST, support multi-thread concurrent request.It is based on Httpclient.jar, java multithreading, and processed thread-safe problem therein.In automatic test course In, frequent calling interface is needed, this interface calls all kinds of API in API module that can meet testing requirement.
Database API module encapsulates and carries out additions and deletions to oracle database and change to look into and the methods of automatic regular polling, number C3P0 (C3P0 is a kind of Thread Pool Technology), the letters such as configurableization managed database, usemame/password are used according to source control Breath, performance is splendid, in automatic test course, needs frequent Accessing Oracle Database, in this database API module API can meet demand.
Excel Form Handle API modules encapsulate to Excel2003,2007 reading, input API, are based on POI.jar (POI.jar is the jar packets that Tentative Study of Achievement of Manipulation on Excel is used in java), mould API in the block can support to prompt to read according to left-most cell lattice Right cell lattice value prompts to read lower unit lattice value according to upper cell, and entire area unit is obtained according to diagonal cell Lattice value.
Date handle API module, encapsulate related API handle the date, be based on Date, Calendar, For the tool-class such as SimpleDateFormat, it can be achieved that the date compares, acquisition is arbitrary as unit difference using year, month, day, hour, min, second Time, can according to the time obtain current year which week what day needed to date frequent processing operation in automatic test course, This module can meet demand.
Data management module, for carrying out Classification Management to test data.
Interface administration module, for multiple api interfaces in management automation test frame, because in automatic test mistake Cheng Zhong, there are many called number of repetition of the same interface, are simplified code, shorten later maintenance workload, interface needs list Solely management is called, and the later stage is when changing a plurality of test cases, it is only necessary to safeguard an interface.
Journal output module, encapsulation are based on LOG4J.jar to the API such as daily record outgoing management in automatic test course, can Four ranks such as error, log, stdout, info are arranged to daily record, phase is flexibly called for different daily record output levels Close API.
Exception processing module, encapsulation to occur in automatic test course it is abnormal the API such as how to handle, be based on Exception interfaces encapsulate a large amount of self-defined exceptions, convenient for the quick positioning question root when occurring abnormal.
Concurrent processing module, encapsulation automate the API such as case to needing to execute using multithreading in automatic test course, Basic java multithreadings, this module provide initialization thread pond, calling, hang-up, destroying threads API, and pass through Lock technology has handled thread-safe problem.
Distributed processing modules, in automatic test course, if case is excessive, the efficiency of an execution machine is too low, It needs fractionation case to be executed on more execution machines, at this time needs the configuration packet in testng.xml files, pass through difference It is grouped to specify unique execution machine, improves execution efficiency.
Case management module, this module is to execute the module of test cases, and by testng frames ,@Test explain to mark Show, assert static methods assert case implementing result.
As a result report output module, this module are after management test cases has executed, to be exported in the form of report, test case Example sum is executed through number, percent of pass, the displaying of failure testing case, and failure cause displaying is sent out with mail he.
After completing the building of automated test frame, you can carry out automatic test.That is automated test frame packet It includes multiple modules and obtains test result after test data then carries out various interactions and processing in this multiple module.
S102, the test data uploaded is obtained, the test data is assembled to obtain just in the test frame Beginningization test cases.
In one embodiment, as shown in Fig. 2, the step S102 includes:
S1021, test data is obtained, is corresponded to according to test data and generates each field;
S1022, according to preset testing process, extract required field groups in test data corresponds to each field generated Dress up initialization test case.
In the present embodiment, test data is obtained by Excel Form Handle API modules, is corresponded to and is given birth to according to test data At each field;It is handled in API module by Excel, initialization test data are subsequently to assemble different test cases;? When test data is imported in Excel tables, can be corresponded to according to test data and generate each field, then by test data fill to In Excel tables;For example, it is Zhang San, man, 30,440305198801010013, ShenZhen,GuangDong South Mountain, loan to have a test data 20000 yuan of the money amount of money when being filled with into Excel tables, first generates name, gender, age, ID card No., address institute In fields such as region, the amounts of the loan, then test data is imported by field in Excel tables and (Zhang San is filled into name Field, and so on).
Then it is carried in test data corresponds to each field generated according to preset testing process by case management module Required field is taken to be assembled into initialization test case.In case management module, start according to test data assembling test case Example, the test data called interface packaged in API module by interface and initialized can be assembled into one initially Change test cases.
For example, on the basis of test data, increase some testing process and enter, you can is assembled into the test case of initialization Example;It is male if test data initial in the sheet1 tables of Excel tables is Zhang San, 30,440305198801010013, extensively Eastern Shenzhen South Mountain, 20000 yuan of the amount of the loan, by the basis of test data, increasing some testing process, such as 1) The select*from sheet1where field names=amount of the loan (obtain number from the amount of the loan field of sheet1 tables According to);2) the update sheet1set amounts of the loan -=20000 are (i.e. from a occurrence of the amount of the loan field of sheet1 tables It subtracts 20000);3) the delete from sheet1where amounts of the loan<0 (deletes the amount of the loan field of sheet1 tables Intermediate value is less than 0 test data) etc., by the way that testing process and test data are assembled, you can obtain initialization test case.It is logical Automated test frame is crossed, realizes and is filled with generation test cases to automatic group of test data, survey is write without tester Try case.
S103, initialization case is parsed, the test cases after being parsed.
In the present embodiment, initialization test case is parsed by database API module, the survey after being parsed Try case;After i.e. initialization test case is completed, complicated test cases need to be assembled, is needed at this time through database API Packaged method parses SQL statement in initialization test case in module, according to SQL statement to test data into Row alignment processing, the test cases after being parsed, this process are also database API module by SQL scripts to test Data carry out alignment processing to be parsed, and resolving is realized by the automatic calling of api interface.
In one embodiment, as shown in figure 3, further including after the step S103:
S103a, the corresponding initial assembling daily record of initialization test case, and parsing are initialized into solution corresponding when case Analysis daily record is stored.
In the present embodiment, test case will be assembled to obtain initially to assemble day corresponding to initialization test case Will, and parsing daily record corresponding to test cases after being parsed to initialization test case are stored to daily record and are exported Module.Journal output module is needed to record automatic assembling process in entire complicated case assembling process, in order to The assembling process of test cases is recorded by journal output module.
S104, the test cases after parsing is distributed to corresponding load end.
In one embodiment, as shown in figure 4, the step S104 includes:
S1041, thread pool is added in the test cases after parsing;
S1042, the load end that test mode in multiple load ends is idle state is obtained, selects a son in thread pool Test cases after parsing is sent to one of load end by thread.
In the present embodiment, test cases after parsing is sent to the queue in the block of concurrent processing mould and is lined up (team Row can be understood as thread pool) when, the test cases after parsing is distributed according to the middle setting distribution rules of concurrent processing module To corresponding load end.I.e. concurrent processing module receives the test cases after the parsing transmitted by database API module, after parsing Test cases be added thread pool;The test cases after being parsed in thread pool is obtained, and is obtained by distributed processing modules multiple Test mode is the load end of idle state in load end, and is sent to one of load end.If acquired single parsing Test cases afterwards exceeds preset case file size (such as 50K), and the test cases after distributed processing modules are parsed is torn open Divide at most a sub- test cases, and the size of each sub- test cases all keeps below preset case file size, Zhi Houzai It is one of idle state load end that multiple sub- test cases, which are distributed to test mode, by distributed processing modules.
S105, the test result for obtaining the load end feedback, the test result is filled to preset report template Test report is generated, the test report is sent to preset associated end.
Wherein, the test result is to be successfully tested result or test crash result.
In the present embodiment, the test result in case management module is obtained by result report output module, to all It after the test result of test cases is counted and integrated, is exported in the form of test report, wherein at least includes test cases Sum is executed through number, percent of pass, the displaying of failure testing case, and the information such as failure cause displaying, test report is with mail he It sends out to preset contact number.
In one embodiment, as shown in figure 5, further including in the step S105:
If S105a, the test result are test crash tests exception as a result, positioning in the test cases after the parsing Abort situation.
In the present embodiment, by Mission Monitor platform obtain load end test result, and by test result store to Case management module.At this point, carrying out automatic test to the test cases after parsing in load end, test result is obtained, and Case management module is fed back to be stored;If during automatic test, deposit corresponding to test cases after parsing Test result be status of fail (wherein can assert case implementing result by assert static methods), then call exception The method encapsulated in processing module positions the position for leading to test abnormal failure in the test cases after the parsing.
As it can be seen that the method achieve the automatic assemblings of test data, and large batch of automatic test is carried out, improved certainly The efficiency of dynamicization test.
The embodiment of the present application also provides a kind of automatic test device, and the automatic test device is aforementioned automatic for executing Change any embodiment of test method.Specifically, referring to Fig. 6, Fig. 6 is a kind of automatic test provided by the embodiments of the present application The schematic block diagram of device.Automatic test device 100 can be configured in server.
It is illustrated as shown in fig. 6, automatic test device 100 builds unit 101, case module units 102, case including frame Analyse unit 103, case Dispatching Unit 104 and result feedback unit 105.
Wherein, frame builds unit 101, for building test frame.
In the present embodiment, it when building automated test frame, needs to build each API module (to be specifically that interface calls API module, database API module, Excel Form Handles API module, the date handle API module), data management module, interface Management module, journal output module, exception processing module, concurrent processing module, distributed processing modules, case management module, As a result report output module.
Wherein, interface calls API module, and encapsulating http, https, esg agreement, (esg agreements are Zookeeper agreements A kind of warping protocols) the interface requests mode such as GET, POST, support multi-thread concurrent request.It is based on Httpclient.jar, java multithreading, and processed thread-safe problem therein.In automatic test course In, frequent calling interface is needed, this interface calls all kinds of API in API module that can meet testing requirement.
Database API module encapsulates and carries out additions and deletions to oracle database and change to look into and the methods of automatic regular polling, number C3P0 (C3P0 is a kind of Thread Pool Technology), the letters such as configurableization managed database, usemame/password are used according to source control Breath, performance is splendid, in automatic test course, needs frequent Accessing Oracle Database, in this database API module API can meet demand.
Excel Form Handle API modules encapsulate to Excel2003,2007 reading, input API, are based on POI.jar (POI.jar is the jar packets that Tentative Study of Achievement of Manipulation on Excel is used in java), mould API in the block can support to prompt to read according to left-most cell lattice Right cell lattice value prompts to read lower unit lattice value according to upper cell, and entire area unit is obtained according to diagonal cell Lattice value.
Date handle API module, encapsulate related API handle the date, be based on Date, Calendar, For the tool-class such as SimpleDateFormat, it can be achieved that the date compares, acquisition is arbitrary as unit difference using year, month, day, hour, min, second Time, can according to the time obtain current year which week what day needed to date frequent processing operation in automatic test course, This module can meet demand.
Data management module, for carrying out Classification Management to test data.
Interface administration module, for multiple api interfaces in management automation test frame, because in automatic test mistake Cheng Zhong, there are many called number of repetition of the same interface, are simplified code, shorten later maintenance workload, interface needs list Solely management is called, and the later stage is when changing a plurality of test cases, it is only necessary to safeguard an interface.
Journal output module, encapsulation are based on LOG4J.jar to the API such as daily record outgoing management in automatic test course, can Four ranks such as error, log, stdout, info are arranged to daily record, phase is flexibly called for different daily record output levels Close API.
Exception processing module, encapsulation to occur in automatic test course it is abnormal the API such as how to handle, be based on Exception interfaces encapsulate a large amount of self-defined exceptions, convenient for the quick positioning question root when occurring abnormal.
Concurrent processing module, encapsulation automate the API such as case to needing to execute using multithreading in automatic test course, Basic java multithreadings, this module provide initialization thread pond, calling, hang-up, destroying threads API, and pass through Lock technology has handled thread-safe problem.
Distributed processing modules, in automatic test course, if case is excessive, the efficiency of an execution machine is too low, It needs fractionation case to be executed on more execution machines, at this time needs the configuration packet in testng.xml files, pass through difference It is grouped to specify unique execution machine, improves execution efficiency.
Case management module, this module is to execute the module of test cases, and by testng frames ,@Test explain to mark Show, assert static methods assert case implementing result.
As a result report output module, this module are after management test cases has executed, to be exported in the form of report, test case Example sum is executed through number, percent of pass, the displaying of failure testing case, and failure cause displaying is sent out with mail he.
After completing the building of automated test frame, you can carry out automatic test.
Case module units 102, for obtaining the test data uploaded, to the test data in the test frame It is assembled to obtain initialization test case.
In one embodiment, as shown in fig. 7, the case module units 102 includes:
Test data acquiring unit 1021 corresponds to according to test data for obtaining test data and generates each field;
Data assembling unit 1022 is used for according to preset testing process, in test data corresponds to each field generated Field needed for extraction is assembled into initialization test case.
In the present embodiment, test data is obtained by Excel Form Handle API modules, is corresponded to and is given birth to according to test data At each field;It is handled in API module by Excel, initialization test data are subsequently to assemble different test cases;? When test data is imported in Excel tables, can be corresponded to according to test data and generate each field, then by test data fill to In Excel tables;For example, it is Zhang San, man, 30,440305198801010013, ShenZhen,GuangDong South Mountain, loan to have a test data 20000 yuan of the money amount of money when being filled with into Excel tables, first generates name, gender, age, ID card No., address institute In fields such as region, the amounts of the loan, then test data is imported by field in Excel tables and (Zhang San is filled into name Field, and so on).
Then it is carried in test data corresponds to each field generated according to preset testing process by case management module Required field is taken to be assembled into initialization test case.In case management module, start according to test data assembling test case Example, the test data called interface packaged in API module by interface and initialized can be assembled into one initially Change test cases.
For example, on the basis of test data, increase some testing process and enter, you can is assembled into the test case of initialization Example;It is male if test data initial in the sheet1 tables of Excel tables is Zhang San, 30,440305198801010013, extensively Eastern Shenzhen South Mountain, 20000 yuan of the amount of the loan, by the basis of test data, increasing some testing process, such as 1) The select*from sheet1where field names=amount of the loan (obtain number from the amount of the loan field of sheet1 tables According to);2) the update sheet1set amounts of the loan -=20000 are (i.e. from a occurrence of the amount of the loan field of sheet1 tables It subtracts 20000);3) the delete from sheet1where amounts of the loan<0 (deletes the amount of the loan field of sheet1 tables Intermediate value is less than 0 test data) etc., by the way that testing process and test data are assembled, you can obtain initialization test case.It is logical Automated test frame is crossed, realizes and is filled with generation test cases to automatic group of test data, survey is write without tester Try case.
Example analysis unit 103, for being parsed to initialization case, the test cases after being parsed.
In the present embodiment, initialization test case is parsed by database API module, the survey after being parsed Try case;After i.e. initialization test case is completed, complicated test cases need to be assembled, is needed at this time through database API Packaged method parses SQL statement in initialization test case in module, according to SQL statement to test data into Row alignment processing, the test cases after being parsed, this process are also database API module by SQL scripts to test Data carry out alignment processing to be parsed, and resolving is realized by the automatic calling of api interface.
In one embodiment, as shown in figure 8, the automatic test device 100 further includes:
Log storage unit 103a, for initializing the corresponding initial assembling daily record of initialization test case, and parsing Corresponding parsing daily record is stored when case.
In the present embodiment, test case will be assembled to obtain initially to assemble day corresponding to initialization test case Will, and parsing daily record corresponding to test cases after being parsed to initialization test case are stored to daily record and are exported Module.Journal output module is needed to record automatic assembling process in entire complicated case assembling process, in order to The assembling process of test cases is recorded by journal output module.
Case Dispatching Unit 104, for the test cases after parsing to be distributed to corresponding load end.
In one embodiment, as shown in figure 9, the case Dispatching Unit 104 includes:
Thread pool enters unit 1041, and thread pool is added for the test cases after parsing;
Case transmission unit 1042, for obtaining the load end that test mode in multiple load ends is idle state, selection A sub-line journey in thread pool, one of load end is sent to by the test cases after parsing.
In the present embodiment, it is lined up when multiple parsing Acceptance Tests cases are sent to the queue in the block of concurrent processing mould When (queue can be understood as thread pool), the test cases after parsing is divided according to the middle setting distribution rules of concurrent processing module It is sent to corresponding load end.I.e. concurrent processing module receives the test cases after the parsing transmitted by database API module, will parse Thread pool is added in test cases afterwards;The test cases after being parsed in thread pool is obtained, and more by distributed processing modules acquisition Test mode is the load end of idle state in a load end, and is sent to one of load end.If acquired single solution Test cases after analysis exceeds preset case file size (such as 50K), the test cases after distributed processing modules are parsed At most a sub- test cases is split, and the size of each sub- test cases all keeps below preset case file size, later It is one of idle state load end that multiple sub- test cases, which are distributed to test mode, by distributed processing modules again.
As a result feedback unit 105, the test result for obtaining load end feedback, by the test result fill to Preset report template generates test report, and the test report is sent to preset associated end.
Wherein, the test result is to be successfully tested result or test crash result.
In the present embodiment, the test result in case management module is obtained by result report output module, to all It after the test result of test cases is counted and integrated, is exported in the form of test report, wherein at least includes test cases Sum is executed through number, percent of pass, the displaying of failure testing case, and the information such as failure cause displaying, test report is with mail he It sends out to preset contact number.
In one embodiment, as shown in Figure 10, further include in the result feedback unit 105:
Exception processing unit 105a, if for the test result be test crash as a result, positioning the survey after the parsing Try test abnormal failure position in case.
In the present embodiment, by Mission Monitor platform obtain load end test result, and by test result store to Case management module.At this point, carrying out automatic test to the test cases after parsing in load end, test result is obtained, and Case management module is fed back to be stored;If during automatic test, deposit corresponding to test cases after parsing Test result be status of fail (wherein can assert case implementing result by assert static methods), then call exception The method encapsulated in processing module positions the position for leading to test abnormal failure in the test cases after the parsing.
As it can be seen that the arrangement achieves the automatic assemblings of test data, and large batch of automatic test is carried out, improved certainly The efficiency of dynamicization test.
Above-mentioned automatic test device can be implemented as a kind of form of computer program, which can be such as It is run on computer equipment shown in Figure 11.
Please refer to Fig.1 the schematic block diagram that 1, Figure 11 is a kind of computer equipment provided by the embodiments of the present application.The calculating 500 equipment of machine equipment can be server.
Refering to fig. 11, which includes processor 502, memory and the net connected by system bus 501 Network interface 505, wherein memory may include non-volatile memory medium 503 and built-in storage 504.
The non-volatile memory medium 503 can storage program area 5031 and computer program 5032.The computer program 5032 include program instruction, which is performed, and processor 502 may make to execute a kind of automated testing method.
The processor 502 supports the operation of entire computer equipment 500 for providing calculating and control ability.
The built-in storage 504 provides environment for the operation of the computer program 5032 in non-volatile memory medium 503, should When computer program 5032 is executed by processor 502, processor 502 may make to execute a kind of automated testing method.
The network interface 505 such as sends the task dispatching of distribution for carrying out network communication.Those skilled in the art can manage It solves, structure is not constituted only with the block diagram of the relevant part-structure of application scheme to the application side shown in Figure 11 The restriction for the computer equipment 500 that case is applied thereon, specific computer equipment 500 may include more than as shown in the figure Or less component, it either combines certain components or is arranged with different components.
Wherein, the processor 502 is for running computer program 5032 stored in memory, to realize following work( Energy:Build test frame;The test data uploaded is obtained, the test data is assembled to obtain in the test frame Initialization test case;Initialization case is parsed, the test cases after being parsed;By the test cases after parsing point It is sent to corresponding load end;The test result for obtaining the load end feedback, the test result is filled to preset report mould Plate generates test report, and the test report is sent to preset associated end.
In one embodiment, processor 502 also executes following operation:Test data is obtained, is corresponded to and is given birth to according to test data At each field;According to preset testing process, in test data corresponds to each field generated extracting required field is assembled into Initialization test case.
In one embodiment, processor 502 also executes following operation:By initialization test case corresponding initial assembling day Will, and parsing daily record corresponding when parsing initialization case are stored.
In one embodiment, processor 502 also executes following operation:Thread pool is added in test cases after parsing;It obtains It is the load end of idle state to take test mode in multiple load ends, a sub-line journey in thread pool is selected, after parsing Test cases is sent to one of load end.
In one embodiment, processor 502 also executes following operation:The test result is to be successfully tested result or test Failure result;If the test result is test crash tests abnormal failure as a result, positioning in the test cases after the parsing Position.
It will be understood by those skilled in the art that the embodiment of computer equipment shown in Figure 11 is not constituted to computer The restriction of equipment specific composition, in other embodiments, computer equipment may include components more more or fewer than diagram, or Person combines certain components or different components arrangement.For example, in some embodiments, computer equipment can only include depositing Reservoir and processor, in such embodiments, the structure and function of memory and processor are consistent with embodiment illustrated in fig. 11, Details are not described herein.
It should be appreciated that in the embodiment of the present application, processor 502 can be central processing unit (Central Processing Unit, 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..
A kind of storage medium is provided in another embodiment of the application.The storage medium can be computer-readable storage Medium.The storage medium is stored with computer program, and wherein computer program includes program instruction.The program instruction is by processor It is realized when execution:Build test frame;The test data uploaded is obtained, the test data is carried out in the test frame Assembling obtains initialization test case;Initialization case is parsed, the test cases after being parsed;By the survey after parsing Examination case is distributed to corresponding load end;The test result for obtaining the load end feedback, the test result is filled to default Report template generate test report, the test report is sent to preset associated end.
In one embodiment, it is realized when which is executed by processor:Test data is obtained, according to test data pair Each field should be generated;According to preset testing process, required field groups are extracted in test data corresponds to each field generated Dress up initialization test case.
In one embodiment, it is realized when which is executed by processor:Initialization test case is corresponding initial Assembling daily record, and parsing daily record corresponding when parsing initialization case are stored.
In one embodiment, it is realized when which is executed by processor:Thread is added in test cases after parsing Pond;The load end that test mode in multiple load ends is idle state is obtained, a sub-line journey in thread pool is selected, will parse Test cases afterwards is sent to one of load end.
In one embodiment, it is realized when which is executed by processor:The test result is to be successfully tested result Or test crash result;If the test result is test crash as a result, position tested in the test cases after the parsing it is different Normal abort situation.
The storage medium can be the internal storage unit of aforementioned device, such as the hard disk or memory of equipment.It is described to deposit Storage media can also be the plug-in type hard disk being equipped on the External memory equipment of the equipment, such as the equipment, intelligent storage Block (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc.. Further, the storage medium can also both include the equipment internal storage unit and also including External memory equipment.
It is apparent to those skilled in the art that for convenience of description and succinctly, foregoing description is set The specific work process of standby, device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein. Those of ordinary skill in the art may realize that units and algorithm described in conjunction with the examples disclosed in the embodiments of the present disclosure Step can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and software Interchangeability generally describes each exemplary composition and step according to function in the above description.These functions are studied carefully Unexpectedly the specific application and design constraint depending on technical solution are implemented in hardware or software.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed The scope of the present invention.
In several embodiments provided herein, it should be understood that disclosed unit and method, it can be with It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit It divides, only a kind of division of logic function, formula that in actual implementation, there may be another division manner can also will have identical work( The unit set of energy can be combined or can be integrated into another system at a unit, such as multiple units or component, or Some features can be ignored or not executed.In addition, shown or discussed mutual coupling or direct-coupling or communication link It can be INDIRECT COUPLING or communication connection by some interfaces, device or unit to connect, and can also be electricity, mechanical or other Form connection.
The unit illustrated as separating component may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, you can be located at a place, or may be distributed over multiple In network element.Some or all of unit therein can be selected according to the actual needs to realize the embodiment of the present invention Purpose.
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 sells or use as independent product When, it can be stored in a storage medium.Based on this understanding, technical scheme of the present invention is substantially in other words to existing The all or part of part or the technical solution that technology contributes can be expressed in the form of software products, should Computer software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be Personal computer, server or network equipment etc.) execute all or part of step of each embodiment the method for the present invention Suddenly.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), magnetic disc or The various media that can store program code such as person's CD.
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 automated testing method, which is characterized in that including:
Build test frame;
The test data uploaded is obtained, test data is assembled in test frame to obtain initialization test case;
Initialization case is parsed, the test cases after being parsed;
Test cases after parsing is distributed to corresponding load end;
Test result is filled to preset report template and generates test report, will surveyed by the test result for obtaining load end feedback Examination report is sent to preset associated end.
2. automated testing method according to claim 1, which is characterized in that it is described in test frame to test data It is assembled to obtain initialization test case, including:
Test data is obtained, is corresponded to according to test data and generates each field;
According to preset testing process, in test data corresponds to each field generated extracting required field is assembled into initialization Test cases.
3. automated testing method according to claim 1, which is characterized in that described pair of initialization case parses, After test cases after being parsed, further include:
The corresponding initial assembling daily record of initialization test case, and parsing daily record corresponding when parsing initialization case are carried out Storage.
4. automated testing method according to claim 1, which is characterized in that the test cases by after parsing is distributed To corresponding load end, including:
Thread pool is added in test cases after parsing;
The load end that test mode in multiple load ends is idle state is obtained, a sub-line journey in thread pool is selected, will solve Test cases after analysis is sent to one of load end.
5. automated testing method according to claim 1, which is characterized in that the test result is to be successfully tested result Or test crash result;
After the test result for obtaining load end feedback, further include:
If the test result is test crash tests abnormal failure position as a result, positioning in the test cases after the parsing.
6. a kind of automatic test device, which is characterized in that including:
Frame builds unit, for building test frame;
Case module units carries out group in the test frame for obtaining the test data uploaded to the test data Dress obtains initialization test case;
Example analysis unit, for being parsed to initialization case, the test cases after being parsed;
Case Dispatching Unit, for the test cases after parsing to be distributed to corresponding load end;
As a result feedback unit, the test result for obtaining the load end feedback, the test result is filled to preset Report template generates test report, and the test report is sent to preset associated end.
7. automatic test device according to claim 6, which is characterized in that the case module units, including:
Test data acquiring unit corresponds to according to test data for obtaining test data and generates each field;
Data assembling unit, needed for according to preset testing process, being extracted in test data corresponds to each field generated Field be assembled into initialization test case.
8. automatic test device according to claim 6, which is characterized in that the case Dispatching Unit, including:
Thread pool enters unit, and for receiving the test cases after parsing, thread pool is added in the test cases after parsing;
Case transmission unit for obtaining the test cases after being parsed in thread pool, and obtains test mode in multiple load ends For the load end of idle state, the test cases after parsing is sent to one of load end.
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 the computer program as in claim 1-5 Any one of them automated testing method.
10. a kind of storage medium, which is characterized in that the storage medium is stored with computer program, the computer program packet Program instruction is included, described program instruction makes the processor execute such as any one of claim 1-5 institutes when being executed by a processor The automated testing method stated.
CN201810540124.7A 2018-05-30 2018-05-30 Automated testing method, device, computer equipment and storage medium Pending CN108763083A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810540124.7A CN108763083A (en) 2018-05-30 2018-05-30 Automated testing method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810540124.7A CN108763083A (en) 2018-05-30 2018-05-30 Automated testing method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN108763083A true CN108763083A (en) 2018-11-06

Family

ID=64004327

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810540124.7A Pending CN108763083A (en) 2018-05-30 2018-05-30 Automated testing method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108763083A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109656822A (en) * 2018-12-12 2019-04-19 郑州云海信息技术有限公司 A kind of guard method of automatic test and device
CN109697150A (en) * 2018-12-14 2019-04-30 平安普惠企业管理有限公司 Show method, apparatus, computer equipment and the storage medium of test report
CN109739583A (en) * 2018-12-13 2019-05-10 平安科技(深圳)有限公司 Method, apparatus, computer equipment and the storage medium of multi-threaded parallel operation
CN109800156A (en) * 2018-12-20 2019-05-24 交控科技股份有限公司 A kind of subway signal system automation test method based on profile command
CN109861874A (en) * 2018-12-25 2019-06-07 北京奇安信科技有限公司 Equipment automatization test macro
CN111177007A (en) * 2019-12-31 2020-05-19 中国银行股份有限公司 Method and system for automatically generating BDD test case based on test data
CN111240958A (en) * 2019-12-04 2020-06-05 五八同城信息技术有限公司 Interface testing method and device, electronic equipment and medium
CN113204389A (en) * 2021-05-28 2021-08-03 的卢技术有限公司 Method, system, equipment and storage medium for generating automatic execution strategy
CN114157566A (en) * 2021-11-08 2022-03-08 中信科移动通信技术股份有限公司 Base station performance file analysis method and system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473325A (en) * 2013-09-13 2013-12-25 中国工商银行股份有限公司 System and method for generating test case data
CN103853652A (en) * 2012-11-29 2014-06-11 百度在线网络技术(北京)有限公司 Test case generation method and device
CN104536888A (en) * 2014-12-24 2015-04-22 网易(杭州)网络有限公司 Game testing method and system for mobile devices
CN104572444A (en) * 2014-12-10 2015-04-29 网易(杭州)网络有限公司 Cloud testing platform for game performance and testing method for cloud testing platform
US20150347279A1 (en) * 2014-06-03 2015-12-03 GM Global Technology Operations LLC Methodology and tool support for test organization and migration for embedded software
CN105468490A (en) * 2015-12-11 2016-04-06 珠海金山网络游戏科技有限公司 Server performance automatic test method and system and device
US20170060968A1 (en) * 2015-09-02 2017-03-02 International Business Machines Corporation Compiling extract, transform, and load job test data cases

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103853652A (en) * 2012-11-29 2014-06-11 百度在线网络技术(北京)有限公司 Test case generation method and device
CN103473325A (en) * 2013-09-13 2013-12-25 中国工商银行股份有限公司 System and method for generating test case data
US20150347279A1 (en) * 2014-06-03 2015-12-03 GM Global Technology Operations LLC Methodology and tool support for test organization and migration for embedded software
CN104572444A (en) * 2014-12-10 2015-04-29 网易(杭州)网络有限公司 Cloud testing platform for game performance and testing method for cloud testing platform
CN104536888A (en) * 2014-12-24 2015-04-22 网易(杭州)网络有限公司 Game testing method and system for mobile devices
US20170060968A1 (en) * 2015-09-02 2017-03-02 International Business Machines Corporation Compiling extract, transform, and load job test data cases
CN105468490A (en) * 2015-12-11 2016-04-06 珠海金山网络游戏科技有限公司 Server performance automatic test method and system and device

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109656822A (en) * 2018-12-12 2019-04-19 郑州云海信息技术有限公司 A kind of guard method of automatic test and device
CN109739583A (en) * 2018-12-13 2019-05-10 平安科技(深圳)有限公司 Method, apparatus, computer equipment and the storage medium of multi-threaded parallel operation
CN109739583B (en) * 2018-12-13 2023-09-08 平安科技(深圳)有限公司 Method, device, computer equipment and storage medium for parallel running of multiple threads
CN109697150A (en) * 2018-12-14 2019-04-30 平安普惠企业管理有限公司 Show method, apparatus, computer equipment and the storage medium of test report
CN109800156B (en) * 2018-12-20 2022-05-06 交控科技股份有限公司 Subway signal system automatic test method based on configuration file command
CN109800156A (en) * 2018-12-20 2019-05-24 交控科技股份有限公司 A kind of subway signal system automation test method based on profile command
CN109861874A (en) * 2018-12-25 2019-06-07 北京奇安信科技有限公司 Equipment automatization test macro
CN109861874B (en) * 2018-12-25 2021-05-25 北京奇安信科技有限公司 Automatic test system of equipment
CN111240958A (en) * 2019-12-04 2020-06-05 五八同城信息技术有限公司 Interface testing method and device, electronic equipment and medium
CN111177007A (en) * 2019-12-31 2020-05-19 中国银行股份有限公司 Method and system for automatically generating BDD test case based on test data
CN111177007B (en) * 2019-12-31 2023-09-22 中国银行股份有限公司 Method and system for automatically generating BDD test cases based on test data
CN113204389A (en) * 2021-05-28 2021-08-03 的卢技术有限公司 Method, system, equipment and storage medium for generating automatic execution strategy
CN113204389B (en) * 2021-05-28 2023-09-22 的卢技术有限公司 Method, system, equipment and storage medium for generating automatic execution strategy
CN114157566A (en) * 2021-11-08 2022-03-08 中信科移动通信技术股份有限公司 Base station performance file analysis method and system
CN114157566B (en) * 2021-11-08 2023-09-08 中信科移动通信技术股份有限公司 Base station performance file analysis method and system

Similar Documents

Publication Publication Date Title
CN108763083A (en) Automated testing method, device, computer equipment and storage medium
CN108415832B (en) Interface automation test method, device, equipment and storage medium
CN108519952B (en) A kind of distributed WEB automatization test system and method
CN111625452A (en) Flow playback method and system
CN107766132A (en) Multi-task scheduling method, application server and computer-readable recording medium
CN110543328A (en) Cross-platform component management method, system, terminal and storage medium based on Ambari
CN105677465B (en) The data processing method and device of batch processing are run applied to bank
CN107689982A (en) Multi-data source method of data synchronization, application server and computer-readable recording medium
CN108804320A (en) Automated testing method, device, computer equipment and storage medium
CN106557470A (en) data extraction method and device
CN109408390A (en) A kind of BMC login user stability test method, apparatus, terminal and storage medium
CN109150610A (en) The network event acquisition method of rule-based adaptation
CN107908488A (en) Message request interactive interfacing method, apparatus, computer equipment and storage medium
CN109447787A (en) Reference report automatically parses method, apparatus, computer equipment and storage medium
CN108664396A (en) Bank&#39;s interactive interface verification method, device, computer equipment and storage medium
CN105490864A (en) Business module monitoring method based on OSGI
CN106789324A (en) FTP distributed acquisition methods based on MapReduce
CN108241529A (en) Wages computational methods, application server and computer readable storage medium
CN109634951A (en) Big data acquisition method, device, computer equipment and storage medium
CN109376083A (en) Test processing method and device
CN108874738A (en) Distributed parallel operation method, device, computer equipment and storage medium
CN107273250A (en) The method of testing and device of electronic declaration form automatic cover system
CN109858257B (en) Access control method and device
EP2709007A1 (en) Service process integration systems and methods
CN105550103B (en) A kind of automated testing method based on self-defined test script

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