CN109857645A - A kind of automated testing method and device for application program - Google Patents

A kind of automated testing method and device for application program Download PDF

Info

Publication number
CN109857645A
CN109857645A CN201910002926.7A CN201910002926A CN109857645A CN 109857645 A CN109857645 A CN 109857645A CN 201910002926 A CN201910002926 A CN 201910002926A CN 109857645 A CN109857645 A CN 109857645A
Authority
CN
China
Prior art keywords
display interface
application program
current display
position information
target position
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
CN201910002926.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.)
Beijing Testin Information Technology Co Ltd
Original Assignee
Guangzhou Cloud Information 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 Guangzhou Cloud Information Technology Co Ltd filed Critical Guangzhou Cloud Information Technology Co Ltd
Priority to CN201910002926.7A priority Critical patent/CN109857645A/en
Publication of CN109857645A publication Critical patent/CN109857645A/en
Pending legal-status Critical Current

Links

Abstract

The present invention discloses a kind of automated testing method and device for application program, can carry out automatic test with greater efficiency and relatively accurately to the application program in mobile terminal.The described method includes: carrying out semantic parsing to the automatic test cases comprising multiple characters, operation object character and the operation of corresponding automatic test are determined;Using preset at least one method of determination, the target position information to match with the operation object character is determined from the current display interface of application program;In the current display interface, by way of simulated operation, the automatic test is executed to the target position information and is operated.

Description

A kind of automated testing method and device for application program
Technical field
The present invention relates to field of computer technology more particularly to a kind of automated testing methods and dress for application program It sets.
Background technique
As the continuous development of mobile terminal software and hardware has developed various answer for the various demands for meeting user It (is referred to as applied) with program, it is generally the case that needs test the function of application.For example, first some application can be pacified Dress in the terminal, further according to pre-set test case, is tested some function of the application.Or by the application It is separately mounted in different mobile terminal, according to test case, some function is tested respectively, etc..
Currently, for the test of application, more popular mode is manual testing, such as the developer of some application, Can be by the application installation of exploitation in multiple mobile terminals, and tested respectively by manual operation.
However, the usual efficiency of the mode of this manual testing is lower, and is easy to appear omission, and whenever application occurs more After new, it may be necessary to adapt to new application again, efficiency further decreases.So need to provide a kind of scheme, it being capable of more efficient Rate and relatively accurately in mobile terminal application program carry out automatic test.
Summary of the invention
The embodiment of the present invention provides a kind of automated testing method and device for application program, for greater efficiency, And automatic test relatively accurately is carried out to the application program in mobile terminal.
In order to solve the above technical problems, the embodiments of the present invention are implemented as follows:
The embodiment of the present invention adopts the following technical solutions:
A kind of automated testing method for application program, comprising:
Semantic parsing is carried out to the automatic test cases comprising multiple characters, determine operation object character and it is corresponding from Dynamicization test operation;
Using preset at least one method of determination, determined from the current display interface of application program and the operation The target position information that Object Character matches;
In the current display interface, by way of simulated operation, to the target position information execute it is described from Dynamicization test operation.
A kind of automatic test device for application program, comprising: resolution unit, determination unit and test cell, Wherein,
The resolution unit determines operation for carrying out semantic parsing to the automatic test cases comprising multiple characters Object Character and the operation of corresponding automatic test;
The determination unit, for utilizing preset at least one method of determination, from the current display interface of application program In determine the target position information to match with the operation object character;
The test cell is used in the current display interface, by way of simulated operation, to the target position Confidence breath executes the automatic test operation.
A kind of computer readable storage medium stores computer program, the meter on the computer readable storage medium The step of above method is realized when calculation machine program is executed by processor.
The technical solution provided by above embodiments is as it can be seen that carrying out language to the automatic test cases comprising multiple characters After justice parsing, it can determine operation object character and the operation of corresponding automatic test, recycle preset method of determination, from The target position information to match with operation object character is determined in current display interface, so as in current display interface In, by way of simulated operation, automatic test operation is executed to target position information.That is, tester can pass through Character writes automatic test cases, in test phase, can parse to test case, thus obtain operation object and Mode of operation determines the target position to match with operation object, in turn in current display interface in the way of preset The mode of operation can be executed to target position.This programme can be automatically parsed after getting test case, and be determined The target position of operation is needed to be implemented out, thus realize automatic test, compared to the mode of manual testing, survey with higher Try efficiency and higher accuracy.
Detailed description of the invention
It in order to illustrate the embodiments of the present invention more clearly or existing technical solution, below will be to embodiment or the prior art Attached drawing needed in description is briefly described, it should be apparent that, the accompanying drawings in the following description is only in the present invention The some embodiments recorded without any creative labor, may be used also for those of ordinary skill in the art To obtain other drawings based on these drawings.
Fig. 1 is the flow diagram of the automated testing method provided in an embodiment of the present invention for application program;
Fig. 2 is the schematic diagram of the automated testing method provided in an embodiment of the present invention for application program;
Fig. 3 is the structural schematic diagram of the automatic test device provided in an embodiment of the present invention for application program;
Fig. 4 is the structural schematic diagram of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with specific embodiment and accordingly Technical solution of the present invention is clearly and completely described in attached drawing.Obviously, described embodiment is only a part of the invention Embodiment, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making wound Every other embodiment obtained under the premise of the property made labour, shall fall within the protection scope of the present invention.
Below in conjunction with attached drawing, each embodiment provides during the present invention will be described in detail technical solution.
Embodiment 1
In order to provide a kind of greater efficiency and relatively accurately carry out automatic test to the application program in mobile terminal Scheme can with greater efficiency and relatively accurately the present embodiment provides a kind of automated testing method for application program Automatic test is carried out to the application program in mobile terminal.Assuming that the executing subject can be mobile terminal, detailed process is shown It is intended to as shown in Figure 1, comprising:
Step 102: semantic parsing is carried out to the automatic test cases comprising multiple characters, determine operation object character and Corresponding automatic test operation.
Test case can be finger for being mounted in mobile application, and the test of some function of some application program is said It is bright, may include one or more specific test operation, such as " click and close key ", " click upper left return to press Key ", " inputting XXXXX in account input frame ", etc. namely this step in automatic test cases can be by multiple Chinese characters Composition.
In this step, can by Natural Language Processing Models, to the automatic test cases comprising multiple characters into The semantic parsing of row, specifically, natural language processing (natural language processing, NLP) may include multiple models Farmland, such as text read aloud (Text to speech)/speech synthesis (Speech synthesis), speech recognition (Speech Recognition), Chinese Automatic Word Segmentation (Chinese word segmentation), part-of-speech tagging (Part-of-speech Tagging), syntactic analysis (Parsing) etc..
Specifically, using Natural Language Processing Models, automatic test cases can be carried out to semantic parsing, will also be surveyed Multiple characters in example on probation are converted to structural data, obtain operation object character and the operation of corresponding automatic test, than Such as, it for " click and close key ", can parse as operation object character: closing key and automatic test operation: clicking; For another example, it for " clicking upper left return key ", can parse as operation object character: returning to key and automatic test Operation: it clicks.
In practical applications, Natural Language Processing Models can be trained in advance, specifically can for it is following not It is trained with aspect:
First aspect can be trained for Chinese word segmentation, specifically, due to test case have it is very high similar Property, such as " return ", " retracting ", " click ", " clicking ", " downslide ", " drop-down ", " key ", " button " etc. then can be by right The a large amount of test case corpus collected are labeled, and are increased dictionary library, are improved the means such as keyword weight, instruct to model Practice, to reach preferably participle effect.Meanwhile the part of speech of participle can be labeled, to reject invalid word, extract Useful keyword.
The second aspect can be trained the type of word, specifically, can be to a large amount of test case corpus of collection Man-made structurization mark is carried out, classification based training is carried out by deep learning model, obtains the term vector for representing part of speech type, in order to When parsing to test case, can determine which is operation object, which is test operation.It is specifically such as automatic Changing test operation can have: click, double-click, upper cunning, downslide, left cunning, right cunning, input etc., the character of operation object can have: return Go back to key, input frame, any position etc..
In terms of third, similar word can also be identified and be trained, for example, can be right according to the similarity of term vector Keyword is classified, so as to be sorted out according to similar word, specific such as test operation used in test case Word be " tapping ", " clicking ", then by training after model, can be classified as " clicks " operate.
The citing of test case as previously mentioned, " clicking upper left return key ", which includes for return The azimuth information " upper left side " of key for another example in practical applications may limit the shape of some operation object in test case The information such as shape, color, number of operations.Then in one embodiment, this method can also comprise determining that out and operation object word Accord with corresponding object properties information.The object properties information can describe the feature of operation object and/or test operation Information, in one embodiment, the object properties information can include azimuth information, such as " click is upper left Return to key ", so that it may including azimuth information: upper left side.
In practical applications, some test cases are it is possible that the Chinese incorrect situation of grammer, such as test case Do not include operation object character in " gliding three times ", then in practical applications, test can be supplemented by preset mode The element of use-case, for example when not parsing operation object character using Natural Language Processing Models, can supplement as any bit It sets, etc..And for this arbitrary way, it can also train, make at natural language together in training Natural Language Processing Models Reason model has parsing test case and supplements the ability of element.
By the agency of can be trained the type of word, then this programme may be used also when to natural language processing above To carry out man-made structurization mark to the object properties information in test case, and classification instruction is carried out by deep learning model Practice, when parsing to test case, to determine which is object properties information.Specifically such as represent orientation Word has: the upper left corner, the upper right corner, the lower left corner, the lower right corner, among screen, above, below, above intermediate, following centre etc..
And in practical applications, which can also include colouring information, the shape letter for operation object Breath, content information, number of operations information, mode of operation information etc..
As shown in table 1 below, for after being parsed to relatively conventional test case as a result, may include operation object word Symbol, the operation of corresponding automatic test and corresponding object properties information.
Test case Operation object character Automatic test operation Object properties information
Click upper left return key Return to key It clicks Upper left side
It clicks and closes key Close key It clicks
XXXX is inputted in account input frame Account input frame Input XXXX
Upper cunning is three times Any position Upper cunning Three times
Click list List It clicks
Table 1
In practical applications, a versatility can be established to test case and preferably write specification, wherein can wrap Include the Chinese character that Natural Language Processing Models can be parsed relatively accurately.
Step 104: using preset at least one method of determination, determined from the current display interface of application program with The target position information that the operation object character matches.
Parsed to test case, and obtain operation object character and corresponding automatic test operation after, so that it may With determining to match with the operation object character in the current display interface of mobile terminal and need to carry out test operation Target position information, and the target position information can correspond to second test in the operation object, such as table 1 use Example is determining that operation object character is to close after key, test operation be click, so that it may from current display interface, really It makes and " closing " character matches in the closing key location information.
Specifically, it can be determined from the current display interface of application program and the operation by following several ways The target position information that Object Character matches:
First way: parse in the current display interface of application program can handle icon control, and it is respectively corresponding Location information;According to the location information parsed, from current display interface interception comprising this can handle icon control control Part image;Using preset image classification model, the target to match with test object character is determined from the control image Control image, and determine corresponding target position information.
Specifically, may include in the display interface of application program one or more can operational controls, for realizing correspondence Function, therefore can first parse in current display interface can handle icon control and corresponding location information, tool For the implementation of body, such as the mobile terminal to carry Android (operating system of Google company exploitation), Ke Yili Control is identified with the UI Automator realization in system.UI Automator can be an open source test frame, It, can primarily directed to the automated test frame done in Android application UI (User Interface, user interface) To provide the function of identification control.
In practical applications, the control in display interface may include at least three classes: system control, icon control and text This control, system control can refer to the control for realizing system function, for example can be the return key of system intialization, and homepage is pressed Key etc.;Icon control can refer to by graphical representation go out control, such as direction arrow figure, plus sige figure, question mark figure, Magnifying glass figure etc. can be used to implement functions such as return, addition, help, search etc.;Text control can refer to text Based on control, for example return to key, delete button etc., can show " return " character, " deletion " character etc..
It under normal circumstances, can include system control after parsing control in display interface using UI Automator, However under normal conditions, test case is tested the control in application, it is possible to system control is first filtered out, such as The system control that package is com.android.systemui can be filtered out.And for icon control and text control, There can be the different forms of expression in system, such as icon control, extraction can be passed through Android.widget.ImageView, android.widget.Button, android.widget.ImageButton and solve Be precipitated icon control, for text control, then can by extract android.widget.TextView, Android.widget.EditText and parse text control, so as to obtain control class class, control location letter Cease the content of text text of bounds, control.Here, control location information bounds, so that it may including X1、Y1、X2、Y2, In, X1And Y1It can be X, the Y axis coordinate in the upper left corner of control, X2And Y2It can be X, the Y axis coordinate in the lower right corner of control.Control The content of text text of part, so that it may including " return ", " closing ", etc. in display interface, be the preset character of control.
The method can first be directed to operable icon control, then can first extract operating in current display interface Icon control and corresponding location information bounds, after obtaining location information bounds, so that it may from current display The X in bounds is utilized in interface1、Y1、X2And Y2, interception comprising this can handle icon control control image, to obtain one A or multiple control images, hereafter, so that it may utilize preset image classification model, from the one or more control image really Make the target widget image to match with test object character.
Further, image classification model can use two disaggregated models, judge whether the image of input is specified point Class.In model training, corresponding positive and negative two kinds of samples can be prepared and be trained as input, for example can refer to will just True icon control image, and the Image control image of mistake are trained as input, and the model after making training is receiving To after image to be classified, can determine whether the image to be classified is specified classification.With the continuous evolution of UI, Ke Yisui The newest control image of Shi Liyong is trained model, to continue to optimize the performance of model.It and in practical applications, can be with Model independent is preset for difference, and individually training and optimization.For example individual return icon model, search can be preset Icon model, closing icon model etc..Image classification model is being utilized, is being determined from the control image and test object character When the target widget image to match, corresponding icon model can be picked out first according to test object character, so as to compared with Fast identify.For example, test object character can be " closing key ", then it can use and close icon model, from the control The target widget image to match with test object character is determined in part image.
Determining target widget image, then location information used, determines when can will intercept the target widget image For target position information.So far, it just defines from current display interface and matches with operation object character, and need to hold The target position information of row test operation.
The second way: parsing the text control that operates in the current display interface of application program, and respectively corresponding Text information and location information;According to text information, the target text information to match with test object character is determined, And determine corresponding target position information.
Specifically, by the agency of above, can by extract android.widget.TextView, Android.widget.EditText and obtain text control, so as to obtain control class class, control location information The content of text text of bounds, control, word content of text text here shown when can be display text control Symbol, so, so that it may it according to text information, is matched, is determined and test object character phase with test object character The target text information matched, and according to control location information bounds, determine corresponding target position information.Here Match, may include exact matching, also may include that similarity (such as the similarity calculated according to term vector) meets specified conditions Matching.For example, test object character can be " returning to key ", and the content of text text of some text control parsed It is also " return ", it, then can be by the position of this text control since test object character and content of text text matching degree are very high Confidence ceases bounds, as target position information.
The third mode: preset image recognition model is utilized, time is identified in the current display interface of application program Select icon and corresponding candidate location information;Candidate's icon is matched with the operation object character, determines target Icon control, and determine corresponding target position information.
In first two mode, can use system function parsing be applied program display interface in control, and In practical applications, the control parsed in display interface may need specific permission, so may occur parsing The case where control in display interface or the case where be likely to occur parsing error.It therefore in this fashion, can be first with figure As identification model, candidate icon and corresponding candidate location information are identified in the current display interface of application program, than It can such as identify a variety of figures, as candidate icon, and the position according to image in display interface, it determines corresponding Candidate location information.
After obtaining candidate icon, so that it may it is matched, can be similar in first way with operation object character, Using two disaggregated models, determine the classification of candidate icon, determine whether with operation object character match, in practical application In, two disaggregated models can also be integrated in image recognition model.
4th kind of mode: carrying out character recognition in the current display interface of application program, obtains candidate characters and right The candidate location information answered;Candidate's text is matched with the operation object character, determines target character, and determine Corresponding target position information.
By the agency of, the control that possibly can not be resolved in application program display interface are then our in former mode In formula can utilize preset character recognition model, character recognition is carried out in current display interface, obtain candidate characters, with And corresponding candidate location information.For example, OCR (Optical Character Recognition, optical character can be passed through Identification) identifying system, Text region is carried out to display interface, identifies one or more groups of candidate characters and corresponding candidate Location information.
Hereafter, which can be matched with the operation object character, may thereby determine that out target character, And by the candidate location information of the candidate text to match with operation object character, it is determined as target position information.
By the agency of can also be determined and operation object word when parsing to test case in abovementioned steps Corresponding object properties information is accorded with, for example, the object properties information may include the information such as shape, color, then in this step, The target position information to match with the operation object character is determined from the current display interface of application program, can wrap It includes: determining to match with the operation object character and the object properties information from the current display interface of application program Target position information.For example, can with by the above-mentioned means, determine the color of figure or text, so as to parse Object properties information is matched, etc..For another example the object properties information may include azimuth information.Then shown in this step from current When showing the target position information for determining to match in interface with operation object character, it can also sentence azimuth information as one Disconnected foundation, specifically, in order to more accurately and more efficiently determine target position information, in one embodiment, when When including azimuth information in the object properties information determined, determined from the current display interface of application program and the operation The target position information that Object Character matches may include: according to azimuth information, from the current display interface of application program Select target display interface;Determine that the target position to match with the operation object character is believed from the target display interface Breath.
Specifically, when determining azimuth information, can according to preset corresponding relationship or Natural Language Processing Models, Azimuth information is parsed, so that it is determined that go out to match the calculation of the azimuth information, it accordingly can be according to current display circle The full-size of height and width in face determines at least two groups coordinate for matching the azimuth information, and then can be according to this two groups of seats Mark, from current display interface, selects target display interface, for example, being directed to " upper left side " this azimuth information, so that it may really Make top left co-ordinate and centre coordinate, for matching should " upper left side " azimuth information at least two groups coordinate, accordingly can be from Target display interface is selected in current display interface.So as to determine mesh by least one of above-mentioned four kinds of modes Cursor position information.
Further, for first way, so that it may include: according to azimuth information, from the current display of application program Target display interface is selected in interface;Parse target display interface in can handle icon control and corresponding position Confidence breath;According to the location information parsed, from target display interface interception comprising this can handle icon control control figure Picture;Using preset image classification model, the target widget to match with test object character is determined from the control image Image, and determine corresponding target position information.
For the second way, so that it may include: to be chosen from the current display interface of application program according to azimuth information Target display interface out;Text control and corresponding text information and position are operated in parsing target display interface Confidence breath;According to text information, the target text information to match with test object character is determined, and determine corresponding Target position information.
For the third mode, so that it may include: to be chosen from the current display interface of application program according to azimuth information Target display interface out;Using preset image recognition model, candidate icon is identified in target display interface, and corresponding Candidate location information;Candidate's icon is matched with the operation object character, determines target icon control, and determine Corresponding target position information out.
For the 4th kind of mode, so that it may include: to be chosen from the current display interface of application program according to azimuth information Target display interface out;Character recognition is carried out in target display interface, obtains candidate characters and corresponding candidate bit confidence Breath;Candidate's text is matched with the operation object character, determines target character, and determine corresponding target position Information.
In practical applications, in order in the mesh for determining to match with operation object character from current display interface When cursor position information, it can have higher success rate, then it in one embodiment, can be in conjunction with above-mentioned four kinds of modes, really Make target position information.And according to above-mentioned introduction, first and third kind of mode is primarily directed to the mesh for how determining graphical control Cursor position information, and second, four kind of mode be primarily directed to the target position information for how determining text control, and in reality In, first and second kind of mode, due to that can parse control out of system, and three, four kind of mode, it is aobvious by traversing Show interface, the parsing carried out by figure or character, so under normal circumstances, first two mode efficiency with higher and standard True rate.Therefore when being combined these four modes, there can be the strategy of tandem.
Further, in one embodiment, using preset at least one method of determination, from working as application program The target position information to match with the operation object character is determined in preceding display interface, may include: that can judgement parse Out can operational controls first parse in current display interface if can be with and operate text control and corresponding text Information and location information;According to text information, can judgement determine the target text to match with test object character letter Breath, if can, it is determined that go out corresponding target position information, if cannot, then character recognition is carried out in current display interface, it obtains To candidate characters and corresponding candidate location information;Candidate's text is matched with the operation object character, judges energy It is no to determine target character, if can, it is determined that go out corresponding target position information, if cannot, can switch to parsing can operate Icon control, then can parse in current display interface can handle icon control and corresponding location information;Root again According to corresponding location information, intercept out comprising this can handle icon control control image, to utilize image classification mould Can type, judgement determine the target widget image to match with test object character, if can, it is determined that go out corresponding target position Confidence breath, if cannot, preset image recognition model is recycled, candidate icon is identified in current display interface, and Corresponding candidate location information;Candidate's icon is matched with the operation object character, can judgement determine target figure Control is marked, if can, it is determined that go out corresponding target position information, if cannot, test crash.
In practical applications, the sequence of four kinds of modes can also be exchanged according to actual needs, for example, can first parse can Handle icon control, and target position information is determined with this, if being not determined by, identify candidate icon, and true again with this Set the goal position, if being still not determined by, the mode of text control and character recognition can be operated by parsing, until really Set the goal location information.
And in practical applications, can also first parse handle icon control and can operate text control, and by each From mode, determine target position information, if being not determined by, then by way of image recognition model or character recognition, Determine target position information.
Step 106: in this prior in display interface, by way of simulated operation, executing to the target position information should Automatic test operation.
In abovementioned steps, automatic test operation is defined, and defines and needs to be implemented automatic test behaviour The target position information of work, then in this step, so that it may in current display interface, by way of simulated operation, to mesh Cursor position information executes automatic test operation.
For example, according to citing above, test case is " click and close key ", the operation object character parsed and from Dynamicization test operation is " click ", operation object character is " closing key ".Closing can then be pressed in current display interface Key executes the clicking operation of simulation.
In practical applications, usually test log can be generated in automatic test, so in order to automate The process of test is recorded, and in one embodiment, this method can also include: that will execute automatically to target position information Change test operation to be recorded.For example target position information and corresponding automatic test can be operated, " close key- Click " it is recorded, so as to which complete automatic test course is recorded.
As shown in Fig. 2, can read a test for the schematic diagram of the automated testing method for application program and use Example carries out semantic parsing to the test case, obtains operation object character, automatic test operation, and including azimuth information Object properties information.Hereafter, it can be determined that whether can parse control from the current display interface of application program.
If can be parsed out control, operable text control is first parsed, passes through azimuth information and operation object word Symbol, is matched in operable text control, if being matched to, it is determined that otherwise going out target position information can pass through OCR identifying system, comprehensive azimuth information and operation object character are matched again, if being matched to, it is determined that go out target position Otherwise information parses operable icon control, and according to azimuth information, interception is comprising that can grasp in current display interface Make the control image of icon control, and matched using image classification module, if being matched to, it is determined that goes out target position letter Breath, otherwise, can be matched using candidate icon is identified with operation object character by image recognition model, if matching It arrives, it is determined that go out target position information, if not being matched to still, can determine test crash.Determining target position letter After breath, then simulated automatic test operation can be executed to it.
If control cannot be parsed, can by OCR identifying system, comprehensive azimuth information and operation object character into Row operation object character match, if being matched to, it is determined that go out target position information, otherwise, can be by image recognition model, benefit It with candidate icon is identified, is matched with operation object character, the case where specific to control cannot be parsed, it is seen that figure Dotted arrow part in 2.
By the method for above embodiments offer as it can be seen that carrying out semantic solution to the automatic test cases comprising multiple characters After analysis, it can determine operation object character and the operation of corresponding automatic test, preset method of determination be recycled, from current The target position information to match with operation object character is determined in display interface, so as in current display interface, By way of simulated operation, automatic test operation is executed to target position information.That is, tester can pass through character Automatic test cases are write, in test phase, test case can be parsed, to obtain operation object and operation Mode, determines the target position to match with operation object in current display interface in the way of preset, and then can be with The mode of operation is executed to target position.This programme can be automatically parsed after getting test case, and determine to need The target position of operation is executed, thus realize automatic test, compared to the mode of manual testing, test effect with higher Rate and higher accuracy.
Embodiment 2
Based on identical design, the embodiment of the present invention 2 provides a kind of automatic test device for application program, can Automatic test is carried out with greater efficiency and relatively accurately to the application program in mobile terminal.The structural representation of the device Figure is as shown in figure 3, can be applied to control terminal, comprising: resolution unit 202, determination unit 204 and test cell 206, In,
Resolution unit 202 can be used for carrying out the automatic test cases comprising multiple characters semantic parsing, determine behaviour Make Object Character and the operation of corresponding automatic test;
Determination unit 204 can be used for using preset at least one method of determination, from current display circle of application program The target position information to match with operation object character is determined in face;
Test cell 206, can be used in current display interface, by way of simulated operation, believe target position Breath executes automatic test operation.
In one embodiment, resolution unit 202 can be also used for: it is corresponding with operation object character right to determine As attribute information;Then
Determination unit 204, can be used for: determined from the current display interface of application program with operation object character with And the target position information that object properties information matches.
In one embodiment, determination unit 204 can be used for:
According to azimuth information, target display interface is selected from the current display interface of application program;
The target position information to match with the operation object character is determined from target display interface.
In one embodiment, determination unit 204 can be used for:
Parse current display interface in can handle icon control and corresponding location information;
According to location information, from the current display interface of application program interception comprising can handle icon control control figure Picture;
Using image classification model, the target widget figure to match with test object character is determined from control image Picture, and determine corresponding target position information.
In one embodiment, determination unit 204 can be used for:
Parse in the current display interface of application program operate text control and corresponding text information and Location information;
According to text information, the target text information to match with test object character is determined, and determine corresponding Target position information.
In one embodiment, determination unit 204 can be used for:
Using image recognition model, candidate icon and corresponding is identified in the current display interface of application program Candidate location information;
Candidate icon is matched with operation object character, determines target icon, and determines corresponding target position Confidence breath.
In one embodiment, determination unit 204 can be used for:
Character recognition is carried out in the current display interface of application program, obtains candidate characters and corresponding candidate bit Confidence breath;
Candidate text is matched with operation object character, determines target character, and determines corresponding target position Confidence breath.
In one embodiment, which further includes recording unit, be can be used for:
Automatic test operation will be executed to target position information to record.
By the method for above embodiments offer as it can be seen that carrying out semantic solution to the automatic test cases comprising multiple characters After analysis, it can determine operation object character and the operation of corresponding automatic test, preset method of determination be recycled, from current The target position information to match with operation object character is determined in display interface, so as in current display interface, By way of simulated operation, automatic test operation is executed to target position information.That is, tester can pass through character Automatic test cases are write, in test phase, test case can be parsed, to obtain operation object and operation Mode, determines the target position to match with operation object in current display interface in the way of preset, and then can be with The mode of operation is executed to target position.This programme can be automatically parsed after getting test case, and determine to need The target position of operation is executed, thus realize automatic test, compared to the mode of manual testing, test effect with higher Rate and higher accuracy.
Fig. 4 is the structural schematic diagram of one embodiment of the present of invention electronic equipment.In hardware view, which includes Processor, optionally further comprising internal bus, network interface, memory.Wherein, memory may include memory, such as high speed Random access memory (Random-Access Memory, RAM), it is also possible to further include nonvolatile memory (non- Volatile memory), for example, at least 1 magnetic disk storage etc..Certainly, which is also possible that other business institutes The hardware needed.
Processor, network interface and memory can be connected with each other by internal bus, which can be ISA (Industry Standard Architecture, industry standard architecture) bus, PCI (Peripheral Component Interconnect, Peripheral Component Interconnect standard) bus or EISA (Extended Industry Standard Architecture, expanding the industrial standard structure) bus etc..Bus can be divided into address bus, data/address bus, control bus Deng.Only to be indicated with a four-headed arrow in Fig. 4 convenient for indicating, it is not intended that an only bus or a type of total Line.
Memory, for storing program.Specifically, program may include program code, and program code includes computer behaviour It instructs.Memory may include memory and nonvolatile memory, and provide instruction and data to processor.
Processor is from the then operation into memory of corresponding computer program is read in nonvolatile memory, in logical layer The automatic test device for being directed to application program is formed on face.Processor executes the program that memory is stored, and is specifically used for Following operation is executed in control terminal:
Semantic parsing is carried out to the automatic test cases comprising multiple characters, determine operation object character and it is corresponding from Dynamicization test operation;
Using preset at least one method of determination, determined from the current display interface of application program and the operation The target position information that Object Character matches;
In the current display interface, by way of simulated operation, to the target position information execute it is described from Dynamicization test operation.
The method that the above-mentioned automatic test device for application program provided such as embodiment illustrated in fig. 3 of the present invention executes It can be applied in processor, or realized by processor.Processor may be a kind of IC chip, the place with signal Reason ability.During realization, each step of the above method can by the integrated logic circuit of the hardware in processor or The instruction of software form is completed.Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP) etc.;It can also be Digital Signal Processing Device (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other can Programmed logic device, discrete gate or transistor logic, discrete hardware components.It may be implemented or execute present invention implementation Disclosed each method, step and logic diagram in example.General processor can be microprocessor or the processor can also be with It is any conventional processor etc..
The step of method in conjunction with disclosed in the embodiment of the present invention, can be embodied directly in hardware decoding processor and execute At, or in decoding processor hardware and software module combination execute completion.Software module can be located at random access memory, This fields such as flash memory, read-only memory, programmable read only memory or electrically erasable programmable memory, register maturation In storage medium.The storage medium is located at memory, and processor reads the information in memory, completes above-mentioned side in conjunction with its hardware The step of method.
The automatic test device for application program that the electronic equipment can also carry out embodiment illustrated in fig. 3 offer is being schemed The function of 4 illustrated embodiments, details are not described herein for the embodiment of the present invention.
The embodiment of the present invention also proposed a kind of computer readable storage medium, the computer-readable recording medium storage one A or multiple programs, the one or more program include instruction, which holds when by the electronic equipment including multiple application programs When row, the electronic equipment can be made to execute the side executed in embodiment illustrated in fig. 3 for the automatic test device of application program Method, and be specifically used for executing following operation in control terminal:
Semantic parsing is carried out to the automatic test cases comprising multiple characters, determine operation object character and it is corresponding from Dynamicization test operation;
Using preset at least one method of determination, determined from the current display interface of application program and the operation The target position information that Object Character matches;
In the current display interface, by way of simulated operation, to the target position information execute it is described from Dynamicization test operation.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity, Or it is realized by the product with certain function.It is a kind of typically to realize that equipment is computer.Specifically, computer for example may be used Think personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play It is any in device, navigation equipment, electronic mail equipment, game console, tablet computer, wearable device or these equipment The combination of equipment.
For convenience of description, it is divided into various units when description apparatus above with function to describe respectively.Certainly, implementing this The function of each unit can be realized in the same or multiple software and or hardware when invention.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more, The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces The form of product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM), Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including described want There is also other identical elements in the process, method of element, commodity or equipment.
The present invention can describe in the general context of computer-executable instructions executed by a computer, such as program Module.Generally, program module includes routines performing specific tasks or implementing specific abstract data types, programs, objects, group Part, data structure etc..The present invention can also be practiced in a distributed computing environment, in these distributed computing environments, by Task is executed by the connected remote processing devices of communication network.In a distributed computing environment, program module can be with In the local and remote computer storage media including storage equipment.
Various embodiments are described in a progressive manner in the present invention, same and similar part between each embodiment It may refer to each other, each embodiment focuses on the differences from other embodiments.Implement especially for system For example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to embodiment of the method Part illustrates.
The above description is only an embodiment of the present invention, is not intended to restrict the invention.For those skilled in the art For, the invention may be variously modified and varied.All any modifications made within the spirit and principles of the present invention are equal Replacement, improvement etc., should be included within scope of the presently claimed invention.

Claims (10)

1. a kind of automated testing method for application program characterized by comprising
Semantic parsing is carried out to the automatic test cases comprising multiple characters, determines operation object character and corresponding automation Test operation;
Using preset at least one method of determination, determined from the current display interface of application program and the operation object The target position information that character matches;
In the current display interface, by way of simulated operation, the automation is executed to the target position information Test operation.
2. the method as described in claim 1, which is characterized in that the method also includes:
Determine object properties information corresponding with the operation object character;Then
The target position information to match with the operation object character is determined from the current display interface of application program, is wrapped It includes:
It is determined from the current display interface of application program and the operation object character and the object properties information phase Matched target position information.
3. method according to claim 2, which is characterized in that the object properties information includes azimuth information.
4. method as claimed in claim 3, which is characterized in that determined from the current display interface of application program with it is described The target position information that operation object character matches, comprising:
According to the azimuth information, target display interface is selected from the current display interface of application program;
The target position information to match with the operation object character is determined from the target display interface.
5. the method as described in claim 1, which is characterized in that using preset at least one method of determination, from application program Current display interface in determine the target position information to match with the operation object character, comprising:
Parse application program current display interface in can handle icon control and corresponding location information;
According to the positional information, from the current display interface interception comprising it is described can handle icon control control figure Picture;
Using image classification model, the target widget to match with the test object character is determined from the control image Image, and determine corresponding target position information.
6. the method as described in claim 1, which is characterized in that using preset at least one method of determination, from application program Current display interface in determine the target position information to match with the operation object character, comprising:
It parses in the current display interface of application program and operates text control and corresponding text information and position Information;
According to the text information, the target text information to match with the test object character is determined, and determine pair The target position information answered.
7. the method as described in claim 1, which is characterized in that using preset at least one method of determination, from application program Current display interface in determine the target position information to match with the operation object character, comprising:
Using image recognition model, candidate icon and corresponding candidate are identified in the current display interface of application program Location information;
The candidate icon is matched with the operation object character, determines target icon, and determine corresponding mesh Cursor position information.
8. the method as described in claim 1, which is characterized in that using preset at least one method of determination, from application program Current display interface in determine the target position information to match with the operation object character, comprising:
Character recognition is carried out in the current display interface of application program, obtains candidate characters and corresponding candidate bit confidence Breath;
The candidate text is matched with the operation object character, determines target character, and determine corresponding mesh Cursor position information.
9. the method as described in claim 1, which is characterized in that the method also includes:
The automatic test operation will be executed to the target position information to record.
10. a kind of automatic test device for application program characterized by comprising resolution unit, determination unit, with And test cell, wherein
The resolution unit determines operation object for carrying out semantic parsing to the automatic test cases comprising multiple characters Character and the operation of corresponding automatic test;
The determination unit, for utilizing preset at least one method of determination, from the current display interface of application program really Make the target position information to match with the operation object character;
The test cell, for by way of simulated operation, believing the target position in the current display interface Breath executes the automatic test operation.
CN201910002926.7A 2019-01-02 2019-01-02 A kind of automated testing method and device for application program Pending CN109857645A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910002926.7A CN109857645A (en) 2019-01-02 2019-01-02 A kind of automated testing method and device for application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910002926.7A CN109857645A (en) 2019-01-02 2019-01-02 A kind of automated testing method and device for application program

Publications (1)

Publication Number Publication Date
CN109857645A true CN109857645A (en) 2019-06-07

Family

ID=66893819

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910002926.7A Pending CN109857645A (en) 2019-01-02 2019-01-02 A kind of automated testing method and device for application program

Country Status (1)

Country Link
CN (1) CN109857645A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111291661A (en) * 2020-01-21 2020-06-16 上海悦易网络信息技术有限公司 Method and equipment for identifying text content of icons in screen
CN111767214A (en) * 2020-06-23 2020-10-13 中国工商银行股份有限公司 Automatic testing method and device for software UI
CN112433942A (en) * 2020-11-24 2021-03-02 北京云测信息技术有限公司 Software automation testing method, device and system based on artificial intelligence model
CN112559377A (en) * 2020-12-25 2021-03-26 上海高顿教育科技有限公司 Method and device for generating first test case
CN113656322A (en) * 2021-08-26 2021-11-16 阿里巴巴(中国)有限公司 Data processing method and device, electronic equipment and computer storage medium
CN113806236A (en) * 2021-10-29 2021-12-17 建信金融科技有限责任公司 Method and system for one-machine multi-control of cloud machine in mobile test field

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102135938A (en) * 2011-03-21 2011-07-27 中国工商银行股份有限公司 Software product testing method and system
CN103164300A (en) * 2011-12-13 2013-06-19 腾讯科技(深圳)有限公司 Mobile terminal touch screen automatic testing method and device
CN104252410A (en) * 2013-06-27 2014-12-31 阿里巴巴集团控股有限公司 Method and equipment for testing control in page
US20170277627A1 (en) * 2014-04-08 2017-09-28 Turnkey Solutions Corp. Software test automation system and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102135938A (en) * 2011-03-21 2011-07-27 中国工商银行股份有限公司 Software product testing method and system
CN103164300A (en) * 2011-12-13 2013-06-19 腾讯科技(深圳)有限公司 Mobile terminal touch screen automatic testing method and device
CN104252410A (en) * 2013-06-27 2014-12-31 阿里巴巴集团控股有限公司 Method and equipment for testing control in page
US20170277627A1 (en) * 2014-04-08 2017-09-28 Turnkey Solutions Corp. Software test automation system and method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
YANGAILIN12138: "图像识别与软件自动化测试", 《HTTPS://BLOG.CSDN.NET/ YANGAILIN12138/ARTICLE/DETAILS/78056128》 *
图解AI: "[人工智能]AI移动自动化测试", 《HTTPS://BLOG.CSDN.NET/BAIHUAXIU123/ARTICLE/DETAILS/67639215?UTM_SOURCE=BLOGKPCL8》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111291661A (en) * 2020-01-21 2020-06-16 上海悦易网络信息技术有限公司 Method and equipment for identifying text content of icons in screen
CN111291661B (en) * 2020-01-21 2023-10-27 上海万物新生环保科技集团有限公司 Method and equipment for identifying text content of icon in screen
CN111767214A (en) * 2020-06-23 2020-10-13 中国工商银行股份有限公司 Automatic testing method and device for software UI
CN111767214B (en) * 2020-06-23 2023-08-11 中国工商银行股份有限公司 Automatic testing method and device for software UI
CN112433942A (en) * 2020-11-24 2021-03-02 北京云测信息技术有限公司 Software automation testing method, device and system based on artificial intelligence model
CN112559377A (en) * 2020-12-25 2021-03-26 上海高顿教育科技有限公司 Method and device for generating first test case
CN113656322A (en) * 2021-08-26 2021-11-16 阿里巴巴(中国)有限公司 Data processing method and device, electronic equipment and computer storage medium
CN113656322B (en) * 2021-08-26 2023-10-10 阿里巴巴(中国)有限公司 Data processing method, device, electronic equipment and computer storage medium
CN113806236A (en) * 2021-10-29 2021-12-17 建信金融科技有限责任公司 Method and system for one-machine multi-control of cloud machine in mobile test field
CN113806236B (en) * 2021-10-29 2023-06-09 建信金融科技有限责任公司 Method and system for one-machine multi-control of cloud real machine in mobile test field

Similar Documents

Publication Publication Date Title
CN109857645A (en) A kind of automated testing method and device for application program
CN107168992A (en) Article sorting technique and device, equipment and computer-readable recording medium based on artificial intelligence
CN107993085A (en) Model training method, the user's behavior prediction method and device based on model
CN109344793A (en) Aerial hand-written method, apparatus, equipment and computer readable storage medium for identification
CN109815333A (en) Information acquisition method, device, computer equipment and storage medium
CN104199834A (en) Method and system for interactively obtaining and outputting remote resources on surface of information carrier
CN110968695A (en) Intelligent labeling method, device and platform based on active learning of weak supervision technology
CN109902285B (en) Corpus classification method, corpus classification device, computer equipment and storage medium
CN109299269A (en) A kind of file classification method and device
CN109815955A (en) Topic householder method and system
CN109033772A (en) A kind of input method and device of verification information
CN109902271A (en) Text data mask method, device, terminal and medium based on transfer learning
CN111738016A (en) Multi-intention recognition method and related equipment
CN104346408B (en) A kind of method and apparatus being labeled to the network user
CN110110726A (en) The recognition methods of power equipment nameplate, device, computer equipment and storage medium
CN109388801A (en) The determination method, apparatus and electronic equipment of similar set of words
JP6832322B2 (en) Search device, search method, search program and recording medium
CN113641794A (en) Resume text evaluation method and device and server
CN117290694B (en) Question-answering system evaluation method, device, computing equipment and storage medium
CN110472063A (en) Social media data processing method, model training method and relevant apparatus
CN109978044A (en) The training method and device of training data generation method and device and model
CN111897955B (en) Comment generation method, device, equipment and storage medium based on encoding and decoding
CN110309825A (en) Uighur detection method, system and electronic equipment under a kind of complex background
CN112036843A (en) Flow element positioning method, device, equipment and medium based on RPA and AI
CN115438129A (en) Structured data classification method and device and terminal equipment

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210721

Address after: 100016 no.4301, No.52 Jiuxianqiao hospital, Chaoyang District, Beijing

Applicant after: BEIJING TESTIN INFORMATION TECHNOLOGY Co.,Ltd.

Address before: Room 2016, building 2, No.8, Fenghuang Third Road, Zhongxin Guangzhou Knowledge City, Guangzhou 510260, Guangdong Province

Applicant before: GUANGZHOU TESTIN INFORMATION TECHNOLOGY Co.,Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190607