CN109783365A - 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
CN109783365A
CN109783365A CN201811537619.0A CN201811537619A CN109783365A CN 109783365 A CN109783365 A CN 109783365A CN 201811537619 A CN201811537619 A CN 201811537619A CN 109783365 A CN109783365 A CN 109783365A
Authority
CN
China
Prior art keywords
test
action
video
object run
run control
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
CN201811537619.0A
Other languages
Chinese (zh)
Inventor
徐国诚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Smart Technology Co Ltd
Original Assignee
OneConnect Smart Technology 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 OneConnect Smart Technology Co Ltd filed Critical OneConnect Smart Technology Co Ltd
Priority to CN201811537619.0A priority Critical patent/CN109783365A/en
Publication of CN109783365A publication Critical patent/CN109783365A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The present invention relates to automated test tool field, disclosing a kind of automated testing method, device, computer equipment and storage medium, method includes: to obtain test exemplary video;The test exemplary video is parsed, obtains the corresponding object run control of each step test operation and test action, and form test operation script;When executing the test operation script, if the operation pages for executing terminal include the object run control, the test action for being directed to the object run control is executed in the execution terminal.Automated testing method proposed by the present invention, by being identified to the test operation in test exemplary video, analysis component structure and adaptation screen resolution are not needed again, automatically generate test script, it is automatic to execute test script, Auto-matching multiresolution greatly improves the suitability of automatic test.

Description

Automated testing method, device, computer equipment and storage medium
Technical field
The present invention relates to automated test tool fields more particularly to a kind of automated testing method, device, computer to set Standby and storage medium.
Background technique
Automatic test is a kind of process for the behavioral test taking human as driving being converted into machine execution.It is existing automatic Change test and usually obtain automatic test script by the way of recording script, is then surveyed using automatic test script Examination.However this mode has biggish limitation, since the execution terminal control structure and screen resolution of different model exist Difference, leads to automatic test script bad adaptability obtained, and automatic test script can not execute end in different model It is used on end.
Summary of the invention
Based on this, it is necessary in view of the above technical problems, provide a kind of automated testing method, device, computer equipment And storage medium, to improve the suitability of automatic test.
A kind of automated testing method, comprising:
Test exemplary video is obtained, the test exemplary video is for demonstrating test operation;
The test exemplary video is parsed, the corresponding object run control of each step test operation and test action are obtained, And test operation script is formed, the test operation script includes object run control and the test action of each test operation;
When executing the test operation script, whether the corresponding object run control of currently performed test action is checked It is not empty set, if the corresponding object run control of currently performed test action is not empty set, judges the operation for executing terminal It whether include the object run control in the page;
If the operation pages for executing terminal include the object run control, it is directed in execution terminal execution The test action of the object run control.
A kind of automatic test device, comprising:
Video module is obtained, for obtaining test exemplary video, the test exemplary video is for demonstrating test operation;
Video module is parsed, for parsing the test exemplary video, obtains the corresponding target behaviour of each step test operation Make control and test action, and form test operation script, the test operation script includes the target behaviour of each test operation Make control and test action;
Control module is checked, for when executing the test operation script, checking that currently performed test action is corresponding Object run control whether be not empty set, if the corresponding object run control of currently performed test action is not empty set, Whether judge to execute in the operation pages of terminal comprising the object run control;
Action module is executed, if including the object run control for the operation pages for executing terminal, in institute It states and executes the test action that terminal execution is directed to the object run control.
A kind of computer equipment, including memory, processor and storage are in the memory and can be in the processing The computer program run on device, the processor realize the step of above-mentioned automated testing method when executing the computer program Suddenly.
A kind of computer readable storage medium, the computer-readable recording medium storage have computer program, the meter The step of calculation machine program realizes above-mentioned automated testing method when being executed by processor.
Above-mentioned automated testing method, device, computer equipment and storage medium, method include: to be tested by obtaining Exemplary video, the test exemplary video is for demonstrating test operation;The test exemplary video is parsed, each pacing examination is obtained Corresponding object run control and test action are operated, and forms test operation script, the test operation script includes each The object run control of test operation and test action;When executing the test operation script, currently performed test is checked Act whether corresponding object run control is not empty set, if the corresponding object run control of currently performed test action is not Whether empty set then judges to execute in the operation pages of terminal comprising the object run control;If the operation for executing terminal The page includes the object run control, then dynamic for the test of the object run control in the execution terminal execution Make.Automated testing method proposed by the present invention is not needed again by identifying to the test operation in test exemplary video Analysis component structure and adaptation screen resolution, automatically generate test script, execute test script automatically, and Auto-matching is differentiated more Rate greatly improves the suitability of automatic test.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below by institute in the description to the embodiment of the present invention Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the invention Example, for those of ordinary skill in the art, without any creative labor, can also be according to these attached drawings Obtain other attached drawings.
Fig. 1 is an application environment schematic diagram of automated testing method in one embodiment of the invention;
Fig. 2 is a flow diagram of automated testing method in one embodiment of the invention;
Fig. 3 is a flow diagram of automated testing method in one embodiment of the invention;
Fig. 4 is a flow diagram of automated testing method in one embodiment of the invention;
Fig. 5 is a flow diagram of automated testing method in one embodiment of the invention;
Fig. 6 is a flow diagram of automated testing method in one embodiment of the invention;
Fig. 7 is a structural schematic diagram of automatic test device in one embodiment of the invention;
Fig. 8 is a structural schematic diagram of automatic test device in one embodiment of the invention;
Fig. 9 is a structural schematic diagram of automatic test device in one embodiment of the invention;
Figure 10 is a schematic diagram of computer equipment in one embodiment of the invention.
Specific embodiment
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 description, 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.
Automated testing method provided in this embodiment can be applicable in the application environment such as Fig. 1, wherein execute terminal It is communicated by network with server-side.Wherein, execute terminal include but is not limited to various personal computers, laptop, Smart phone, tablet computer and portable wearable device.Server-side can use independent server either multiple servers The server cluster of composition is realized.
In one embodiment, as shown in Fig. 2, providing a kind of automated testing method, the clothes in Fig. 1 are applied in this way Business is illustrated for end, is included the following steps:
S10, test exemplary video is obtained, the test exemplary video is for demonstrating test operation.
Specifically, test exemplary video refers to the video comprising multiple test operations that tester records.Test is shown The test content of model video includes but is not limited to webpage ballot, sending bulk message, register account number, places an order in batches.For example, being surveyed one Try in exemplary video, the test operation being related to includes: to click XX application icon --- the ballot page is clicked in XX application page Link --- clicks confirming button in ballot page selection polling option --- scroll through pages to bottom ---.
Server-side can directly receive the test exemplary video of tester's transmission, also can receive and forward acquisition by other people Test exemplary video.
S20, the parsing test exemplary video, obtain the corresponding object run control of each step test operation and test is dynamic Make, and form test operation script, the test operation script includes that the object run control of each test operation and test are moved Make.
Specifically, object run control refers to the object of test operation, XX application icon, throwing in an embodiment as above Ticket page link, polling option, ACK button.Test operation script is used to execute the code of test operation, is shown based on test The test operation that includes in model video and generate.
Server-side is provided with recognizer, for parsing test exemplary video, determines and the test in test exemplary video Operation corresponding object run control and test operation script.For example, have an operation pages in a test exemplary video, Comprising A icon, B icon and C icon, when the icon of click is A icon, A icon can generate hatching effect, and recognizer can With the variation generated according to A icon in video, and then determine that object run control is A icon, rather than B icon or C icon, and Determine that involved test operation is to click according to the difference of former and later two image frames.Likewise, if the icon clicked is B icon When, B icon can generate hatching effect, and recognizer can determine object run control according to the variation that B icon in video generates It is B icon.
S30, when executing the test operation script, check the corresponding object run control of currently performed test action Whether it is not empty set, if the corresponding object run control of currently performed test action is not empty set, judges to execute terminal It whether include the object run control in operation pages.
In the present embodiment, executes terminal and refer to the terminal for executing test operation.Test operation script includes multiple Test action.Each test action is associated with object run control, need to be with pair that is clicked if test action is clicking operation As associated.Here, the object being clicked is object run control associated with test action.Part and test action Associated object run control is empty set.For example, if currently performed test action be " page turning " when, the test with " page turning " Acting associated object run control is empty set.
If currently performed test action can be compared there are the object run control of associated nonvoid set by figure Mode judge operation pages with the presence or absence of object run control.Operation pages can refer to the multiple pages executed in terminal.Example Such as, execute in terminal using more, cause application distribution on multiple pages, then the object run control that test operation is related to It may not be on first page.It can perform the following operation: whether judge to execute on first page of terminal comprising target Operational controls;Do not include object run control on first page of terminal if executing, judges second page for executing terminal It whether include object run control on face;... and so on, until finding the object run control for needing to be implemented operation.If holding All operation pages of row terminal are free of object run control, then return to error message.
If S40, the operation pages for executing terminal include the object run control, executed in the execution terminal For the test action of the object run control.
In the present embodiment, if finding object run control, phase is carried out according to the test operation script that step S20 is generated The test operation answered.For example, test operation performed by test operation script are as follows: click A icon --- choose " Quick-return " Input frame --- inputting " checking card " in input frame --- clicks " submission " button;A icon is then searched on executing terminal, is being looked for To after A icon, terminal is executed by the following test operation of test operation script execution: clicking A icon --- it chooses and " quickly returns It is multiple " input frame --- inputting " checking card " in input frame --- click " submission " button.
In step S10-S40, test exemplary video is obtained, the test exemplary video is for demonstrating test operation, to obtain Must be used to demonstrate the exemplary video of test operation, and exemplary video is easy to record, and be easy transmission.The test exemplary video is parsed, The corresponding object run control of each step test operation and test action are obtained, and forms test operation script, the test behaviour It include object run control and the test action of each test operation as script, to obtain test operation script, the test operation Script can be run in different types of execution terminal, greatly improve the suitability of automatic test.Executing the survey When examination operation script, check whether the corresponding object run control of currently performed test action is not empty set, if current execute The corresponding object run control of test action be not empty set, then whether judge to execute in the operation pages of terminal comprising the mesh Operational controls are marked, by checking the operation pages for executing terminal to judge to execute terminal with the presence or absence of object run control, in turn It determines whether to execute test operation script.If the operation pages for executing terminal include the object run control, in institute It states and executes the test action that terminal execution is directed to the object run control, to complete corresponding test action, realization is certainly Dynamicization test.
Optionally, as shown in figure 3, step S20 includes:
S201, it is spaced at preset timed intervals the test exemplary video is divided into multiple video clips.
Specifically, prefixed time interval can be a fixed value, it is also possible to a unfixed value.Fixed value It can be set to 0.5 second, 1 second, 2 seconds, 3 seconds etc..Unfixed value can be determined according to the variation of the image frame in video.Example Such as, such as in one section of test exemplary video, the content of 1-100 frame picture is unchanged, and the 101st frame picture changes, and the 150th Frame picture changes, and the 180th frame changes again, and the 200th frame changes again, and the 230th frame changes again, the 300 frame videos terminate, and prefixed time interval can divide the test exemplary video are as follows: 1-125 frame, 126-165 frame, 166- 190 frames, 191-215 frame, 216-300 frame, a total of five video clip.
S202, the video clip is inputted into deliberate action judgment models, it is dynamic obtains the corresponding test of the video clip Make.
Specifically, deliberate action judgment models can be the judgment models constructed using neural network algorithm, it can be determined that The corresponding test action of video clip.Test action include but is not limited to click, choose, inputting, page turning, double-click, long-pressing, the right side Key scrolls up, scrolls down through, stirring to the left, stirring to the right.Here, neural network algorithm can use according to actual needs ANN algorithm (Artificial Neural Network, artificial neural network), CNN algorithm (Convolutional Neural Network, convolutional neural networks) or BP algorithm (Backpropagation Algorithm, back-propagation algorithm).
By taking BP algorithm as an example.Deliberate action judgment models can construct in the following manner: the sample set of one input of building {(x(1),y(1)),…,(x(m),y(m)), which includes m sample.Wherein, x can be the video as corresponding to sample The characteristic set of extraction, y are then the label value of the sample.Then for single sample (x, y), cost function can by with Lower formula is found out:
In above formula, J is the functional value of cost function, and W, b are the parameter of model, and y is true tag value, and h is predicted value.
The whole cost function of sample set can be solved accordingly.It is calculated through successive ignition, obtains final deliberate action and sentence Disconnected model.
During training, another part sample can be chosen as training sample by selected part sample from sample set This is as test sample.It can permit part sample and be not only used as training sample, but also be used as test sample.Training sample input is dynamic Make in judgment models, repeatedly trained, obtains trained movement judgment models.Then test sample input action is judged into mould In type, corresponding judging result is obtained, and calculates the accuracy rate of judging result.When the accuracy rate of judging result is met the requirements, then The movement judgment models that current training obtains can be determined as deliberate action judgment models.If the accuracy rate of judging result does not meet It is required that the then parameter of reset action judgment models, and continue to be trained movement judgment models, until the movement judges The accuracy rate of model treatment test sample meets preset requirement.
It is worth noting that, the corresponding movement label of sample includes " no operation ".If the video clip of input is static page Face, then the test action of deliberate action judgment models output is " no operation ".If the video clip of input is grasped comprising multiple tests Make, then deliberate action judgment models correspondingly export multiple test actions of video clip.
In some operation pages, it is understood that there may be certain cardon or video, these cardons or video council generate dynamic aobvious Show effect, interference is generated to action recognition.When can construct deliberate action judgment models, training of the input comprising cardon or video Sample correctly identifies the survey of video clip so that deliberate action judgment models can effectively exclude the interference of cardon or video Examination movement.
S203, the test action is chronologically arranged, and through default processing rule process, generates the sequence of operation, it is described Test operation script includes the sequence of operation.
Specifically, default processing rule is for removing " the no operation " and repetitive operation for including in test action.For example, one Test exemplary video it is segmented at 15 video clips after, the test action of generation is operation 1-15, wherein operation 1-3,6,7, 15 be " no operation ", and operation 8-12 is " input " operation, then after default processing rule process, the sequence of operation of generation are as follows: Operation 4, operation 5, input operation (replacement operation 8-12), operation 13, operation 14.Here, a video clip is one corresponding Operation, such as first video clip respective operations 1, second video clip respective operations 2.
The test operation script for being adapted for carrying out terminal execution can be generated according to the sequence of operation, for example, if executing terminal System is Android system (a kind of mobile phone operating system), then generates and be suitable for the test operation script that Android system executes;If executing The system of terminal is iOS system (Mobile operating system of Apple Inc.'s exploitation), then generates and be suitable for the test behaviour that iOS system executes Make script;If the system for executing terminal is Windows system (computer operating systems of Microsoft's research and development), generation is suitable for The test operation script that Windows system executes;If the system for executing terminal is that (a kind of free, support is multi-purpose for linux system Family, multitask, the operating system for supporting multithreading and multi -CPU), then it generates and is suitable for the test operation script that linux system executes.
Test operation script include each of sequence of operation operation, object run control corresponding with part operation or Person's input content.For example, a sequence of operation includes: to click, choose, inputting, clicking;Performed by the test operation script of generation Test operation, which may is that, which clicks A icon, --- chooses " Quick-return " input frame --- input " checking card " in input frame --- Click " submission " button.
In step S201-S203, it is spaced at preset timed intervals and the test exemplary video is divided into multiple video clips, with Video clip is handled convenient for deliberate action judgment models.The video clip is inputted into deliberate action judgment models, is obtained The corresponding test action of the video clip is obtained, by the processing one by one to video clip, obtains and is wrapped in test exemplary video The each test action contained.The test action is chronologically arranged, and through default processing rule process, generates the sequence of operation, The test operation script includes the sequence of operation, and the sequence of operation of generation is the important component part of test operation script.
In one embodiment, the test action includes no operation, as shown in figure 4, step S203 includes:
Whether S2031, the test action for judging two adjacent video clips are no operation.
If the test action of S2032, two adjacent video clips are no operation, by two adjacent views Frequency segment merges into fusion video clip.
Specifically, the picture after preoperative picture and operation may be segmented in two video clips by prefixed time interval In, cause the test operation tested in exemplary video that can not be identified.Such as, the content of 1-100 frame picture is the A page, the 101-200 frame picture is the B page, if 1-100 frame picture is divided into a video clip by prefixed time interval, 101- 200 frame pictures are divided into another video clip, this will lead to is not identified from A page jump to the test action of the B page. 1-200 frame can be merged into fusion video clip at this time, to identify first test operation.
S2033, the fusion video clip is inputted into deliberate action judgment models, obtains the survey of the fusion video clip Examination movement, and the test action of two adjacent video clips is replaced with into the test action for merging video clip.
Specifically, fusion video clip is inputted deliberate action judgment models, the test action of fusion video clip is obtained. If the test action for merging video clip is operation P, the test action of two adjacent video clips is operation M and operation N, behaviour Making M and operation N is " no operation ", then the test action chronologically arranged is then from original: ... operation M (no operation), behaviour Make N (no operation) ..., convert are as follows: ... operation P (replacement operation M and operation N) ....
If the test action for merging video clip is no operation, and there are nothings for the test action of video clip adjacent thereto Operation, then can continuously form new fusion video clip, until the test action of two adjacent video clips is not present For " no operation ".
If the test action of S2034, two adjacent video clips is there is no being no operation, by all tests Deleting in movement without operation, chronologically arranges remaining test action, generates the sequence of operation.
Specifically, it is no operation that the test action of two adjacent video clips, which is not present, in one example, chronologically The test action of arrangement can indicate are as follows: operate 1, operate t without operation, operation 3, without operation, operation 5 ....Delete " no behaviour The sequence of operation after work " indicates are as follows: operation 1, operation 3, operation 5 ... operate t.If the number of the test action chronologically arranged For m, " no operation " number is n, then the number of the test action in the sequence of operation that treated is m-n.
In S2031-S2034, judge whether the test action of two adjacent video clips is no operation, with reduce because Test action is failed to judge caused by segmentation test exemplary video.If the test action of two adjacent video clips is nothing Two adjacent video clips are merged into fusion video clip by operation, reduce test in a manner of by merging video Movement is failed to judge.The fusion video clip is inputted into deliberate action judgment models, the test for obtaining the fusion video clip is dynamic Make, and the test action of two adjacent video clips is replaced with to the test action of the fusion video clip, with more Test action in the positive sequence of operation.If it is no operation that the test action of two adjacent video clips, which is not present, By being deleted without operation in all test actions, remaining test action is chronologically arranged, the sequence of operation is generated, the operation The corresponding test a series of test operation of exemplary video of sequence, effectively from test exemplary video from extracting required test Operation.
Optionally, as shown in figure 5, after step S202, comprising:
S204, the type for detecting test action need to identify object run control institute according to the determination of the type of test action Corresponding video clip.
It can determine whether video clip needs to identify object run control according to the type of test action.Test action packet Containing two types, a kind of related object run control of test action, another test action does not have associated objects operation control Part.There is no the test action of associated objects operational controls to can be page turning, scroll up, scroll down through, stirring to the left, turning over to the right It moves or without operation, such movement is not related to object run control, because without identifying object run control.Associated objects behaviour The test action for making control can be click, choose, inputs, double-clicking, long-pressing, right button, and such movement is related to object run control Part is controlled, thus needs to identify object run control.Object run control includes but is not limited to icon, page link, throwing Vote for item, operation button.Wherein, icon can be the mark into some program.Page link is then to enter next operation The access address of the page.Polling option can convert text lattice for the polling option tested in exemplary video by Text region Formula.Operation button can be some common buttons used when filling in list, such as " determination ", " return ", " lower one page ".
S205, by default extracting rule from it is described need to identify in video clip corresponding to object run control extract to Few two identification frames.
It may include the test action of one or more than one in video clip.It is associated with test action in order to identify Object run control, need to extract relevant identification frame.Default extracting rule is for extracting object run control for identification Image frame, such as can be the first frame and last frame of video clip, the key frame being also possible in video clip.It is real one It only include a test action in video clip, and test action is to click in example, then the identification frame extracted is respectively before clicking Image frame and click after image frame.If the number that video clip includes test action is X, of identification frame can be extracted Number is greater than or equal to X+1.
S206, the identification frame is inputted into predetermined registration operation control identification model, obtains the corresponding target of the video clip Operational controls, and the corresponding test action of video clip object run control corresponding to the video clip is related Connection.
Predetermined registration operation control identification model is identified by figure, to judge to identify the object run control for including in frame.Example Such as, a clicking operation, the icon after click can determine target according to this variation compared to hatching effect is generated before clicking Operational controls.And the icon being not clicked on does not generate this effect.
Predetermined registration operation control identification model can also judge to identify the object run control in frame by simulated operation.Such as Fruit dot hits and does not generate hatching effect, then the object run control to determine the operation can be clicked by test.For example, Include 3 icons, respectively icon 1, icon 2, icon 3 in one identification frame, icon 1 is clicked by simulated operation and jumps to page Face A clicks icon 2 and jumps to page B, clicks icon 3 and jumps to page C, and second identification frame includes page B, clicks icon 2 The page B jumped to is identical as second identification frame, and then determines that object run control is icon 2.
It is after obtaining object run control, object run control is associated with the test action of current video segment.
In step S204-S206, the type of test action is detected, needs to identify target according to the determination of the type of test action Video clip corresponding to operational controls is reduced at data with determining that selection needs to identify the video clip of object run control Reason amount.Need to identify extraction at least two in video clip corresponding to object run control from described by default extracting rule Frame is identified, by identifying that the comparison of frame determines object run control.The identification frame is inputted into predetermined registration operation control identification model, Obtain the corresponding object run control of the video clip, and by the corresponding test action of the video clip and the piece of video The corresponding object run control of section is associated, to obtain object run control required for test operation script.
Optionally, as shown in fig. 6, step S40 includes:
S401, the operation in the test operation script is sequentially executed at preset timed intervals in the execution terminal.
In the present embodiment, preset time sequence can be the time sequencing of test operation in test exemplary video, can also be with A random time is generated according to each test operation.For example, 1-3 seconds interval times can be set in clicking operation, it is defeated Entering operation can be set 5-20 seconds interval times.In one example, operation 1, time interval 1, operation 2, time be may be expressed as: Interval 2, operation 3, time interval 3 ....In some cases, preset time sequence can also automatically adjust according to the actual situation. For example, test operation script can first obtain the facility information for executing terminal, performance level corresponding to the facility information is judged, Then preset time sequence is adjusted further according to performance level.For example, one executes terminal as flagship machine, performance level is very high, The time interval in preset time sequence used at this time can choose a smaller value, to improve testing efficiency, reduce test Time.And executing terminal is low side machine, performance level is lower, and the time interval in preset time sequence used at this time can be with A larger value is chosen, to adapt to the processing speed of the execution terminal.
S402, after completing an operation in the test operation script, judge whether to complete in specified time next Operation.
If S403, no next operation of completion in specified time, return to error message.
A specified time can be set to judge whether test operation is successfully performed.In a test process, point A position of the page is hit, if next page needs to obtain data from network, needs certain load time.Load time It is likely larger than the execution time of next operation in test operation script, at this time, it may be necessary under executing after waiting page loaded The test operation of one step.If the page can not load for a long time, the time to be loaded such as lead to greatly at fixed time, then it can be to clothes Business end returns to error message, and server-side is made to know that the test operation malfunctions.Specified time can be set according to actual needs, It can be 30 seconds, 1 minute, 2 minutes or other times.
In step S401-S403, sequentially executed in the test operation script at preset timed intervals in the execution terminal Test action executes test operation script by different timing, operates more flexible.When one in the completion test operation script After test action, judge next test action whether is completed in specified time, to check whether test action is performed.If referring to It fixes time interior without completing next test action, then returns to error message, with the timely test case for obtaining execution terminal, obtain Take error message.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
In one embodiment, a kind of automatic test device is provided, in the automatic test device and above-described embodiment certainly Dynamicization test method corresponds.As shown in fig. 7, the automatic test device includes obtaining video module 10, parsing video screen module Block 20 checks control module 30 and executes action module 40.Detailed description are as follows for each functional module:
Video module 10 is obtained, for obtaining test exemplary video, the test exemplary video is for demonstrating test operation;
It parses video module 20 and obtains the corresponding target of each step test operation for parsing the test exemplary video Operational controls and test action, and test operation script is formed, the test operation script includes the target of each test operation Operational controls and test action;
Control module 30 is checked, for checking currently performed test action pair when executing the test operation script Whether the object run control answered is not empty set, if the corresponding object run control of currently performed test action is not empty set, Whether then judge to execute in the operation pages of terminal comprising the object run control;
Action module 40 is executed, if including the object run control for the operation pages for executing terminal, The terminal that executes executes the test action for being directed to the object run control.
Optionally, as shown in figure 8, parsing video module 20 includes:
The test exemplary video is divided into multiple piece of video for being spaced at preset timed intervals by video division unit 201 Section;
Action recognition unit 202 obtains the piece of video for the video clip to be inputted deliberate action judgment models The corresponding test action of section;
Formation sequence unit 203, it is raw for chronologically arranging the test action, and through default processing rule process At the sequence of operation, the test operation script includes the sequence of operation.
Optionally, as shown in figure 9, formation sequence unit 203 includes:
Empty set unit 2031 is judged, for judging whether the test action of two adjacent video clips is no operation;
Video unit 2032 is merged, it, will if the test action for two adjacent video clips is no operation Two adjacent video clips merge into fusion video clip;
Motor unit 2033 is replaced, for by fusion video clip input deliberate action judgment models, described in acquisition The test action of video clip is merged, and the test action of two adjacent video clips is replaced with into the fusion video The test action of segment;
Empty set unit 2034 is deleted, if it is no behaviour that the test action for two adjacent video clips, which is not present, Make, then by being deleted without operation in all test actions, chronologically arranges remaining test action, generate the sequence of operation.
Optionally, video module 20 is parsed further include:
It determines video clip unit, for detecting the type of test action, needs to know according to the determination of the type of test action Video clip corresponding to other object run control;
Identification frame unit is extracted, for needing to identify view corresponding to object run control from described by default extracting rule At least two identification frame is extracted in frequency segment;
Object run control element is obtained, for the identification frame to be inputted predetermined registration operation control identification model, obtains institute The corresponding object run control of video clip is stated, and the corresponding test action of the video clip is corresponding with the video clip Object run control it is associated.
Optionally, executing action module 40 includes:
The test action in the test operation script is sequentially executed at preset timed intervals in the execution terminal;
After completing a test action in the test operation script, judge next survey whether is completed in specified time Examination movement;
If returning to error message without completing next test action in specified time.
Specific about automatic test device limits the restriction that may refer to above for automated testing method, This is repeated no more.Modules in above-mentioned automatic test device can come fully or partially through software, hardware and combinations thereof It realizes.Above-mentioned each module can be embedded in the form of hardware or independently of in the processor in computer equipment, can also be with software Form is stored in the memory in computer equipment, executes the corresponding operation of the above modules in order to which processor calls.
In one embodiment, a kind of computer equipment is provided, which can be server, internal junction Composition can be as shown in Figure 10.The computer equipment include by system bus connect processor, memory, network interface and Database.Wherein, the processor of the computer equipment is for providing calculating and control ability.The memory packet of the computer equipment Include non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system, computer program and data Library.The built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The calculating The database of machine equipment is for storing the data that automated testing method is related to.The network interface of the computer equipment be used for it is outer The terminal in portion passes through network connection communication.To realize a kind of automated testing method when the computer program is executed by processor.
In one embodiment, a kind of computer equipment is provided, including memory, processor and storage are on a memory And the computer program that can be run on a processor, processor perform the steps of when executing computer program
Test exemplary video is obtained, the test exemplary video is for demonstrating test operation;
The test exemplary video is parsed, the corresponding object run control of each step test operation and test action are obtained, And test operation script is formed, the test operation script includes object run control and the test action of each test operation;
When executing the test operation script, whether the corresponding object run control of currently performed test action is checked It is not empty set, if the corresponding object run control of currently performed test action is not empty set, judges the operation for executing terminal It whether include the object run control in the page;
If the operation pages for executing terminal include the object run control, it is directed in execution terminal execution The test action of the object run control.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated Machine program performs the steps of when being executed by processor
Test exemplary video is obtained, the test exemplary video is for demonstrating test operation;
The test exemplary video is parsed, the corresponding object run control of each step test operation and test action are obtained, And test operation script is formed, the test operation script includes object run control and the test action of each test operation;
When executing the test operation script, whether the corresponding object run control of currently performed test action is checked It is not empty set, if the corresponding object run control of currently performed test action is not empty set, judges the operation for executing terminal It whether include the object run control in the page;
If the operation pages for executing terminal include the object run control, it is directed in execution terminal execution The test action of the object run control.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, To any reference of memory, storage, database or other media used in each embodiment provided herein, Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing The all or part of function of description.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of automated testing method characterized by comprising
Test exemplary video is obtained, the test exemplary video is for demonstrating test operation;
The test exemplary video is parsed, the corresponding object run control of each step test operation and test action, and shape are obtained At test operation script, the test operation script includes object run control and the test action of each test operation;
When executing the test operation script, check the corresponding object run control of currently performed test action whether be not Empty set judges the operation pages for executing terminal if the corresponding object run control of currently performed test action is not empty set In whether include the object run control;
If the operation pages for executing terminal include the object run control, execute in the execution terminal for described The test action of object run control.
2. automated testing method as described in claim 1, which is characterized in that the parsing test exemplary video obtains The corresponding object run control of each step test operation and test action are taken, and forms test operation script, the test operation Script includes object run control and the test action of each test operation, comprising:
It is spaced at preset timed intervals and the test exemplary video is divided into multiple video clips;
The video clip is inputted into deliberate action judgment models, obtains the corresponding test action of the video clip;
The test action is chronologically arranged, and through default processing rule process, generates the sequence of operation, the test operation foot This includes the sequence of operation.
3. automated testing method as claimed in claim 2, which is characterized in that the test action includes no operation, described The test action is chronologically arranged, and through default processing rule process, generates the sequence of operation, the test operation script packet Include the sequence of operation, comprising:
Whether the test action for judging two adjacent video clips is no operation;
If the test action of two adjacent video clips is no operation, two adjacent video clips are merged To merge video clip;
The fusion video clip is inputted into deliberate action judgment models, obtains the test action of the fusion video clip, and The test action of two adjacent video clips is replaced with to the test action of the fusion video clip;
If the test action of two adjacent video clips is there is no being no operation, by the nothing in all test actions Operation is deleted, and is chronologically arranged remaining test action, is generated the sequence of operation.
4. automated testing method as claimed in claim 2, which is characterized in that described chronologically to arrange the test action Column, and through default processing rule process, generate the sequence of operation, after the test operation script includes the sequence of operation, also Include:
The type for detecting test action needs to identify video corresponding to object run control according to the determination of the type of test action Segment;
Need to identify extraction at least two in video clip corresponding to object run control from described by default extracting rule Identify frame;
The identification frame is inputted into predetermined registration operation control identification model, obtains the corresponding object run control of the video clip, And the corresponding test action of video clip object run control corresponding with the video clip is associated.
5. automated testing method as described in claim 1, which is characterized in that if the operation pages for executing terminal Comprising the object run control, then the test action for the object run control is executed in the execution terminal, Include:
The test action in the test operation script is sequentially executed at preset timed intervals in the execution terminal;
After completing a test action in the test operation script, judge that next test whether is completed in specified time to be moved Make;
If returning to error message without completing next test action in specified time.
6. a kind of automatic test device characterized by comprising
Video module is obtained, for obtaining test exemplary video, the test exemplary video is for demonstrating test operation;
It parses video module and obtains the corresponding object run control of each step test operation for parsing the test exemplary video Part and test action, and test operation script is formed, the test operation script includes the object run control of each test operation Part and test action;
Control module is checked, for checking the corresponding mesh of currently performed test action when executing the test operation script It marks whether operational controls are not empty sets, if the corresponding object run control of currently performed test action is not empty set, judges Whether execute in the operation pages of terminal includes the object run control;
Action module is executed, if including the object run control for the operation pages for executing terminal, is held described Row terminal executes the test action for being directed to the object run control.
7. automatic test device as claimed in claim 6, which is characterized in that the parsing video module includes:
The test exemplary video is divided into multiple video clips for being spaced at preset timed intervals by video division unit;
It is corresponding to obtain the video clip for the video clip to be inputted deliberate action judgment models for action recognition unit Test action;
Formation sequence unit generates operation sequence for chronologically arranging the test action, and through default processing rule process Column, the test operation script includes the sequence of operation.
8. automatic test device as claimed in claim 7, which is characterized in that the formation sequence unit includes:
Empty set unit is judged, for judging whether the test action of two adjacent video clips is no operation;
Merging video unit will be described adjacent if the test action for two adjacent video clips is no operation Two video clips merge into fusion video clip;
Motor unit is replaced, for the fusion video clip to be inputted deliberate action judgment models, obtains the fusion video The test action of segment, and the test action of two adjacent video clips is replaced with into the survey for merging video clip Examination movement;
Empty set unit is deleted, it, will if it is no operation that the test action for two adjacent video clips, which is not present, Deleting in all test actions without operation, chronologically arranges remaining test action, generates the sequence of operation.
9. a kind of computer equipment, including memory, processor and storage are in the memory and can be in the processor The computer program of upper operation, which is characterized in that the processor realized when executing the computer program as claim 1 to The step of any one of 5 automated testing method.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In the step of realization automated testing method as described in any one of claim 1 to 5 when the computer program is executed by processor Suddenly.
CN201811537619.0A 2018-12-15 2018-12-15 Automated testing method, device, computer equipment and storage medium Pending CN109783365A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811537619.0A CN109783365A (en) 2018-12-15 2018-12-15 Automated testing method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811537619.0A CN109783365A (en) 2018-12-15 2018-12-15 Automated testing method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN109783365A true CN109783365A (en) 2019-05-21

Family

ID=66497048

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811537619.0A Pending CN109783365A (en) 2018-12-15 2018-12-15 Automated testing method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109783365A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110209581A (en) * 2019-05-31 2019-09-06 北京字节跳动网络技术有限公司 Trigger action analysis method and device based on application program
CN111246286A (en) * 2020-01-10 2020-06-05 北京百度网讯科技有限公司 Test case obtaining method and device and electronic equipment
CN111459796A (en) * 2020-02-27 2020-07-28 西安广和通无线软件有限公司 Automatic testing method and device, computer equipment and storage medium
CN112100075A (en) * 2020-09-24 2020-12-18 腾讯科技(深圳)有限公司 User interface playback method, device, equipment and storage medium
CN112231040A (en) * 2020-10-30 2021-01-15 中国科学院空天信息创新研究院 Method and device for editing time sequence task in software system
CN112578979A (en) * 2020-12-28 2021-03-30 中国建设银行股份有限公司 Method and device for generating operation script, readable medium and equipment
CN116088825A (en) * 2023-04-03 2023-05-09 广东省信息工程有限公司 Script generation method, visual editor and storage medium

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110209581A (en) * 2019-05-31 2019-09-06 北京字节跳动网络技术有限公司 Trigger action analysis method and device based on application program
CN111246286A (en) * 2020-01-10 2020-06-05 北京百度网讯科技有限公司 Test case obtaining method and device and electronic equipment
CN111246286B (en) * 2020-01-10 2022-06-10 北京百度网讯科技有限公司 Test case obtaining method and device and electronic equipment
CN111459796A (en) * 2020-02-27 2020-07-28 西安广和通无线软件有限公司 Automatic testing method and device, computer equipment and storage medium
CN111459796B (en) * 2020-02-27 2024-03-15 西安广和通无线软件有限公司 Automated testing method, apparatus, computer device and storage medium
CN112100075A (en) * 2020-09-24 2020-12-18 腾讯科技(深圳)有限公司 User interface playback method, device, equipment and storage medium
CN112100075B (en) * 2020-09-24 2024-03-15 腾讯科技(深圳)有限公司 User interface playback method, device, equipment and storage medium
CN112231040A (en) * 2020-10-30 2021-01-15 中国科学院空天信息创新研究院 Method and device for editing time sequence task in software system
CN112231040B (en) * 2020-10-30 2024-05-24 中国科学院空天信息创新研究院 Time sequence task editing method and device in software system
CN112578979A (en) * 2020-12-28 2021-03-30 中国建设银行股份有限公司 Method and device for generating operation script, readable medium and equipment
CN116088825A (en) * 2023-04-03 2023-05-09 广东省信息工程有限公司 Script generation method, visual editor and storage medium

Similar Documents

Publication Publication Date Title
CN109783365A (en) Automated testing method, device, computer equipment and storage medium
CN106844217B (en) Method and device for embedding point of applied control and readable storage medium
CN108304498B (en) Webpage data acquisition method and device, computer equipment and storage medium
CN110704304B (en) Application program testing method and device, storage medium and server
CN107133174A (en) Test case code automatically generating device and method
CN106126410B (en) The reminding method and device of code conflicts
CN108399124A (en) Application testing method, device, computer equipment and storage medium
CN109726105A (en) Test data building method, device, equipment and storage medium
CN110888709A (en) Intelligent operation method and device of monitoring screen, computer equipment and storage medium
CN108959067A (en) Test method, device and the computer readable storage medium of search engine
EP3509019A1 (en) Software product development defect and issue prediction and diagnosis
CN108399125B (en) Automatic testing method and device, computer equipment and storage medium
CN110471838A (en) Method of calibration, device, computer equipment and the storage medium of test case
CN113434395A (en) Automatic generation method, device, equipment and medium of test case
CN110008119A (en) Report test method, device, computer equipment and storage medium
CN113505895B (en) Machine learning engine service system, model training method and configuration method
CN110232018A (en) Interface test method, device, computer equipment
CN113886204A (en) User behavior data collection method and device, electronic equipment and readable storage medium
CN112612393A (en) Interaction method and device of interface function
CN114693011A (en) Policy matching method, device, equipment and medium
CN110175899A (en) A kind of method, apparatus, computer equipment and readable storage medium storing program for executing for checking invoice
CN115687146A (en) BIOS (basic input output System) test method and device, computer equipment and storage medium
CN115686495A (en) Application generation method and device and server
CN115481025A (en) Script recording method and device for automatic test, computer equipment and medium
CN108984386A (en) Test method, device and the storage medium of application program search

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