CN105550114B - Automated testing method, device and mobile terminal - Google Patents

Automated testing method, device and mobile terminal Download PDF

Info

Publication number
CN105550114B
CN105550114B CN201510992909.4A CN201510992909A CN105550114B CN 105550114 B CN105550114 B CN 105550114B CN 201510992909 A CN201510992909 A CN 201510992909A CN 105550114 B CN105550114 B CN 105550114B
Authority
CN
China
Prior art keywords
measured
control object
control
topography
script
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.)
Active
Application number
CN201510992909.4A
Other languages
Chinese (zh)
Other versions
CN105550114A (en
Inventor
李学海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201510992909.4A priority Critical patent/CN105550114B/en
Publication of CN105550114A publication Critical patent/CN105550114A/en
Application granted granted Critical
Publication of CN105550114B publication Critical patent/CN105550114B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

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

Abstract

The present invention proposes a kind of automated testing method, device and mobile terminal, and the automated testing method includes obtaining characteristic attribute and the topography of control object to be measured;According to script corresponding to control object to be measured and topography's generation, the operation for surveying control object is treated with analog subscriber;According to the characteristic attribute of control object to be measured and local framing control object to be measured, and treated according to corresponding script and survey control object progress automatic test.The robustness and versatility of automatic test script can be improved by the present invention, extend automated testing method realizes scope.

Description

Automated testing method, device and mobile terminal
Technical field
The present invention relates to software testing technology field, more particularly to a kind of automated testing method, device and mobile terminal.
Background technology
In the Android intelligent machine epoch that iteration renewal is quick, machine huge-crowd strategy is prevailing, the project cycle is short, test period contracting It is short, determine the active demand to software automated testing.Automated testing method in correlation technique is mainly according to coordinate Or control is clicked on, when adding checkpoint, mainly according to acquisition related control or judge that control property changes.If in software During device version substitutes, control change can reduce automatic test script versatility, so as to influence automatic test effect Rate.
The content of the invention
It is contemplated that at least solves one of technical problem in correlation technique to a certain extent.
Therefore, it is an object of the present invention to propose a kind of automated testing method, it is possible to increase automatic test pin This robustness and versatility, effectively lift automatic test effect.
It is another object of the present invention to propose a kind of automatic test device.
It is another object of the present invention to propose a kind of mobile terminal.
To reach above-mentioned purpose, automated testing method that first aspect present invention embodiment proposes, including:Obtain to be measured The characteristic attribute of control object and topography;The script according to corresponding to generating the control object to be measured and topography, with Operation of the analog subscriber to the control object to be measured;According to the characteristic attribute of the control object to be measured and local framing The control object to be measured, and automatic test is carried out to the control object to be measured according to the corresponding script.
The automated testing method that first aspect present invention embodiment proposes, by the feature category for obtaining control object to be measured Property and topography;According to script corresponding to the control object to be measured and topography's generation, treated with analog subscriber to described Survey the operation of control object;According to control pair to be measured described in the characteristic attribute of the control object to be measured and local framing As, and automatic test is carried out to the control object to be measured according to the corresponding script.
To reach above-mentioned purpose, automatic test device that second aspect of the present invention embodiment proposes, including:Obtain mould Block, for obtaining characteristic attribute and the topography of control object to be measured;Script generation module, for according to the control to be measured Script corresponding to object and topography's generation, with operation of the analog subscriber to the control object to be measured;Test module, it is used for According to control object to be measured described in the characteristic attribute of the control object to be measured and local framing, and according to described corresponding Script carries out automatic test to the control object to be measured.
The automatic test device that second aspect of the present invention embodiment proposes, by the feature category for obtaining control object to be measured Property and topography;According to script corresponding to the control object to be measured and topography's generation, treated with analog subscriber to described Survey the operation of control object;According to control pair to be measured described in the characteristic attribute of the control object to be measured and local framing As, and automatic test is carried out to the control object to be measured according to the corresponding script.
To reach above-mentioned purpose, mobile terminal that third aspect present invention embodiment proposes, including:Housing, processor, deposit Reservoir, circuit board and power circuit, wherein, circuit board is placed in the interior volume that housing surrounds, and processor and memory are set On circuit boards;Power circuit, for each circuit or the device power supply for mobile terminal;Memory is used to store executable journey Sequence code;The executable program code that processor is stored by reading in memory is corresponding with executable program code to run Program, for performing:Obtain characteristic attribute and the topography of control object to be measured;According to the control object drawn game to be measured Script corresponding to portion's image generation, with operation of the analog subscriber to the control object to be measured;According to the control object to be measured Characteristic attribute and local framing described in control object to be measured, and according to the corresponding script to the control pair to be measured As carrying out automatic test.
The mobile terminal that third aspect present invention embodiment proposes, by the characteristic attribute drawn game for obtaining control object to be measured Portion's image;According to script corresponding to the control object to be measured and topography's generation, with analog subscriber to the control to be measured The operation of object;According to control object to be measured described in the characteristic attribute of the control object to be measured and local framing, and root Automatic test is carried out to the control object to be measured according to the corresponding script.
The additional aspect of the present invention and advantage will be set forth in part in the description, and will partly become from the following description Obtain substantially, or recognized by the practice of the present invention.
Brief description of the drawings
Of the invention above-mentioned and/or additional aspect and advantage will become from the following description of the accompanying drawings of embodiments Substantially and it is readily appreciated that, wherein:
Fig. 1 is the schematic flow sheet for the automated testing method that one embodiment of the invention proposes;
Fig. 2 is the schematic flow sheet for the automated testing method that another embodiment of the present invention proposes;
Fig. 3 is the schematic flow sheet for the automated testing method that another embodiment of the present invention proposes;
Fig. 4 is the schematic flow sheet for the automated testing method that another embodiment of the present invention proposes;
Fig. 5 is the schematic flow sheet for the automated testing method that another embodiment of the present invention proposes;
Fig. 6 is the structural representation for the automatic test device that another embodiment of the present invention proposes;
Fig. 7 is the structural representation for the automatic test device that another embodiment of the present invention proposes.
Embodiment
Embodiments of the invention are described below in detail, the example of the embodiment is shown in the drawings, wherein from beginning to end Same or similar label represents same or similar element or the element with same or like function.Below with reference to attached The embodiment of figure description is exemplary, is only used for explaining the present invention, and is not considered as limiting the invention.On the contrary, this All changes that the embodiment of invention includes falling into the range of the spirit and intension of attached claims, modification and equivalent Thing.
Fig. 1 be one embodiment of the invention propose automated testing method schematic flow sheet, the automated testing method Including:
S101:Obtain characteristic attribute and the topography of control object to be measured.
Wherein, control refers to the part of Windows graphical interfaces, can receive the input equipments such as keyboard or mouse Input, so as to complete some specific function.Common control such as button, option button, edit box, list box, scroll bar, And static control etc..
In an embodiment of the present invention, control object to be measured is the control for needing to be tested with automated testing method Part.
In an embodiment of the present invention, the characteristic attribute of control object to be measured can be the control property of control object to be measured In, control features are obvious, are capable of the control property of the unique mark control object to be measured.
The id that the characteristic attribute of control object to be measured can for example include control object to be measured is identified, should for unique mark Control object to be measured;Text is a kind of Doctype of computer, and such document is mainly used in recording and storing text information, and It is not image, sound and format data, can be used for the function of identifying the control object to be measured;Control type, for identifying The species of control object to be measured.
In an embodiment of the present invention, the topography of control object to be measured is the office that is intercepted to the control object to be measured Portion's image, for example, the topography for the control object to be measured being truncated to can be represented with A.
For example, it is assumed that control object to be measured is with the button for returning to previous step, then the id marks of control object can be with For " button ", text can be " return ", and control type can be " button ".
In the Android intelligent machine epoch that iteration renewal is quick, machine huge-crowd strategy is prevailing, the project cycle is short, test period contracting It is short, determine the active demand to software automated testing.Automated testing method in correlation technique is mainly according to coordinate Or control is clicked on, when adding checkpoint, mainly according to acquisition related control or judge that control property changes.If in software During device version substitutes, control change can reduce automatic test script versatility, so as to influence automatic test effect Rate.
Specifically, in an embodiment of the present invention, control to be measured can be selected in the script recording stage of automatic test Object, and obtain all control properties of control object to be measured, it is obvious to choose control features, being capable of the unique mark control to be measured The control property of object further, intercepts the topography of control object to be measured, so as to subsequently automate as characteristic attribute The script playback phase of test can position the control object to be measured by characteristic attribute, or topography.Wherein, recording is During being manually based on some equipment and tested application is operated, recorded automatically by automation tools and operate step Suddenly, the information such as input data.Playback is artificial before being the different equipment automatic reduction of the script testing procedure selection based on recording The process of operation, it is the playback of use-case.
S102:According to script corresponding to control object to be measured and topography's generation, observing and controlling part pair is treated with analog subscriber The operation of elephant.
It is alternatively possible in the script playback phase of automatic test, by running the first script according to priority result Testing procedure and the second script testing procedure, with operation of the analog subscriber to control object to be detected.
Alternatively, it is raw in the script recording stage of automatic test, the operational requirements that control object can be surveyed according to treating Into with control object to be measured and the corresponding script of topography's generation, for example, user can be treated survey control object it is each Individual operating procedure and the control object operated are recorded, and generate script testing procedure, observing and controlling part is treated to analog subscriber The operation of object.
For example, if control object to be measured is button, in the application scenarios of the control button to be measured of reality, user needs Button is clicked on, then generation clicks on button and clicks on the two script testing procedures of topography of button, if control pair to be measured As needing to pull scroll bar for scroll bar, user, then generation pulls scroll bar and pulls the two pin of topography of scroll bar This testing procedure.
Alternatively, the script according to corresponding to control object to be measured and topography's generation, observing and controlling part is treated with analog subscriber The operation of object, including:First script testing procedure corresponding with control object to be measured is generated according to control object to be measured, and The second script testing procedure corresponding with topography is generated according to topography;Control object to be measured is determined according to preset rules With the priority of topography, priority result is obtained;According to the first script testing procedure, the second script testing procedure, and Script corresponding to priority result generation, the operation for surveying control object is treated with analog subscriber.
S103:According to the characteristic attribute of control object to be measured and local framing control object to be measured, and according to corresponding Script treat survey control object carry out automatic test.
In an embodiment of the present invention, control object to be detected is positioned by the characteristic attribute of control object to be detected, Control object to be detected can be positioned by the topography of control object to be detected, or, control to be detected can also be combined The characteristic attribute of object and local framing control object to be detected.
In an embodiment of the present invention, according to the characteristic attribute of control object to be measured and the priority of topography, come true Surely control object to be measured is positioned using suitable mode.
Alternatively, if positioning control object to be detected by the topography of control object to be detected, or, pass through combination When the characteristic attribute of control object to be detected and local framing control object to be detected, the office for surveying control object can be treated Portion's image carries out stencil matching and characteristic point is searched, to position control object to be measured.
For example, in the script playback phase of automatic test, after control object to be measured is navigated to, can by operation with First script testing procedure corresponding to control object to be measured and the second script testing procedure, with analog subscriber to control pair to be detected The operation of elephant, carry out automatic test.
Alternatively, according to the characteristic attribute of control object to be measured and local framing control object to be measured, including:According to The characteristic attribute of control object to be measured, topography, and priority result position control object to be measured.
In the present embodiment, by the script according to corresponding to control object to be measured and topography's generation, with analog subscriber pair The operation of control object to be measured, according to the characteristic attribute of control object to be measured and local framing control object to be measured, and root Treated according to corresponding script and survey control object and carry out automatic test, it is possible to increase the robustness of automatic test script and general Property, extend automated testing method realizes scope.
Fig. 2 be another embodiment of the present invention propose automated testing method schematic flow sheet, the automatic test side Method includes:
S201:Obtain characteristic attribute and the topography of control object to be measured.
Wherein, control refers to the part of Windows graphical interfaces, can receive the input equipments such as keyboard or mouse Input, so as to complete some specific function.Common control such as button, option button, edit box, list box, scroll bar, And static control etc..
In an embodiment of the present invention, control object to be measured is the control for needing to be tested with automated testing method Part.
In an embodiment of the present invention, the characteristic attribute of control object to be measured can be the control property of control object to be measured In, control features are obvious, are capable of the control property of the unique mark control object to be measured.
The id that the characteristic attribute of control object to be measured can for example include control object to be measured is identified, should for unique mark Control object to be measured;Text is a kind of Doctype of computer, and such document is mainly used in recording and storing text information, and It is not image, sound and format data, can be used for the function of identifying the control object to be measured;Control type, for identifying The species of control object to be measured.
In an embodiment of the present invention, the topography of control object to be measured is the office that is intercepted to the control object to be measured Portion's image, for example, the topography for the control object to be measured being truncated to can be represented with A.
For example, it is assumed that control object to be measured is with the button for returning to previous step, then the id marks of control object can be with For " button ", text can be " return ", and control type can be " button ".
In the Android intelligent machine epoch that iteration renewal is quick, machine huge-crowd strategy is prevailing, the project cycle is short, test period contracting It is short, determine the active demand to software automated testing.Automated testing method in correlation technique is mainly according to coordinate Or control is clicked on, when adding checkpoint, mainly according to acquisition related control or judge that control property changes.If in software During device version substitutes, control change can reduce automatic test script versatility, so as to influence automatic test effect Rate.
Specifically, in an embodiment of the present invention, control to be measured can be selected in the script recording stage of automatic test Object, and obtain all control properties of control object to be measured, it is obvious to choose control features, being capable of the unique mark control to be measured The control property of object further, intercepts the topography of control object to be measured, so as to subsequently automate as characteristic attribute The script playback phase of test can position the control object to be measured by characteristic attribute, or topography.
Wherein, recording is during being manually based on some equipment and tested application is operated, and passes through automatic chemical industry The automatic record of tool and the information such as operating procedure, input data.
Playback is that the script testing procedure based on recording selects manually-operated process before different equipment automatic reductions, It is the playback of use-case.
S202:First script testing procedure corresponding with control object to be measured, Yi Jigen are generated according to control object to be measured The second script testing procedure corresponding with topography is generated according to topography.
It is alternatively possible in the script playback phase of automatic test, by running the first script according to priority result Testing procedure and the second script testing procedure, with operation of the analog subscriber to control object to be detected.
Alternatively, it is raw in the script recording stage of automatic test, the operational requirements that control object can be surveyed according to treating Into with control object to be measured and the corresponding script of topography's generation, for example, user can be treated survey control object it is each Individual operating procedure and the control object operated are recorded, and generate script testing procedure, observing and controlling part is treated to analog subscriber The operation of object.
For example, if control object to be measured is button, in the application scenarios of the control button to be measured of reality, user needs Button is clicked on, then generation clicks on button and clicks on the two script testing procedures of topography of button, if control pair to be measured As needing to pull scroll bar for scroll bar, user, then generation pulls scroll bar and pulls the two pin of topography of scroll bar This testing procedure.
S203:Control object to be measured and the priority of topography are determined according to preset rules, obtains priority result.
Wherein, priority result includes that control is preferential, image is preferential, or control and image it is parallel.
In an embodiment of the present invention, preset rules can be:Judge that the characteristic attribute of control object to be detected whether can Enough unique mark control objects to be measured, if the characteristic attribute of control object to be detected being capable of the unique mark control pair to be measured As, it is determined that priority result is that control is preferential, if the characteristic attribute of control object to be detected can not abundant unique mark The control object to be detected, it is determined that priority result is that image is preferential, alternatively, it is also possible to according to automatic test application scenarios Demand determine the priority of control object to be measured and topography, if in the automatic test application scenarios, it is to be detected The picture quality of the topography of control object is higher, and characteristic point is obvious, then can directly determine that priority result is excellent for image First, the present invention is without limitation.
S204:According to the first script testing procedure, the second script testing procedure, and pin corresponding to priority result generation This, the operation for surveying control object is treated with analog subscriber.
Wherein, the first script testing procedure is script testing procedure corresponding with control object to be measured, and the second script is tested Step is script testing procedure corresponding with the topography of control object to be detected.
In an embodiment of the present invention, can be according to the first script testing procedure, the second script testing procedure, and preferentially Script corresponding to level result generation, wherein, the replayed section of corresponding script for example, when priority result is that control is preferential, Perform the first script testing procedure;When priority result is that image is preferential, the second script testing procedure is performed;When priority knot When fruit is control and parallel image, the first script testing procedure is performed, or, perform the second script testing procedure.
S205:Control pair to be measured is positioned according to the characteristic attribute of control object to be measured, topography, and priority result As.
In an embodiment of the present invention, control object to be detected is positioned by the characteristic attribute of control object to be detected, Control object to be detected can be positioned by the topography of control object to be detected, or, control to be detected can also be combined The characteristic attribute of object and local framing control object to be detected.
In an embodiment of the present invention, according to the characteristic attribute of control object to be measured and the priority of topography, come true Surely control object to be measured is positioned using suitable mode.
Alternatively, if positioning control object to be detected by the topography of control object to be detected, or, pass through combination When the characteristic attribute of control object to be detected and local framing control object to be detected, the office for surveying control object can be treated Portion's image carries out stencil matching and characteristic point is searched, to position control object to be measured.
Alternatively, as shown in figure 3, Fig. 3 is the flow signal for the automated testing method that another embodiment of the present invention proposes Figure, in step S205, can also include:
S301:Judge whether priority result is that control is preferential.
In an embodiment of the present invention, under the application scenarios of the control object to be measured of reality, can first determine whether to be checked The priority result of control object is surveyed, if priority result is that control is preferential, that is, shows the feature category of control object to be detected The enough unique marks of performance control object to be measured, then triggering performs step S302, can if priority result is not preferential for control To determine whether priority result is other optional priority.
S302:If priority result is that control is preferential, observing and controlling is treated according to the positioning of the characteristic attribute of control object to be measured Part object.
In an embodiment of the present invention, if priority result is that control is preferential, actual control object to be measured is obtained Application scenarios in, obtain the whole control objects and whole of (application scenarios are for example, system interface) in whole application scenarios The control features of control object, with the characteristic attribute of the control object to be detected of the script recording stage of automatic test, with obtaining The control features for the whole control objects got are compared one by one, to navigate to control to be detected in application scenarios.
In the present embodiment, by when priority result is that control is preferential, being determined according to the characteristic attribute of control object to be measured Position control object to be measured so that control to be detected topography can not fully unique mark control object to be detected when, Control object to be measured can be positioned by characteristic attribute, is effectively ensured what script in the playback phase of automatic test script positioned Accuracy, lift automatic test effect.
Alternatively, as shown in figure 4, Fig. 4 is the flow signal for the automated testing method that another embodiment of the present invention proposes Figure, in step S205, can also include:
S401:Judge whether priority result is that image is preferential.
In an embodiment of the present invention, under the application scenarios of the control object to be measured of reality, can first determine whether to be checked The priority result of control object is surveyed, if priority result is that image is preferential, that is, shows the Local map of control object to be detected As can unique mark control object to be measured, then triggering perform step S402, if priority result for image it is preferential, can To determine whether priority result is other optional priority.
S402:If priority result is that image is preferential, observing and controlling is treated according to the positioning of the topography of control object to be measured Part object.
In an embodiment of the present invention, if priority result is that image is preferential, actual control object to be measured is obtained Application scenarios in, the screen picture B of equipment where intercepting whole application scenarios, with the script recording stage of automatic test The topography A and screen picture B of control object to be detected carry out images match, to position control object to be measured.
Alternatively, control object to be measured is positioned according to the topography of control object to be measured, including:Treat survey control object Topography carry out stencil matching and characteristic point and search, to position control object to be measured.
Wherein, template matches are using the screen picture B upper left corner as starting point, set the size one with topography A The matching frame C of cause, matching frame C to the right or is moved down on screen picture B with this, obtain the screen outlined in matching frame C Curtain image B topography B ', wherein, topography B ' be image sequence, contrast topography A with it is every in topography B ' The similarity of each pixel of individual topography, the maximum topography of the final similarity for obtaining pixel in topography B ' Control object in A ', the topography A ' of the similarity maximum of this pixel, as needs the control object to be measured positioned.
Feature Points Matching is to extract topography A and screen picture B characteristic point, wherein, characteristic point such as gray scale, or Position, the similarity of each characteristic point in topography A and screen picture B is contrasted, multiple characteristic points are similar when having, and similar Coordinate value is in error range corresponding to characteristic point, then it represents that there is the image similar to topography A in screen picture B, will The control object to be measured that the control that the image similar to topography A is outlined in screen picture B positions as needs.
In the present embodiment, by when priority result is that image is preferential, being determined according to the topography of control object to be measured Position control object to be measured so that control to be detected characteristic attribute can not fully unique mark control object to be detected when, Control object to be measured can be positioned by topography, is effectively ensured what script in the playback phase of automatic test script positioned Accuracy, lift automatic test effect.
Alternatively, as shown in figure 5, Fig. 5 is the flow signal for the automated testing method that another embodiment of the present invention proposes Figure, in step S205, can also include:
S501:Judge whether priority result is that control and image are parallel.
In an embodiment of the present invention, under the application scenarios of the control object to be measured of reality, can first determine whether to be checked The priority result of control object is surveyed, if priority result is that control and image are parallel, that is, shows control object to be detected Characteristic attribute and topography can unique mark control object to be measured, then triggering performs step S502, if priority knot Fruit is not parallel for control and image, then can determine whether priority result is other optional priority.
S502:If priority result is that control and image are parallel, according to the characteristic attribute of control object to be measured, or Topography positions control object to be measured.
In an embodiment of the present invention, if priority result is that control and image are parallel, can be treated according to reality The demand of the application scenarios of control object is surveyed, to select the characteristic attribute according to control object to be measured, or, topography's positioning Control object to be measured.
In the present embodiment, by when priority result is control and parallel image, according to the control object to be measured of reality Application scenarios demand, to select the characteristic attribute according to control object to be measured, or, topography positions control pair to be measured As effectively lifting the applicability of automated testing method, by the matching of binding characteristic attribute and the matching of topography, can carry Scope is realized in the versatility of high test script, extension automation.
S206:Treated according to corresponding script and survey control object progress automatic test.
For example, in the script playback phase of automatic test, after control object to be measured is navigated to, can by operation with First script testing procedure corresponding to control object to be measured and the second script testing procedure, with analog subscriber to control pair to be detected The operation of elephant, carry out automatic test.
In the present embodiment, by determining suitable positioning strategy according to the priority result of control to be detected, lifting is automatically Change the accuracy and compatibility of control object positioning to be detected during test script playback.By according to control object to be measured and part Script corresponding to image generation, the operation for surveying control object is treated with analog subscriber, according to the characteristic attribute of control object to be measured With local framing control object to be measured, and according to corresponding script treat survey control object carry out automatic test, can The robustness and versatility of automatic test script are improved, extend automated testing method realizes scope.
Fig. 6 is the structural representation for the automatic test device that another embodiment of the present invention proposes, the automatic test fills Putting 60 includes acquisition module 601, for obtaining characteristic attribute and the topography of control object to be measured;Script generation module 602, For the script according to corresponding to control object to be measured and topography's generation, the operation for surveying control object is treated with analog subscriber; Test module 603, for the characteristic attribute according to control object to be measured and local framing control object to be measured, and according to right The script answered, which is treated, surveys control object progress automatic test.
Acquisition module 601, for obtaining characteristic attribute and the topography of control object to be measured.
Wherein, control refers to the part of Windows graphical interfaces, can receive the input equipments such as keyboard or mouse Input, so as to complete some specific function.Common control such as button, option button, edit box, list box, scroll bar, And static control etc..
In an embodiment of the present invention, control object to be measured is the control for needing to be tested with automated testing method Part.
In an embodiment of the present invention, the characteristic attribute of control object to be measured can be the control property of control object to be measured In, control features are obvious, are capable of the control property of the unique mark control object to be measured.
The id that the characteristic attribute of control object to be measured can for example include control object to be measured is identified, should for unique mark Control object to be measured;Text is a kind of Doctype of computer, and such document is mainly used in recording and storing text information, and It is not image, sound and format data, can be used for the function of identifying the control object to be measured;Control type, for identifying The species of control object to be measured.
In an embodiment of the present invention, the topography of control object to be measured is the office that is intercepted to the control object to be measured Portion's image, for example, the topography for the control object to be measured being truncated to can be represented with A.
For example, it is assumed that control object to be measured is with the button for returning to previous step, then the id marks of control object can be with For " button ", text can be " return ", and control type can be " button ".
In the Android intelligent machine epoch that iteration renewal is quick, machine huge-crowd strategy is prevailing, the project cycle is short, test period contracting It is short, determine the active demand to software automated testing.Automated testing method in correlation technique is mainly according to coordinate Or control is clicked on, when adding checkpoint, mainly according to acquisition related control or judge that control property changes.If in software During device version substitutes, control change can reduce automatic test script versatility, so as to influence automatic test effect Rate.
Specifically, in an embodiment of the present invention, control to be measured can be selected in the script recording stage of automatic test Object, and obtain all control properties of control object to be measured, it is obvious to choose control features, being capable of the unique mark control to be measured The control property of object further, intercepts the topography of control object to be measured, so as to subsequently automate as characteristic attribute The script playback phase of test can position the control object to be measured by characteristic attribute, or topography.Wherein, recording is During being manually based on some equipment and tested application is operated, recorded automatically by automation tools and operate step Suddenly, the information such as input data.
Playback is that the script testing procedure based on recording selects manually-operated process before different equipment automatic reductions, It is the playback of use-case.
Script generation module 602, for the script according to corresponding to control object to be measured and topography's generation, to simulate use Treat the operation for surveying control object in family.
It is alternatively possible in the script playback phase of automatic test, by running the first script according to priority result Testing procedure and the second script testing procedure, with operation of the analog subscriber to control object to be detected.
Alternatively, it is raw in the script recording stage of automatic test, the operational requirements that control object can be surveyed according to treating Into with control object to be measured and the corresponding script of topography's generation, for example, user can be treated survey control object it is each Individual operating procedure and the control object operated are recorded, and generate script testing procedure, observing and controlling part is treated to analog subscriber The operation of object.
For example, if control object to be measured is button, in the application scenarios of the control button to be measured of reality, user needs Button is clicked on, then generation clicks on button and clicks on the two script testing procedures of topography of button, if control pair to be measured As needing to pull scroll bar for scroll bar, user, then generation pulls scroll bar and pulls the two pin of topography of scroll bar This testing procedure.
Alternatively, as shown in fig. 7, script generation module 602 includes:
Testing procedure generates submodule 6021, for according to control object to be measured generation corresponding with control object to be measured the One script testing procedure, and the second script testing procedure corresponding with topography is generated according to topography.
It is alternatively possible in the script playback phase of automatic test, by running the first script according to priority result Testing procedure and the second script testing procedure, with operation of the analog subscriber to control object to be detected.
Alternatively, it is raw in the script recording stage of automatic test, the operational requirements that control object can be surveyed according to treating Into with control object to be measured and the corresponding script of topography's generation, for example, user can be treated survey control object it is each Individual operating procedure and the control object operated are recorded, and generate script testing procedure, observing and controlling part is treated to analog subscriber The operation of object.
For example, if control object to be measured is button, in the application scenarios of the control button to be measured of reality, user needs Button is clicked on, then generation clicks on button and clicks on the two script testing procedures of topography of button, if control pair to be measured As needing to pull scroll bar for scroll bar, user, then generation pulls scroll bar and pulls the two pin of topography of scroll bar This testing procedure.
Priority result acquisition submodule 6022, for determining control object to be measured and topography according to preset rules Priority, obtain priority result.
Wherein, priority result includes that control is preferential, image is preferential, or control and image it is parallel.
In an embodiment of the present invention, preset rules can be:Judge that the characteristic attribute of control object to be detected whether can Enough unique mark control objects to be measured, if the characteristic attribute of control object to be detected being capable of the unique mark control pair to be measured As, it is determined that priority result is that control is preferential, if the characteristic attribute of control object to be detected can not abundant unique mark The control object to be detected, it is determined that priority result is that image is preferential, alternatively, it is also possible to according to automatic test application scenarios Demand determine the priority of control object to be measured and topography, if in the automatic test application scenarios, it is to be detected The picture quality of the topography of control object is higher, and characteristic point is obvious, then can directly determine that priority result is excellent for image First, the present invention is without limitation.
Script generates submodule 6023, for according to the first script testing procedure, the second script testing procedure, and preferentially Script corresponding to level result generation, the operation for surveying control object is treated with analog subscriber.
Wherein, the first script testing procedure is script testing procedure corresponding with control object to be measured, and the second script is tested Step is script testing procedure corresponding with the topography of control object to be detected.
In an embodiment of the present invention, can be according to the first script testing procedure, the second script testing procedure, and preferentially Script corresponding to level result generation, wherein, the replayed section of corresponding script for example, when priority result is that control is preferential, Perform the first script testing procedure;When priority result is that image is preferential, the second script testing procedure is performed;When priority knot When fruit is control and parallel image, the first script testing procedure is performed, or, perform the second script testing procedure.
Test module 603, for the characteristic attribute according to control object to be measured and local framing control object to be measured, And treated according to corresponding script and survey control object progress automatic test.
In an embodiment of the present invention, control object to be detected is positioned by the characteristic attribute of control object to be detected, Control object to be detected can be positioned by the topography of control object to be detected, or, control to be detected can also be combined The characteristic attribute of object and local framing control object to be detected.
In an embodiment of the present invention, according to the characteristic attribute of control object to be measured and the priority of topography, come true Surely control object to be measured is positioned using suitable mode.
Alternatively, if positioning control object to be detected by the topography of control object to be detected, or, pass through combination When the characteristic attribute of control object to be detected and local framing control object to be detected, the office for surveying control object can be treated Portion's image carries out stencil matching and characteristic point is searched, to position control object to be measured.
For example, in the script playback phase of automatic test, after control object to be measured is navigated to, can by operation with First script testing procedure corresponding to control object to be measured and the second script testing procedure, with analog subscriber to control pair to be detected The operation of elephant, carry out automatic test.
Alternatively, test module 603 is specifically used for:According to the characteristic attribute of control object to be measured, topography, Yi Jiyou First level result positions control object to be measured.
Alternatively, priority result include control it is preferential, test module 603 also particularly useful for:Judging priority result is No is that control is preferential;If priority result is that control is preferential, observing and controlling is treated according to the positioning of the characteristic attribute of control object to be measured Part object.
In an embodiment of the present invention, if priority result is that control is preferential, actual control object to be measured is obtained Application scenarios in, obtain the whole control objects and whole of (application scenarios are for example, system interface) in whole application scenarios The control features of control object, with the characteristic attribute of the control object to be detected of the script recording stage of automatic test, with obtaining The control features for the whole control objects got are compared one by one, to navigate to control to be detected in application scenarios.
In the present embodiment, by when priority result is that control is preferential, being determined according to the characteristic attribute of control object to be measured Position control object to be measured so that control to be detected topography can not fully unique mark control object to be detected when, Control object to be measured can be positioned by characteristic attribute, is effectively ensured what script in the playback phase of automatic test script positioned Accuracy, lift automatic test effect.
Alternatively, priority result is also preferential including image, and test module 603 is further specifically used for:Judge priority As a result whether it is that image is preferential;If priority result is that image is preferential, positioned according to the topography of control object to be measured Control object to be measured.
In an embodiment of the present invention, if priority result is that image is preferential, actual control object to be measured is obtained Application scenarios in, the screen picture B of equipment where intercepting whole application scenarios, with the script recording stage of automatic test The topography A and screen picture B of control object to be detected carry out images match, to position control object to be measured.
Alternatively, control object to be measured is positioned according to the topography of control object to be measured, including:Treat survey control object Topography carry out stencil matching and characteristic point and search, to position control object to be measured.
Wherein, template matches are using the screen picture B upper left corner as starting point, set the size one with topography A The matching frame C of cause, matching frame C to the right or is moved down on screen picture B with this, obtain the screen outlined in matching frame C Curtain image B topography B ', wherein, topography B ' be image sequence, contrast topography A with it is every in topography B ' The similarity of each pixel of individual topography, the maximum topography of the final similarity for obtaining pixel in topography B ' Control object in A ', the topography A ' of the similarity maximum of this pixel, as needs the control object to be measured positioned.
Feature Points Matching is to extract topography A and screen picture B characteristic point, wherein, characteristic point such as gray scale, or Position, the similarity of each characteristic point in topography A and screen picture B is contrasted, multiple characteristic points are similar when having, and similar Coordinate value is in error range corresponding to characteristic point, then it represents that there is the image similar to topography A in screen picture B, will The control object to be measured that the control that the image similar to topography A is outlined in screen picture B positions as needs.
In the present embodiment, by when priority result is that image is preferential, being determined according to the topography of control object to be measured Position control object to be measured so that control to be detected characteristic attribute can not fully unique mark control object to be detected when, Control object to be measured can be positioned by topography, is effectively ensured what script in the playback phase of automatic test script positioned Accuracy, lift automatic test effect.
Alternatively, priority result includes control and image is parallel, and test module 603 is further specifically used for:Judge excellent Whether first level result is that control and image are parallel;If priority result is that control and image are parallel, according to control pair to be measured The characteristic attribute of elephant, or topography position control object to be measured.
In an embodiment of the present invention, if priority result is that control and image are parallel, can be treated according to reality The demand of the application scenarios of control object is surveyed, to select the characteristic attribute according to control object to be measured, or, topography's positioning Control object to be measured.
In the present embodiment, by when priority result is control and parallel image, according to the control object to be measured of reality Application scenarios demand, to select the characteristic attribute according to control object to be measured, or, topography positions control pair to be measured As effectively lifting the applicability of automated testing method, by the matching of binding characteristic attribute and the matching of topography, can carry Scope is realized in the versatility of high test script, extension automation.
Alternatively, test module 603 is further specifically used for:Treat the topography's progress stencil matching for surveying control object Searched with characteristic point, to position control object to be measured.
In the present embodiment, by the script according to corresponding to control object to be measured and topography's generation, with analog subscriber pair The operation of control object to be measured, according to the characteristic attribute of control object to be measured and local framing control object to be measured, and root Treated according to corresponding script and survey control object and carry out automatic test, it is possible to increase the robustness of automatic test script and general Property, extend automated testing method realizes scope.
The embodiment of the present invention additionally provides a kind of mobile terminal, and the mobile terminal includes housing, processor, memory, electricity Road plate and power circuit, wherein, circuit board is placed in the interior volume that housing surrounds, and processor and memory are arranged on circuit board On;Power circuit, for each circuit or the device power supply for mobile terminal;Memory is used to store executable program code; The executable program code that processor is stored by reading in memory runs program corresponding with executable program code, with For performing:
S101’:Obtain characteristic attribute and the topography of control object to be measured.
Wherein, control refers to the part of Windows graphical interfaces, can receive the input equipments such as keyboard or mouse Input, so as to complete some specific function.Common control such as button, option button, edit box, list box, scroll bar, And static control etc..
In an embodiment of the present invention, control object to be measured is the control for needing to be tested with automated testing method Part.
In an embodiment of the present invention, the characteristic attribute of control object to be measured can be the control property of control object to be measured In, control features are obvious, are capable of the control property of the unique mark control object to be measured.
The id that the characteristic attribute of control object to be measured can for example include control object to be measured is identified, should for unique mark Control object to be measured;Text is a kind of Doctype of computer, and such document is mainly used in recording and storing text information, and It is not image, sound and format data, can be used for the function of identifying the control object to be measured;Control type, for identifying The species of control object to be measured.
In an embodiment of the present invention, the topography of control object to be measured is the office that is intercepted to the control object to be measured Portion's image, for example, the topography for the control object to be measured being truncated to can be represented with A.
For example, it is assumed that control object to be measured is with the button for returning to previous step, then the id marks of control object can be with For " button ", text can be " return ", and control type can be " button ".
In the Android intelligent machine epoch that iteration renewal is quick, machine huge-crowd strategy is prevailing, the project cycle is short, test period contracting It is short, determine the active demand to software automated testing.Automated testing method in correlation technique is mainly according to coordinate Or control is clicked on, when adding checkpoint, mainly according to acquisition related control or judge that control property changes.If in software During device version substitutes, control change can reduce automatic test script versatility, so as to influence automatic test effect Rate.
Specifically, in an embodiment of the present invention, control to be measured can be selected in the script recording stage of automatic test Object, and obtain all control properties of control object to be measured, it is obvious to choose control features, being capable of the unique mark control to be measured The control property of object further, intercepts the topography of control object to be measured, so as to subsequently automate as characteristic attribute The script playback phase of test can position the control object to be measured by characteristic attribute, or topography.Wherein, recording is During being manually based on some equipment and tested application is operated, recorded automatically by automation tools and operate step Suddenly, the information such as input data.Playback is artificial before being the different equipment automatic reduction of the script testing procedure selection based on recording The process of operation, it is the playback of use-case.
S102’:According to script corresponding to control object to be measured and topography's generation, observing and controlling part pair is treated with analog subscriber The operation of elephant.
It is alternatively possible in the script playback phase of automatic test, by running the first script according to priority result Testing procedure and the second script testing procedure, with operation of the analog subscriber to control object to be detected.
Alternatively, it is raw in the script recording stage of automatic test, the operational requirements that control object can be surveyed according to treating Into with control object to be measured and the corresponding script of topography's generation, for example, user can be treated survey control object it is each Individual operating procedure and the control object operated are recorded, and generate script testing procedure, observing and controlling part is treated to analog subscriber The operation of object.
For example, if control object to be measured is button, in the application scenarios of the control button to be measured of reality, user needs Button is clicked on, then generation clicks on button and clicks on the two script testing procedures of topography of button, if control pair to be measured As needing to pull scroll bar for scroll bar, user, then generation pulls scroll bar and pulls the two pin of topography of scroll bar This testing procedure.
Alternatively, the script according to corresponding to control object to be measured and topography's generation, observing and controlling part is treated with analog subscriber The operation of object, including:First script testing procedure corresponding with control object to be measured is generated according to control object to be measured, and The second script testing procedure corresponding with topography is generated according to topography;Control object to be measured is determined according to preset rules With the priority of topography, priority result is obtained;According to the first script testing procedure, the second script testing procedure, and Script corresponding to priority result generation, the operation for surveying control object is treated with analog subscriber.
S103’:According to the characteristic attribute of control object to be measured and local framing control object to be measured, and according to corresponding Script treat survey control object carry out automatic test.
In an embodiment of the present invention, control object to be detected is positioned by the characteristic attribute of control object to be detected, Control object to be detected can be positioned by the topography of control object to be detected, or, control to be detected can also be combined The characteristic attribute of object and local framing control object to be detected.
In an embodiment of the present invention, according to the characteristic attribute of control object to be measured and the priority of topography, come true Surely control object to be measured is positioned using suitable mode.
Alternatively, if positioning control object to be detected by the topography of control object to be detected, or, pass through combination When the characteristic attribute of control object to be detected and local framing control object to be detected, the office for surveying control object can be treated Portion's image carries out stencil matching and characteristic point is searched, to position control object to be measured.
For example, in the script playback phase of automatic test, after control object to be measured is navigated to, can by operation with First script testing procedure corresponding to control object to be measured and the second script testing procedure, with analog subscriber to control pair to be detected The operation of elephant, carry out automatic test.
Alternatively, according to the characteristic attribute of control object to be measured and local framing control object to be measured, including:According to The characteristic attribute of control object to be measured, topography, and priority result position control object to be measured.
In the present embodiment, by the script according to corresponding to control object to be measured and topography's generation, with analog subscriber pair The operation of control object to be measured, according to the characteristic attribute of control object to be measured and local framing control object to be measured, and root Treated according to corresponding script and survey control object and carry out automatic test, it is possible to increase the robustness of automatic test script and general Property, extend automated testing method realizes scope.
In another embodiment, executable program code that processor is stored by reading in memory runs and can perform Program corresponding to program code, for performing:
S201’:Obtain characteristic attribute and the topography of control object to be measured.
Wherein, control refers to the part of Windows graphical interfaces, can receive the input equipments such as keyboard or mouse Input, so as to complete some specific function.Common control such as button, option button, edit box, list box, scroll bar, And static control etc..
In an embodiment of the present invention, control object to be measured is the control for needing to be tested with automated testing method Part.
In an embodiment of the present invention, the characteristic attribute of control object to be measured can be the control property of control object to be measured In, control features are obvious, are capable of the control property of the unique mark control object to be measured.
The id that the characteristic attribute of control object to be measured can for example include control object to be measured is identified, should for unique mark Control object to be measured;Text is a kind of Doctype of computer, and such document is mainly used in recording and storing text information, and It is not image, sound and format data, can be used for the function of identifying the control object to be measured;Control type, for identifying The species of control object to be measured.
In an embodiment of the present invention, the topography of control object to be measured is the office that is intercepted to the control object to be measured Portion's image, for example, the topography for the control object to be measured being truncated to can be represented with A.
For example, it is assumed that control object to be measured is with the button for returning to previous step, then the id marks of control object can be with For " button ", text can be " return ", and control type can be " button ".
In the Android intelligent machine epoch that iteration renewal is quick, machine huge-crowd strategy is prevailing, the project cycle is short, test period contracting It is short, determine the active demand to software automated testing.Automated testing method in correlation technique is mainly according to coordinate Or control is clicked on, when adding checkpoint, mainly according to acquisition related control or judge that control property changes.If in software During device version substitutes, control change can reduce automatic test script versatility, so as to influence automatic test effect Rate.
Specifically, in an embodiment of the present invention, control to be measured can be selected in the script recording stage of automatic test Object, and obtain all control properties of control object to be measured, it is obvious to choose control features, being capable of the unique mark control to be measured The control property of object further, intercepts the topography of control object to be measured, so as to subsequently automate as characteristic attribute The script playback phase of test can position the control object to be measured by characteristic attribute, or topography.
Wherein, recording is during being manually based on some equipment and tested application is operated, and passes through automatic chemical industry The automatic record of tool and the information such as operating procedure, input data.
Playback is that the script testing procedure based on recording selects manually-operated process before different equipment automatic reductions, It is the playback of use-case.
S202’:First script testing procedure corresponding with control object to be measured, Yi Jigen are generated according to control object to be measured The second script testing procedure corresponding with topography is generated according to topography.
It is alternatively possible in the script playback phase of automatic test, by running the first script according to priority result Testing procedure and the second script testing procedure, with operation of the analog subscriber to control object to be detected.
Alternatively, it is raw in the script recording stage of automatic test, the operational requirements that control object can be surveyed according to treating Into with control object to be measured and the corresponding script of topography's generation, for example, user can be treated survey control object it is each Individual operating procedure and the control object operated are recorded, and generate script testing procedure, observing and controlling part is treated to analog subscriber The operation of object.
For example, if control object to be measured is button, in the application scenarios of the control button to be measured of reality, user needs Button is clicked on, then generation clicks on button and clicks on the two script testing procedures of topography of button, if control pair to be measured As needing to pull scroll bar for scroll bar, user, then generation pulls scroll bar and pulls the two pin of topography of scroll bar This testing procedure.
S203’:Control object to be measured and the priority of topography are determined according to preset rules, obtains priority result.
Wherein, priority result includes that control is preferential, image is preferential, or control and image it is parallel.
In an embodiment of the present invention, preset rules can be:Judge that the characteristic attribute of control object to be detected whether can Enough unique mark control objects to be measured, if the characteristic attribute of control object to be detected being capable of the unique mark control pair to be measured As, it is determined that priority result is that control is preferential, if the characteristic attribute of control object to be detected can not abundant unique mark The control object to be detected, it is determined that priority result is that image is preferential, alternatively, it is also possible to according to automatic test application scenarios Demand determine the priority of control object to be measured and topography, if in the automatic test application scenarios, it is to be detected The picture quality of the topography of control object is higher, and characteristic point is obvious, then can directly determine that priority result is excellent for image First, the present invention is without limitation.
S204’:According to the first script testing procedure, the second script testing procedure, and corresponding to priority result generation Script, the operation for surveying control object is treated with analog subscriber.
Wherein, the first script testing procedure is script testing procedure corresponding with control object to be measured, and the second script is tested Step is script testing procedure corresponding with the topography of control object to be detected.
In an embodiment of the present invention, can be according to the first script testing procedure, the second script testing procedure, and preferentially Script corresponding to level result generation, wherein, the replayed section of corresponding script for example, when priority result is that control is preferential, Perform the first script testing procedure;When priority result is that image is preferential, the second script testing procedure is performed;When priority knot When fruit is control and parallel image, the first script testing procedure is performed, or, perform the second script testing procedure.
S205’:Control to be measured is positioned according to the characteristic attribute of control object to be measured, topography, and priority result Object.
In an embodiment of the present invention, control object to be detected is positioned by the characteristic attribute of control object to be detected, Control object to be detected can be positioned by the topography of control object to be detected, or, control to be detected can also be combined The characteristic attribute of object and local framing control object to be detected.
In an embodiment of the present invention, according to the characteristic attribute of control object to be measured and the priority of topography, come true Surely control object to be measured is positioned using suitable mode.
Alternatively, if positioning control object to be detected by the topography of control object to be detected, or, pass through combination When the characteristic attribute of control object to be detected and local framing control object to be detected, the office for surveying control object can be treated Portion's image carries out stencil matching and characteristic point is searched, to position control object to be measured.
In another embodiment, executable program code that processor is stored by reading in memory runs and can perform Program corresponding to program code, for performing:
S301’:Judge whether priority result is that control is preferential.
In an embodiment of the present invention, under the application scenarios of the control object to be measured of reality, can first determine whether to be checked The priority result of control object is surveyed, if priority result is that control is preferential, that is, shows the feature category of control object to be detected The enough unique marks of performance control object to be measured, then triggering performs step S302 ', if priority result is not preferential for control, It can determine whether priority result is other optional priority.
S302’:If priority result is that control is preferential, observing and controlling is treated according to the positioning of the characteristic attribute of control object to be measured Part object.
In an embodiment of the present invention, if priority result is that control is preferential, actual control object to be measured is obtained Application scenarios in, obtain the whole control objects and whole of (application scenarios are for example, system interface) in whole application scenarios The control features of control object, with the characteristic attribute of the control object to be detected of the script recording stage of automatic test, with obtaining The control features for the whole control objects got are compared one by one, to navigate to control to be detected in application scenarios.
In the present embodiment, by when priority result is that control is preferential, being determined according to the characteristic attribute of control object to be measured Position control object to be measured so that control to be detected topography can not fully unique mark control object to be detected when, Control object to be measured can be positioned by characteristic attribute, is effectively ensured what script in the playback phase of automatic test script positioned Accuracy, lift automatic test effect.
In another embodiment, executable program code that processor is stored by reading in memory runs and can perform Program corresponding to program code, for performing:
S401’:Judge whether priority result is that image is preferential.
In an embodiment of the present invention, under the application scenarios of the control object to be measured of reality, can first determine whether to be checked The priority result of control object is surveyed, if priority result is that image is preferential, that is, shows the Local map of control object to be detected As can unique mark control object to be measured, then triggering perform step S402 ', if priority result for image it is preferential, It can determine whether priority result is other optional priority.
S402’:If priority result is that image is preferential, observing and controlling is treated according to the positioning of the topography of control object to be measured Part object.
In an embodiment of the present invention, if priority result is that image is preferential, actual control object to be measured is obtained Application scenarios in, the screen picture B of equipment where intercepting whole application scenarios, with the script recording stage of automatic test The topography A and screen picture B of control object to be detected carry out images match, to position control object to be measured.
Alternatively, control object to be measured is positioned according to the topography of control object to be measured, including:Treat survey control object Topography carry out stencil matching and characteristic point and search, to position control object to be measured.
Wherein, template matches are using the screen picture B upper left corner as starting point, set the size one with topography A The matching frame C of cause, matching frame C to the right or is moved down on screen picture B with this, obtain the screen outlined in matching frame C Curtain image B topography B ', wherein, topography B ' be image sequence, contrast topography A with it is every in topography B ' The similarity of each pixel of individual topography, the maximum topography of the final similarity for obtaining pixel in topography B ' Control object in A ', the topography A ' of the similarity maximum of this pixel, as needs the control object to be measured positioned.
Feature Points Matching is to extract topography A and screen picture B characteristic point, wherein, characteristic point such as gray scale, or Position, the similarity of each characteristic point in topography A and screen picture B is contrasted, multiple characteristic points are similar when having, and similar Coordinate value is in error range corresponding to characteristic point, then it represents that there is the image similar to topography A in screen picture B, will The control object to be measured that the control that the image similar to topography A is outlined in screen picture B positions as needs.
In the present embodiment, by when priority result is that image is preferential, being determined according to the topography of control object to be measured Position control object to be measured so that control to be detected characteristic attribute can not fully unique mark control object to be detected when, Control object to be measured can be positioned by topography, is effectively ensured what script in the playback phase of automatic test script positioned Accuracy, lift automatic test effect.
In another embodiment, executable program code that processor is stored by reading in memory runs and can perform Program corresponding to program code, for performing:
S501’:Judge whether priority result is that control and image are parallel.
In an embodiment of the present invention, under the application scenarios of the control object to be measured of reality, can first determine whether to be checked The priority result of control object is surveyed, if priority result is that control and image are parallel, that is, shows control object to be detected Characteristic attribute and topography can unique mark control object to be measured, then triggering performs step S502 ', if priority knot Fruit is not parallel for control and image, then can determine whether priority result is other optional priority.
S502’:If priority result is that control and image are parallel, according to the characteristic attribute of control object to be measured, or Person topography positions control object to be measured.
In an embodiment of the present invention, if priority result is that control and image are parallel, can be treated according to reality The demand of the application scenarios of control object is surveyed, to select the characteristic attribute according to control object to be measured, or, topography's positioning Control object to be measured.
In the present embodiment, by when priority result is control and parallel image, according to the control object to be measured of reality Application scenarios demand, to select the characteristic attribute according to control object to be measured, or, topography positions control pair to be measured As effectively lifting the applicability of automated testing method, by the matching of binding characteristic attribute and the matching of topography, can carry Scope is realized in the versatility of high test script, extension automation.
S206’:Treated according to corresponding script and survey control object progress automatic test.
For example, in the script playback phase of automatic test, after control object to be measured is navigated to, can by operation with First script testing procedure corresponding to control object to be measured and the second script testing procedure, with analog subscriber to control pair to be detected The operation of elephant, carry out automatic test.
In the present embodiment, by determining suitable positioning strategy according to the priority result of control to be detected, lifting is automatically Change the accuracy and compatibility of control object positioning to be detected during test script playback.By according to control object to be measured and part Script corresponding to image generation, the operation for surveying control object is treated with analog subscriber, according to the characteristic attribute of control object to be measured With local framing control object to be measured, and according to corresponding script treat survey control object carry out automatic test, can The robustness and versatility of automatic test script are improved, extend automated testing method realizes scope.
It should be noted that in the description of the invention, term " first ", " second " etc. are only used for describing purpose, without It is understood that to indicate or implying relative importance.In addition, in the description of the invention, unless otherwise indicated, the implication of " multiple " It is two or more.
Any process or method described otherwise above description in flow chart or herein is construed as, and represents to include Module, fragment or the portion of the code of the executable instruction of one or more the step of being used to realize specific logical function or process Point, and the scope of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discuss suitable Sequence, including according to involved function by it is basic simultaneously in the way of or in the opposite order, carry out perform function, this should be of the invention Embodiment person of ordinary skill in the field understood.
It should be appreciated that each several part of the present invention can be realized with hardware, software, firmware or combinations thereof.Above-mentioned In embodiment, software that multiple steps or method can be performed in memory and by suitable instruction execution system with storage Or firmware is realized.If, and in another embodiment, can be with well known in the art for example, realized with hardware Any one of row technology or their combination are realized:With the logic gates for realizing logic function to data-signal Discrete logic, have suitable combinational logic gate circuit application specific integrated circuit, programmable gate array (PGA), scene Programmable gate array (FPGA) etc..
Those skilled in the art are appreciated that to realize all or part of step that above-described embodiment method carries Suddenly it is that by program the hardware of correlation can be instructed to complete, described program can be stored in a kind of computer-readable storage medium In matter, the program upon execution, including one or a combination set of the step of embodiment of the method.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing module, can also That unit is individually physically present, can also two or more units be integrated in a module.Above-mentioned integrated mould Block can both be realized in the form of hardware, can also be realized in the form of software function module.The integrated module is such as Fruit is realized in the form of software function module and as independent production marketing or in use, can also be stored in a computer In read/write memory medium.
Storage medium mentioned above can be read-only storage, disk or CD etc..
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or the spy for combining the embodiment or example description Point is contained at least one embodiment or example of the present invention.In this manual, to the schematic representation of above-mentioned term not Necessarily refer to identical embodiment or example.Moreover, specific features, structure, material or the feature of description can be any One or more embodiments or example in combine in an appropriate manner.
Although embodiments of the invention have been shown and described above, it is to be understood that above-described embodiment is example Property, it is impossible to limitation of the present invention is interpreted as, one of ordinary skill in the art within the scope of the invention can be to above-mentioned Embodiment is changed, changed, replacing and modification.

Claims (13)

1. a kind of automated testing method, it is characterised in that comprise the following steps:
Obtain characteristic attribute and the topography of control object to be measured;
According to script corresponding to the control object to be measured and topography's generation, with analog subscriber to the control object to be measured Operation;
According to control object to be measured described in the characteristic attribute of the control object to be measured and local framing, and according to described right The script answered carries out automatic test to the control object to be measured;
The script according to corresponding to the control object to be measured and topography's generation, with analog subscriber to the control to be measured The operation of object, including:
According to the control object to be measured generation first script testing procedure corresponding with the control object to be measured, and according to The topography generates the second script testing procedure corresponding with the topography;
The control object to be measured and the priority of the topography are determined according to preset rules, obtains priority result;
It is corresponding according to the first script testing procedure, the second script testing procedure, and priority result generation Script, with operation of the analog subscriber to the control object to be measured;
The preset rules are:
Judge the control object to be measured characteristic attribute whether can control object to be measured described in unique mark, if described treat The characteristic attribute for surveying control object being capable of control object to be measured described in unique mark, it is determined that the priority result is that control is excellent First, if the characteristic attribute of the control object to be measured can not control object to be measured described in unique mark, it is determined that described excellent First level result is that image is preferential;
Or the preferential of the control object to be measured and topography is determined according to the demands of automatic test application scenarios Level, if in the automatic test application scenarios, the picture quality of the topography of the control object to be measured meets in advance If condition, then directly determine that the priority result is preferential for image.
2. automated testing method as claimed in claim 1, it is characterised in that the spy according to the control object to be measured Control object to be measured described in attribute and local framing is levied, including:
According to the characteristic attribute of the control object to be measured, the topography, and treated described in priority result positioning Survey control object.
3. automated testing method as claimed in claim 2, it is characterised in that the priority result is preferential including control, The characteristic attribute according to the control object to be measured, the topography, and treated described in priority result positioning Control object is surveyed, including:
Judge whether the priority result is that the control is preferential;
If the priority result is that the control is preferential, according to the positioning of the characteristic attribute of the control object to be measured Control object to be measured.
4. automated testing method as claimed in claim 2, it is characterised in that it is excellent that the priority result also includes image First, the characteristic attribute according to the control object to be measured, the topography, and described in priority result positioning Control object to be measured, including:
Judge whether the priority result is that described image is preferential;
If the priority result is that described image is preferential, according to the positioning of the topography of the control object to be measured Control object to be measured.
5. automated testing method as claimed in claim 2, it is characterised in that the priority result includes control and image Parallel, the characteristic attribute according to the control object to be measured, the topography, and priority result positioning institute Control object to be measured is stated, including:
Judge whether the priority result is that the control and image are parallel;
If the priority result is that the control and image are parallel, according to the feature category of the control object to be measured Property, or the topography positioning control object to be measured.
6. automated testing method as claimed in claim 4, it is characterised in that the office according to the control object to be measured Control object to be measured described in portion's framing, including:
Stencil matching is carried out to the topography of the control object to be measured and characteristic point is searched, to position the control pair to be measured As.
A kind of 7. automatic test device, it is characterised in that including:
Acquisition module, for obtaining characteristic attribute and the topography of control object to be measured;
Script generation module, for the script according to corresponding to the control object to be measured and topography's generation, with analog subscriber Operation to the control object to be measured;
Test module, for control pair to be measured described in the characteristic attribute according to the control object to be measured and local framing As, and automatic test is carried out to the control object to be measured according to the corresponding script;
The script generation module includes:
Testing procedure generates submodule, for according to the control object to be measured generation corresponding with the control object to be measured the One script testing procedure, and the second script testing procedure corresponding with the topography is generated according to the topography;
Priority result acquisition submodule, for determining the control object to be measured and the topography according to preset rules Priority, obtain priority result;
Script generates submodule, for according to the first script testing procedure, the second script testing procedure, and it is described Script corresponding to priority result generation, with operation of the analog subscriber to the control object to be measured;
The preset rules are:
Judge the control object to be measured characteristic attribute whether can control object to be measured described in unique mark, if described treat The characteristic attribute for surveying control object being capable of control object to be measured described in unique mark, it is determined that the priority result is that control is excellent First, if the characteristic attribute of the control object to be measured can not control object to be measured described in unique mark, it is determined that described excellent First level result is that image is preferential;
Or the preferential of the control object to be measured and topography is determined according to the demands of automatic test application scenarios Level, if in the automatic test application scenarios, the picture quality of the topography of the control object to be measured meets in advance If condition, then directly determine that the priority result is preferential for image.
8. automatic test device as claimed in claim 7, it is characterised in that the test module is specifically used for:
According to the characteristic attribute of the control object to be measured, the topography, and treated described in priority result positioning Survey control object.
9. automatic test device as claimed in claim 8, it is characterised in that the priority result is preferential including control, The test module also particularly useful for:
Judge whether the priority result is that the control is preferential;
If the priority result is that the control is preferential, according to the positioning of the characteristic attribute of the control object to be measured Control object to be measured.
10. automatic test device as claimed in claim 8, it is characterised in that it is excellent that the priority result also includes image First, the test module is further specifically used for:
Judge whether the priority result is that described image is preferential;
If the priority result is that described image is preferential, according to the positioning of the topography of the control object to be measured Control object to be measured.
11. automatic test device as claimed in claim 8, it is characterised in that the priority result includes control and figure As parallel, the test module is further specifically used for:
Judge whether the priority result is that the control and image are parallel;
If the priority result is that the control and image are parallel, according to the feature category of the control object to be measured Property, or the topography positioning control object to be measured.
12. automatic test device as claimed in claim 10, it is characterised in that the test module is further specifically used In:
Stencil matching is carried out to the topography of the control object to be measured and characteristic point is searched, to position the control pair to be measured As.
A kind of 13. mobile terminal, it is characterised in that including:
Housing;
Processor;
Memory;
Circuit board and power circuit;
Wherein, circuit board is placed in the interior volume that housing surrounds, and processor and memory are set on circuit boards;Power supply electricity Road, for each circuit or the device power supply for mobile terminal;Memory is used to store executable program code;Processor passes through The executable program code that stores is read in memory to run program corresponding with executable program code, for performing: Obtain characteristic attribute and the topography of control object to be measured;According to corresponding to the control object to be measured and topography's generation Script, with operation of the analog subscriber to the control object to be measured;According to the characteristic attribute and part of the control object to be measured Control object to be measured described in framing, and automation survey is carried out to the control object to be measured according to the corresponding script Examination;
The script according to corresponding to the control object to be measured and topography's generation, with analog subscriber to the control to be measured The operation of object, including:
According to the control object to be measured generation first script testing procedure corresponding with the control object to be measured, and according to The topography generates the second script testing procedure corresponding with the topography;
The control object to be measured and the priority of the topography are determined according to preset rules, obtains priority result;
It is corresponding according to the first script testing procedure, the second script testing procedure, and priority result generation Script, with operation of the analog subscriber to the control object to be measured;
The preset rules are:
Judge the control object to be measured characteristic attribute whether can control object to be measured described in unique mark, if described treat The characteristic attribute for surveying control object being capable of control object to be measured described in unique mark, it is determined that the priority result is that control is excellent First, if the characteristic attribute of the control object to be measured can not control object to be measured described in unique mark, it is determined that described excellent First level result is that image is preferential;
Or the preferential of the control object to be measured and topography is determined according to the demands of automatic test application scenarios Level, if in the automatic test application scenarios, the picture quality of the topography of the control object to be measured meets in advance If condition, then directly determine that the priority result is preferential for image.
CN201510992909.4A 2015-12-23 2015-12-23 Automated testing method, device and mobile terminal Active CN105550114B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510992909.4A CN105550114B (en) 2015-12-23 2015-12-23 Automated testing method, device and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510992909.4A CN105550114B (en) 2015-12-23 2015-12-23 Automated testing method, device and mobile terminal

Publications (2)

Publication Number Publication Date
CN105550114A CN105550114A (en) 2016-05-04
CN105550114B true CN105550114B (en) 2018-01-19

Family

ID=55829308

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510992909.4A Active CN105550114B (en) 2015-12-23 2015-12-23 Automated testing method, device and mobile terminal

Country Status (1)

Country Link
CN (1) CN105550114B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527689A (en) * 2021-02-09 2021-03-19 腾讯科技(深圳)有限公司 Application testing method and device and storage medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391383B (en) * 2017-08-11 2021-01-12 上海巍擎信息技术有限责任公司 Test method and test system for application program interface
CN108549604A (en) * 2018-04-11 2018-09-18 上海达梦数据库有限公司 A kind of test script generation method, device, terminal device and storage medium
CN112579431A (en) * 2019-09-30 2021-03-30 南京大学 Cross-platform script recording and playback method based on image recognition
CN110888799B (en) * 2019-10-14 2021-05-25 京东数字科技控股有限公司 Software testing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101630286A (en) * 2009-08-07 2010-01-20 金蝶软件(中国)有限公司 Automatic testing method and automatic testing device
CN103309797A (en) * 2012-03-09 2013-09-18 阿里巴巴集团控股有限公司 Automatic testing method and device of user interface
CN103544106A (en) * 2013-10-31 2014-01-29 广东欧珀移动通信有限公司 Method and device for generating script based on control
CN104391797A (en) * 2014-12-09 2015-03-04 北京奇虎科技有限公司 GUI (graphical user interface) widget identification method and device
CN104484269A (en) * 2014-11-27 2015-04-01 北京广利核系统工程有限公司 Method for automatically generating testing script

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101630286A (en) * 2009-08-07 2010-01-20 金蝶软件(中国)有限公司 Automatic testing method and automatic testing device
CN103309797A (en) * 2012-03-09 2013-09-18 阿里巴巴集团控股有限公司 Automatic testing method and device of user interface
CN103544106A (en) * 2013-10-31 2014-01-29 广东欧珀移动通信有限公司 Method and device for generating script based on control
CN104484269A (en) * 2014-11-27 2015-04-01 北京广利核系统工程有限公司 Method for automatically generating testing script
CN104391797A (en) * 2014-12-09 2015-03-04 北京奇虎科技有限公司 GUI (graphical user interface) widget identification method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527689A (en) * 2021-02-09 2021-03-19 腾讯科技(深圳)有限公司 Application testing method and device and storage medium
CN112527689B (en) * 2021-02-09 2021-05-11 腾讯科技(深圳)有限公司 Application testing method and device and storage medium

Also Published As

Publication number Publication date
CN105550114A (en) 2016-05-04

Similar Documents

Publication Publication Date Title
CN105550114B (en) Automated testing method, device and mobile terminal
WO2018010552A1 (en) Test method and device
US10019346B2 (en) Generating software test script from video
CN104050078B (en) Test script generates system
CN108920380A (en) Test method, device, server, equipment and the storage medium of the software compatibility
US8527950B2 (en) Verification of software applications
CN105955889A (en) Graphic interface automated test method
JP2012103786A (en) Test support device, control method, and program
CN110175609A (en) Interface element detection method, device and equipment
JP2016126769A (en) Inspection result output device, inspection result output method, and program
CN106528429A (en) UI testing method and device
CN110737573B (en) Method and device for automatically testing user interface UI
CN108595332A (en) Method for testing software and device
CN103077010B (en) Development support apparatus and development supporting program
CN106933738A (en) APP method of testings, APP test scripts generating means and APP test script performs devices
CN110704252A (en) Automatic testing device and testing method based on cloud dynamic management
JP2021039510A (en) Program inspection device, program inspection method, and program inspection program
CN114692383B (en) Modeling method and device for full-range analog machine simulation object and computer equipment
KR101172881B1 (en) System and method for making the objective test paper used in on-line
CN112817863B (en) AI-aided automatic test method and system based on AI deep learning
JP6433468B2 (en) Program creation support method
JP2006093610A (en) Automatic inspection recipe creating apparatus and method
CN112559377A (en) Method and device for generating first test case
CN103984970B (en) Automatic read-write performance detection method of RFID tags in specific scenes
JP2020119368A (en) Video information management system and video information management method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd.

Address before: Changan town in Guangdong province Dongguan 523859 usha Beach Road No. 18

Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd.