CN105550114A - Automated testing method and apparatus and mobile terminal - Google Patents

Automated testing method and apparatus and mobile terminal Download PDF

Info

Publication number
CN105550114A
CN105550114A CN201510992909.4A CN201510992909A CN105550114A CN 105550114 A CN105550114 A CN 105550114A CN 201510992909 A CN201510992909 A CN 201510992909A CN 105550114 A CN105550114 A CN 105550114A
Authority
CN
China
Prior art keywords
control object
measured
script
topography
described control
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510992909.4A
Other languages
Chinese (zh)
Other versions
CN105550114B (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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Testing Or Calibration Of Command Recording Devices (AREA)
  • Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)

Abstract

The invention proposes an automated testing method and apparatus and a mobile terminal. The automated testing method comprises the steps of obtaining a characteristic attribute and a local image of a to-be-tested control object; according to the to-be-tested control object and the local image, generating a corresponding script to simulate operation of a user on the to-be-tested control object; and according to the characteristic attribute and the local image of the to-be-tested control object, positioning the to-be-tested control object, and according to the corresponding script, performing automated testing on the to-be-tested control object. Through the automated testing method and apparatus and the mobile terminal, the robustness and universality of the automated testing script can be improved and the realization range of the automated testing method can be extended.

Description

Automated testing method, device and mobile terminal
Technical field
The present invention relates to software testing technology field, particularly relate to a kind of automated testing method, device and mobile terminal.
Background technology
Upgrade fast in iteration, Android intelligent machine epoch that machine huge-crowd strategy is prevailing, short, test period project cycle shortens, and determines the active demand to software automated testing.Automated testing method in correlation technique is mainly clicked according to coordinate or control, when adding checkpoint, mainly according to obtaining related control or judging that control property changes.If in the process of software equipment version upgrading, control change can reduce automatic test script versatility, thus affects automatic test efficiency.
Summary of the invention
The present invention is intended to solve one of technical matters in correlation technique at least to a certain extent.
For this reason, one object of the present invention is to propose a kind of automated testing method, can improve robustness and the versatility of automatic test script, effectively promotes automatic test effect.
Another object of the present invention is to propose a kind of automatic test device.
Another object of the present invention is to propose a kind of mobile terminal.
For achieving the above object, the automated testing method that first aspect present invention embodiment proposes, comprising: the characteristic attribute and the topography that obtain control object to be measured; The script corresponding with local Computer image genration according to described control object to be measured, with the operation of analog subscriber to described control object to be measured; According to characteristic attribute and the control object to be measured described in the framing of local of described control object to be measured, and according to the script of described correspondence, automatic test is carried out to described control object to be measured.
The automated testing method that first aspect present invention embodiment proposes, by obtaining characteristic attribute and the topography of control object to be measured; The script corresponding with local Computer image genration according to described control object to be measured, with the operation of analog subscriber to described control object to be measured; According to characteristic attribute and the control object to be measured described in the framing of local of described control object to be measured, and according to the script of described correspondence, automatic test is carried out to described control object to be measured.
For achieving the above object, the automatic test device that second aspect present invention embodiment proposes, comprising: acquisition module, for obtaining characteristic attribute and the topography of control object to be measured; Script generation module, for the script corresponding with local Computer image genration according to described control object to be measured, with the operation of analog subscriber to described control object to be measured; Test module, for control object to be measured according to the characteristic attribute of described control object to be measured and local framing, and carries out automatic test according to the script of described correspondence to described control object to be measured.
The automatic test device that second aspect present invention embodiment proposes, by obtaining characteristic attribute and the topography of control object to be measured; The script corresponding with local Computer image genration according to described control object to be measured, with the operation of analog subscriber to described control object to be measured; According to characteristic attribute and the control object to be measured described in the framing of local of described control object to be measured, and according to the script of described correspondence, automatic test is carried out to described control object to be measured.
For achieving the above object, the mobile terminal that third aspect present invention embodiment proposes, comprising: housing, processor, storer, circuit board and power circuit, wherein, circuit board is placed in the interior volume that housing surrounds, and processor and storer are arranged on circuit boards; Power circuit, for powering for each circuit of mobile terminal or device; Storer is used for stores executable programs code; Processor runs the program corresponding with executable program code, for execution by reading the executable program code stored in storer: the characteristic attribute and the topography that obtain control object to be measured; The script corresponding with local Computer image genration according to described control object to be measured, with the operation of analog subscriber to described control object to be measured; According to characteristic attribute and the control object to be measured described in the framing of local of described control object to be measured, and according to the script of described correspondence, automatic test is carried out to described control object to be measured.
The mobile terminal that third aspect present invention embodiment proposes, by obtaining characteristic attribute and the topography of control object to be measured; The script corresponding with local Computer image genration according to described control object to be measured, with the operation of analog subscriber to described control object to be measured; According to characteristic attribute and the control object to be measured described in the framing of local of described control object to be measured, and according to the script of described correspondence, automatic test is carried out to described control object to be measured.
The aspect that the present invention adds and advantage will part provide in the following description, and part will become obvious from the following description, or be recognized by practice of the present invention.
Accompanying drawing explanation
The present invention above-mentioned and/or additional aspect and advantage will become obvious and easy understand from the following description of the accompanying drawings of embodiments, wherein:
Fig. 1 is the schematic flow sheet of the automated testing method that one embodiment of the invention proposes;
Fig. 2 is the schematic flow sheet of the automated testing method that another embodiment of the present invention proposes;
Fig. 3 is the schematic flow sheet of the automated testing method that another embodiment of the present invention proposes;
Fig. 4 is the schematic flow sheet of the automated testing method that another embodiment of the present invention proposes;
Fig. 5 is the schematic flow sheet of the automated testing method that another embodiment of the present invention proposes;
Fig. 6 is the structural representation of the automatic test device that another embodiment of the present invention proposes;
Fig. 7 is the structural representation of the automatic test device that another embodiment of the present invention proposes.
Embodiment
Be described below in detail embodiments of the invention, the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has element that is identical or similar functions from start to finish.Being exemplary below by the embodiment be described with reference to the drawings, only for explaining the present invention, and can not limitation of the present invention being interpreted as.On the contrary, embodiments of the invention comprise fall into attached claims spirit and intension within the scope of all changes, amendment and equivalent.
Fig. 1 is the schematic flow sheet of the automated testing method that one embodiment of the invention proposes, and this automated testing method comprises:
S101: the characteristic attribute and the topography that obtain control object to be measured.
Wherein, control refers to the ingredient of Windows graphical interfaces, can accept the input of the input equipment such as keyboard or mouse, thus completes certain specific function.Common control is button, OptionButton, edit box, list box, scroll bar such as, and static control etc.
In an embodiment of the present invention, control object to be measured is need to use automated testing method to carry out the control tested.
In an embodiment of the present invention, the characteristic attribute of control object to be measured can be in the control property of control object to be measured, and control features is obvious, can the control property of this control object to be measured of unique identification.
The characteristic attribute of control object to be measured such as can comprise the id mark of control object to be measured, for this control object to be measured of unique identification; Text is a kind of Doctype of computing machine, and such document is mainly used in recording and storing Word message, instead of image, sound and formatted data, may be used for the function identifying this control object to be measured; Control type, for identifying the kind of control object to be measured.
In an embodiment of the present invention, the topography of topography for intercepting this control object to be measured of control object to be measured, such as, the topography of the control object to be measured be truncated to can represent with A.
Such as, suppose that control object to be measured is have the button returning previous step, then the id mark of control object can be " button ", and text can be " returning ", and control type can be " button ".
Upgrade fast in iteration, Android intelligent machine epoch that machine huge-crowd strategy is prevailing, short, test period project cycle shortens, and determines the active demand to software automated testing.Automated testing method in correlation technique is mainly clicked according to coordinate or control, when adding checkpoint, mainly according to obtaining related control or judging that control property changes.If in the process of software equipment version upgrading, control change can reduce automatic test script versatility, thus affects automatic test efficiency.
Particularly, in an embodiment of the present invention, control object to be measured can be selected in the script recording stage of automatic test, and obtain all control properties of control object to be measured, choose control features obvious, can the control property of this control object to be measured of unique identification as characteristic attribute, further, intercept the topography of control object to be measured, to make the follow-up script playback phase at automatic test can by characteristic attribute, or this control object to be measured be located by topography.Wherein, recording is in the artificial process operated tested application based on certain equipment, is automatically recorded and the information such as operation steps, input data by automation tools.Playback be based on record script testing procedure select different equipment automatic reductions before manually-operated process, be the playback of use-case.
S102: the script corresponding with local Computer image genration according to control object to be measured, treats the operation of surveying control object with analog subscriber.
Alternatively, can in the script playback phase of automatic test, by running the first script testing procedure and the second script testing procedure according to priority result, with the operation of analog subscriber to control object to be detected.
Alternatively, in the script recording stage of automatic test, can according to treating the operational requirements surveying control object, generate the script corresponding with control object to be measured and local Computer image genration, such as, user can be treated each operation steps of survey control object and be recorded by the control object operated, generation script testing procedure, treating the operation of surveying control object in order to analog subscriber.
Such as, if control object to be measured is button, in the application scenarios of the control button to be measured of reality, user needs button click, then generate these two script testing procedures of topography of button click and button click, if control object to be measured is scroll bar, user needs to pull scroll bar, then generate these two the script testing procedures of topography pulling scroll bar and pull scroll bar.
Alternatively, the script corresponding with local Computer image genration according to control object to be measured, the operation of surveying control object is treated with analog subscriber, comprise: generate the first script testing procedure corresponding with control object to be measured according to control object to be measured, and generate the second script testing procedure corresponding with topography according to topography; Determine the priority of control object to be measured and topography according to preset rules, obtain priority result; According to the first script testing procedure, the second script testing procedure, and priority result generates corresponding script, treats the operation of surveying control object with analog subscriber.
S103: according to the characteristic attribute of control object to be measured and local framing control object to be measured, and treat according to the script of correspondence and survey control object and carry out automatic test.
In an embodiment of the present invention, control object to be detected is located by the characteristic attribute of control object to be detected, also control object to be detected can be located by the topography of control object to be detected, or, also can in conjunction with the characteristic attribute of control object to be detected 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, determine to use suitable mode to locate control object to be measured.
Alternatively, if locate control object to be detected by the topography of control object to be detected, or, by during in conjunction with the characteristic attribute of control object to be detected and local framing control object to be detected, can treat and survey the topography of control object and carry out stencil matching and unique point is searched, to locate control object to be measured.
Such as, in the script playback phase of automatic test, after navigating to control object to be measured, can by running the first script testing procedure corresponding with control object to be measured and the second script testing procedure, with the operation of analog subscriber to control object to be detected, carry out automatic test.
Alternatively, according to characteristic attribute and the local framing control object to be measured of control object to be measured, comprising: according to characteristic attribute, the topography of control object to be measured, and priority result locates control object to be measured.
In the present embodiment, by the script corresponding with local Computer image genration according to control object to be measured, the operation of surveying control object is treated with analog subscriber, according to characteristic attribute and the local framing control object to be measured of control object to be measured, and according to the script of correspondence treat survey control object carry out automatic test, can improve robustness and the versatility of automatic test script, that expands automated testing method realizes scope.
Fig. 2 is the schematic flow sheet of the automated testing method that another embodiment of the present invention proposes, and this automated testing method comprises:
S201: the characteristic attribute and the topography that obtain control object to be measured.
Wherein, control refers to the ingredient of Windows graphical interfaces, can accept the input of the input equipment such as keyboard or mouse, thus completes certain specific function.Common control is button, OptionButton, edit box, list box, scroll bar such as, and static control etc.
In an embodiment of the present invention, control object to be measured is need to use automated testing method to carry out the control tested.
In an embodiment of the present invention, the characteristic attribute of control object to be measured can be in the control property of control object to be measured, and control features is obvious, can the control property of this control object to be measured of unique identification.
The characteristic attribute of control object to be measured such as can comprise the id mark of control object to be measured, for this control object to be measured of unique identification; Text is a kind of Doctype of computing machine, and such document is mainly used in recording and storing Word message, instead of image, sound and formatted data, may be used for the function identifying this control object to be measured; Control type, for identifying the kind of control object to be measured.
In an embodiment of the present invention, the topography of topography for intercepting this control object to be measured of control object to be measured, such as, the topography of the control object to be measured be truncated to can represent with A.
Such as, suppose that control object to be measured is have the button returning previous step, then the id mark of control object can be " button ", and text can be " returning ", and control type can be " button ".
Upgrade fast in iteration, Android intelligent machine epoch that machine huge-crowd strategy is prevailing, short, test period project cycle shortens, and determines the active demand to software automated testing.Automated testing method in correlation technique is mainly clicked according to coordinate or control, when adding checkpoint, mainly according to obtaining related control or judging that control property changes.If in the process of software equipment version upgrading, control change can reduce automatic test script versatility, thus affects automatic test efficiency.
Particularly, in an embodiment of the present invention, control object to be measured can be selected in the script recording stage of automatic test, and obtain all control properties of control object to be measured, choose control features obvious, can the control property of this control object to be measured of unique identification as characteristic attribute, further, intercept the topography of control object to be measured, to make the follow-up script playback phase at automatic test can by characteristic attribute, or this control object to be measured be located by topography.
Wherein, recording is in the artificial process operated tested application based on certain equipment, is automatically recorded and the information such as operation steps, input data by automation tools.
Playback be based on record script testing procedure select different equipment automatic reductions before manually-operated process, be the playback of use-case.
S202: generate the first script testing procedure corresponding with control object to be measured according to control object to be measured, and generate the second script testing procedure corresponding with topography according to topography.
Alternatively, can in the script playback phase of automatic test, by running the first script testing procedure and the second script testing procedure according to priority result, with the operation of analog subscriber to control object to be detected.
Alternatively, in the script recording stage of automatic test, can according to treating the operational requirements surveying control object, generate the script corresponding with control object to be measured and local Computer image genration, such as, user can be treated each operation steps of survey control object and be recorded by the control object operated, generation script testing procedure, treating the operation of surveying control object in order to analog subscriber.
Such as, if control object to be measured is button, in the application scenarios of the control button to be measured of reality, user needs button click, then generate these two script testing procedures of topography of button click and button click, if control object to be measured is scroll bar, user needs to pull scroll bar, then generate these two the script testing procedures of topography pulling scroll bar and pull scroll bar.
S203: the priority determining control object to be measured and topography according to preset rules, obtains priority result.
Wherein, priority result comprises that control is preferential, image is preferential, or control and image walk abreast.
In an embodiment of the present invention, preset rules can be: whether the characteristic attribute judging control object to be detected can this control object to be measured of unique identification, if the characteristic attribute of control object to be detected can this control object to be measured of unique identification, then determine that priority result is that control is preferential, if the characteristic attribute of control object to be detected can not abundant this control object to be detected of unique identification, then determine that priority result is that image is preferential, in addition, also the priority of control object to be measured and topography can be determined according to the demand of automatic test application scenarios, if in automatic test application scenarios, the picture quality of the topography of control object to be detected is higher, unique point is obvious, then directly can determine that priority result is that image is preferential, the present invention does not limit this.
S204: according to the first script testing procedure, the second script testing procedure, and priority result generates corresponding script, treats the operation of surveying control object with analog subscriber.
Wherein, the first script testing procedure is the script testing procedure corresponding with control object to be measured, and the second script testing procedure is the script testing procedure corresponding with the topography of control object to be detected.
In an embodiment of the present invention, can according to the first script testing procedure, the second script testing procedure, and priority result generates corresponding script, wherein, the replayed section of corresponding script such as, when priority result be control preferential time, perform the first script testing procedure; When priority result be image preferential time, perform the second script testing procedure; When priority result is control and image walks abreast, perform the first script testing procedure, or, perform the second script testing procedure.
S205: according to characteristic attribute, the topography of control object to be measured, and priority result locates control object to be measured.
In an embodiment of the present invention, control object to be detected is located by the characteristic attribute of control object to be detected, also control object to be detected can be located by the topography of control object to be detected, or, also can in conjunction with the characteristic attribute of control object to be detected 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, determine to use suitable mode to locate control object to be measured.
Alternatively, if locate control object to be detected by the topography of control object to be detected, or, by during in conjunction with the characteristic attribute of control object to be detected and local framing control object to be detected, can treat and survey the topography of control object and carry out stencil matching and unique point is searched, to locate control object to be measured.
Alternatively, as shown in Figure 3, Fig. 3 is the schematic flow sheet of the automated testing method that another embodiment of the present invention proposes, and in step S205, can also comprise:
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, first the priority result of control object to be detected can be judged, if priority result is that control is preferential, namely show that the characteristic attribute of control object to be detected can unique identification control object to be measured, then trigger and perform step S302, if priority result be control preferentially, then can judge whether priority result is other optional priority further.
S302: if to be control preferential for priority result, then locate control object to be measured according to the characteristic attribute of control object to be measured.
In an embodiment of the present invention, if priority result is that control is preferential, then obtain in the application scenarios of actual control object to be measured, obtain in whole application scenarios (application scenarios such as, system interface) whole control object and the control features of whole control object, with the characteristic attribute of the control object to be detected of the script recording stage of automatic test, comparison is one by one carried out, to navigate to control to be detected in application scenarios with the control features of the whole control object got.
In the present embodiment, by at priority result be control preferential time, control object to be measured is located according to the characteristic attribute of control object to be measured, make control to be detected topography can not fully unique identification control object to be detected time, control object to be measured can be located by characteristic attribute, in the playback phase of effective guarantee automatic test script, the accuracy of script location, promotes automatic test effect.
Alternatively, as shown in Figure 4, Fig. 4 is the schematic flow sheet of the automated testing method that another embodiment of the present invention proposes, and in step S205, can also comprise:
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, first the priority result of control object to be detected can be judged, if priority result is that image is preferential, namely show that the topography of control object to be detected can unique identification control object to be measured, then trigger and perform step S402, if priority result be image preferentially, then can judge whether priority result is other optional priority further.
S402: if to be image preferential for priority result, then locate control object to be measured according to the topography of control object to be measured.
In an embodiment of the present invention, if priority result is that image is preferential, then obtain in the application scenarios of actual control object to be measured, intercept the screen picture B of whole application scenarios place equipment, images match is carried out, to locate control object to be measured with the topography A of the control object to be detected of the script recording stage of automatic test and screen picture B.
Alternatively, locate control object to be measured according to the topography of control object to be measured, comprising: treat and survey the topography of control object and carry out stencil matching and unique point is searched, to locate control object to be measured.
Wherein, template matches is for starting point with the upper left corner of screen picture B, the coupling frame C consistent with the size of topography A is set, with this by coupling frame C on screen picture B to the right or move down, obtain the topography B ' of the screen picture B that institute's frame goes out in coupling frame C, wherein, topography B ' is image sequence, the similarity of each pixel of each topography in contrast topography A and topography B ', the topography A ' that in final acquisition topography B ', the similarity of pixel is maximum, control object in the topography A ' that the similarity of this pixel is maximum, be the control object to be measured needing location.
Feature Points Matching extracts the unique point of topography A and screen picture B, wherein, unique point is gray scale such as, or position, the similarity of each unique point in contrast topography A and screen picture B, when having, multiple unique point is similar, and the coordinate figure of similar Feature point correspondence is in error range, then represent has the image similar to topography A in screen picture B, and the control gone out by image similar to topography A in screen picture B institute frame is as the control object to be measured needing to locate.
In the present embodiment, by at priority result be image preferential time, control object to be measured is located according to the topography of control object to be measured, make control to be detected characteristic attribute can not fully unique identification control object to be detected time, control object to be measured can be located by topography, in the playback phase of effective guarantee automatic test script, the accuracy of script location, promotes automatic test effect.
Alternatively, as shown in Figure 5, Fig. 5 is the schematic flow sheet of the automated testing method that another embodiment of the present invention proposes, and in step S205, can also comprise:
S501: judge whether priority result is that control and image walk abreast.
In an embodiment of the present invention, under the application scenarios of the control object to be measured of reality, first the priority result of control object to be detected can be judged, walk abreast if priority result is control and image, namely show that the characteristic attribute of control object to be detected and topography all can unique identification control object to be measured, then trigger and perform step S502, walk abreast if priority result is not control and image, then can judge whether priority result is other optional priority further.
S502: walk abreast if priority result is control and image, then according to the characteristic attribute of control object to be measured, or control object to be measured is located by topography.
In an embodiment of the present invention, walk abreast if priority result is control and image, then according to the demand of the application scenarios of the control object to be measured of reality, the characteristic attribute according to control object to be measured can be selected, or control object to be measured is located by topography.
In the present embodiment, by when priority result is control and image walks abreast, according to the demand of the application scenarios of the control object to be measured of reality, select the characteristic attribute according to control object to be measured, or control object to be measured is located by topography, the applicability of effective lifting automated testing method, by in conjunction with the coupling of characteristic attribute and the coupling of topography, can improve the versatility of test script, expansion robotization realizes scope.
S206: treat survey control object according to the script of correspondence and carry out automatic test.
Such as, in the script playback phase of automatic test, after navigating to control object to be measured, can by running the first script testing procedure corresponding with control object to be measured and the second script testing procedure, with the operation of analog subscriber to control object to be detected, carry out automatic test.
In the present embodiment, by determining suitable positioning strategy according to the priority result of control to be detected, promote accuracy and the compatibility of control object location to be detected during automatic test script playback.By the script corresponding with local Computer image genration according to control object to be measured, the operation of surveying control object is treated with analog subscriber, according to characteristic attribute and the local framing control object to be measured of control object to be measured, and according to the script of correspondence treat survey control object carry out automatic test, can improve robustness and the versatility of automatic test script, that expands automated testing method realizes scope.
Fig. 6 is the structural representation of the automatic test device that another embodiment of the present invention proposes, and this automatic test device 60 comprises acquisition module 601, for obtaining characteristic attribute and the topography of control object to be measured; Script generation module 602, for the script corresponding with local Computer image genration according to control object to be measured, treats the operation of surveying control object with analog subscriber; Test module 603, for according to the characteristic attribute of control object to be measured and local framing control object to be measured, and treats according to the script of correspondence and surveys control object and carry out automatic test.
Acquisition module 601, for obtaining characteristic attribute and the topography of control object to be measured.
Wherein, control refers to the ingredient of Windows graphical interfaces, can accept the input of the input equipment such as keyboard or mouse, thus completes certain specific function.Common control is button, OptionButton, edit box, list box, scroll bar such as, and static control etc.
In an embodiment of the present invention, control object to be measured is need to use automated testing method to carry out the control tested.
In an embodiment of the present invention, the characteristic attribute of control object to be measured can be in the control property of control object to be measured, and control features is obvious, can the control property of this control object to be measured of unique identification.
The characteristic attribute of control object to be measured such as can comprise the id mark of control object to be measured, for this control object to be measured of unique identification; Text is a kind of Doctype of computing machine, and such document is mainly used in recording and storing Word message, instead of image, sound and formatted data, may be used for the function identifying this control object to be measured; Control type, for identifying the kind of control object to be measured.
In an embodiment of the present invention, the topography of topography for intercepting this control object to be measured of control object to be measured, such as, the topography of the control object to be measured be truncated to can represent with A.
Such as, suppose that control object to be measured is have the button returning previous step, then the id mark of control object can be " button ", and text can be " returning ", and control type can be " button ".
Upgrade fast in iteration, Android intelligent machine epoch that machine huge-crowd strategy is prevailing, short, test period project cycle shortens, and determines the active demand to software automated testing.Automated testing method in correlation technique is mainly clicked according to coordinate or control, when adding checkpoint, mainly according to obtaining related control or judging that control property changes.If in the process of software equipment version upgrading, control change can reduce automatic test script versatility, thus affects automatic test efficiency.
Particularly, in an embodiment of the present invention, control object to be measured can be selected in the script recording stage of automatic test, and obtain all control properties of control object to be measured, choose control features obvious, can the control property of this control object to be measured of unique identification as characteristic attribute, further, intercept the topography of control object to be measured, to make the follow-up script playback phase at automatic test can by characteristic attribute, or this control object to be measured be located by topography.Wherein, recording is in the artificial process operated tested application based on certain equipment, is automatically recorded and the information such as operation steps, input data by automation tools.
Playback be based on record script testing procedure select different equipment automatic reductions before manually-operated process, be the playback of use-case.
Script generation module 602, for the script corresponding with local Computer image genration according to control object to be measured, treats the operation of surveying control object with analog subscriber.
Alternatively, can in the script playback phase of automatic test, by running the first script testing procedure and the second script testing procedure according to priority result, with the operation of analog subscriber to control object to be detected.
Alternatively, in the script recording stage of automatic test, can according to treating the operational requirements surveying control object, generate the script corresponding with control object to be measured and local Computer image genration, such as, user can be treated each operation steps of survey control object and be recorded by the control object operated, generation script testing procedure, treating the operation of surveying control object in order to analog subscriber.
Such as, if control object to be measured is button, in the application scenarios of the control button to be measured of reality, user needs button click, then generate these two script testing procedures of topography of button click and button click, if control object to be measured is scroll bar, user needs to pull scroll bar, then generate these two the script testing procedures of topography pulling scroll bar and pull scroll bar.
Alternatively, as shown in Figure 7, script generation module 602 comprises:
Testing procedure generates submodule 6021, for generating the first script testing procedure corresponding with control object to be measured according to control object to be measured, and generates the second script testing procedure corresponding with topography according to topography.
Alternatively, can in the script playback phase of automatic test, by running the first script testing procedure and the second script testing procedure according to priority result, with the operation of analog subscriber to control object to be detected.
Alternatively, in the script recording stage of automatic test, can according to treating the operational requirements surveying control object, generate the script corresponding with control object to be measured and local Computer image genration, such as, user can be treated each operation steps of survey control object and be recorded by the control object operated, generation script testing procedure, treating the operation of surveying control object in order to analog subscriber.
Such as, if control object to be measured is button, in the application scenarios of the control button to be measured of reality, user needs button click, then generate these two script testing procedures of topography of button click and button click, if control object to be measured is scroll bar, user needs to pull scroll bar, then generate these two the script testing procedures of topography pulling scroll bar and pull scroll bar.
Priority result obtains submodule 6022, for determining the priority of control object to be measured and topography according to preset rules, obtains priority result.
Wherein, priority result comprises that control is preferential, image is preferential, or control and image walk abreast.
In an embodiment of the present invention, preset rules can be: whether the characteristic attribute judging control object to be detected can this control object to be measured of unique identification, if the characteristic attribute of control object to be detected can this control object to be measured of unique identification, then determine that priority result is that control is preferential, if the characteristic attribute of control object to be detected can not abundant this control object to be detected of unique identification, then determine that priority result is that image is preferential, in addition, also the priority of control object to be measured and topography can be determined according to the demand of automatic test application scenarios, if in automatic test application scenarios, the picture quality of the topography of control object to be detected is higher, unique point is obvious, then directly can determine that priority result is that image is preferential, the present invention does not limit this.
Script generates submodule 6023, and for according to the first script testing procedure, the second script testing procedure, and priority result generates corresponding script, treats the operation of surveying control object with analog subscriber.
Wherein, the first script testing procedure is the script testing procedure corresponding with control object to be measured, and the second script testing procedure is the script testing procedure corresponding with the topography of control object to be detected.
In an embodiment of the present invention, can according to the first script testing procedure, the second script testing procedure, and priority result generates corresponding script, wherein, the replayed section of corresponding script such as, when priority result be control preferential time, perform the first script testing procedure; When priority result be image preferential time, perform the second script testing procedure; When priority result is control and image walks abreast, perform the first script testing procedure, or, perform the second script testing procedure.
Test module 603, for according to the characteristic attribute of control object to be measured and local framing control object to be measured, and treats according to the script of correspondence and surveys control object and carry out automatic test.
In an embodiment of the present invention, control object to be detected is located by the characteristic attribute of control object to be detected, also control object to be detected can be located by the topography of control object to be detected, or, also can in conjunction with the characteristic attribute of control object to be detected 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, determine to use suitable mode to locate control object to be measured.
Alternatively, if locate control object to be detected by the topography of control object to be detected, or, by during in conjunction with the characteristic attribute of control object to be detected and local framing control object to be detected, can treat and survey the topography of control object and carry out stencil matching and unique point is searched, to locate control object to be measured.
Such as, in the script playback phase of automatic test, after navigating to control object to be measured, can by running the first script testing procedure corresponding with control object to be measured and the second script testing procedure, with the operation of analog subscriber to control object to be detected, carry out automatic test.
Alternatively, test module 603 specifically for: according to characteristic attribute, the topography of control object to be measured, and priority result locates control object to be measured.
Alternatively, it is preferential that priority result comprises control, test module 603 also specifically for: judge whether priority result is that control is preferential; If it is preferential that priority result is control, then locate control object to be measured according to the characteristic attribute of control object to be measured.
In an embodiment of the present invention, if priority result is that control is preferential, then obtain in the application scenarios of actual control object to be measured, obtain in whole application scenarios (application scenarios such as, system interface) whole control object and the control features of whole control object, with the characteristic attribute of the control object to be detected of the script recording stage of automatic test, comparison is one by one carried out, to navigate to control to be detected in application scenarios with the control features of the whole control object got.
In the present embodiment, by at priority result be control preferential time, control object to be measured is located according to the characteristic attribute of control object to be measured, make control to be detected topography can not fully unique identification control object to be detected time, control object to be measured can be located by characteristic attribute, in the playback phase of effective guarantee automatic test script, the accuracy of script location, promotes automatic test effect.
Alternatively, it is preferential that priority result also comprises image, test module 603 further specifically for: judge whether priority result is that image is preferential; If it is preferential that priority result is image, then locate control object to be measured according to the topography of control object to be measured.
In an embodiment of the present invention, if priority result is that image is preferential, then obtain in the application scenarios of actual control object to be measured, intercept the screen picture B of whole application scenarios place equipment, images match is carried out, to locate control object to be measured with the topography A of the control object to be detected of the script recording stage of automatic test and screen picture B.
Alternatively, locate control object to be measured according to the topography of control object to be measured, comprising: treat and survey the topography of control object and carry out stencil matching and unique point is searched, to locate control object to be measured.
Wherein, template matches is for starting point with the upper left corner of screen picture B, the coupling frame C consistent with the size of topography A is set, with this by coupling frame C on screen picture B to the right or move down, obtain the topography B ' of the screen picture B that institute's frame goes out in coupling frame C, wherein, topography B ' is image sequence, the similarity of each pixel of each topography in contrast topography A and topography B ', the topography A ' that in final acquisition topography B ', the similarity of pixel is maximum, control object in the topography A ' that the similarity of this pixel is maximum, be the control object to be measured needing location.
Feature Points Matching extracts the unique point of topography A and screen picture B, wherein, unique point is gray scale such as, or position, the similarity of each unique point in contrast topography A and screen picture B, when having, multiple unique point is similar, and the coordinate figure of similar Feature point correspondence is in error range, then represent has the image similar to topography A in screen picture B, and the control gone out by image similar to topography A in screen picture B institute frame is as the control object to be measured needing to locate.
In the present embodiment, by at priority result be image preferential time, control object to be measured is located according to the topography of control object to be measured, make control to be detected characteristic attribute can not fully unique identification control object to be detected time, control object to be measured can be located by topography, in the playback phase of effective guarantee automatic test script, the accuracy of script location, promotes automatic test effect.
Alternatively, priority result comprises control and image and walks abreast, test module 603 further specifically for: judge whether priority result is that control and image are parallel; Walk abreast if priority result is control and image, then according to the characteristic attribute of control object to be measured, or control object to be measured is located by topography.
In an embodiment of the present invention, walk abreast if priority result is control and image, then according to the demand of the application scenarios of the control object to be measured of reality, the characteristic attribute according to control object to be measured can be selected, or control object to be measured is located by topography.
In the present embodiment, by when priority result is control and image walks abreast, according to the demand of the application scenarios of the control object to be measured of reality, select the characteristic attribute according to control object to be measured, or control object to be measured is located by topography, the applicability of effective lifting automated testing method, by in conjunction with the coupling of characteristic attribute and the coupling of topography, can improve the versatility of test script, expansion robotization realizes scope.
Alternatively, test module 603 further specifically for: treat and survey the topography of control object and carry out stencil matching and unique point is searched, to locate control object to be measured.
In the present embodiment, by the script corresponding with local Computer image genration according to control object to be measured, the operation of surveying control object is treated with analog subscriber, according to characteristic attribute and the local framing control object to be measured of control object to be measured, and according to the script of correspondence treat survey control object carry out automatic test, can improve robustness and the versatility of automatic test script, that expands automated testing method realizes scope.
The embodiment of the present invention additionally provides a kind of mobile terminal, and this mobile terminal comprises housing, processor, storer, circuit board and power circuit, and wherein, circuit board is placed in the interior volume that housing surrounds, and processor and storer are arranged on circuit boards; Power circuit, for powering for each circuit of mobile terminal or device; Storer is used for stores executable programs code; Processor runs the program corresponding with executable program code, for execution by reading the executable program code stored in storer:
S101 ': the characteristic attribute and the topography that obtain control object to be measured.
Wherein, control refers to the ingredient of Windows graphical interfaces, can accept the input of the input equipment such as keyboard or mouse, thus completes certain specific function.Common control is button, OptionButton, edit box, list box, scroll bar such as, and static control etc.
In an embodiment of the present invention, control object to be measured is need to use automated testing method to carry out the control tested.
In an embodiment of the present invention, the characteristic attribute of control object to be measured can be in the control property of control object to be measured, and control features is obvious, can the control property of this control object to be measured of unique identification.
The characteristic attribute of control object to be measured such as can comprise the id mark of control object to be measured, for this control object to be measured of unique identification; Text is a kind of Doctype of computing machine, and such document is mainly used in recording and storing Word message, instead of image, sound and formatted data, may be used for the function identifying this control object to be measured; Control type, for identifying the kind of control object to be measured.
In an embodiment of the present invention, the topography of topography for intercepting this control object to be measured of control object to be measured, such as, the topography of the control object to be measured be truncated to can represent with A.
Such as, suppose that control object to be measured is have the button returning previous step, then the id mark of control object can be " button ", and text can be " returning ", and control type can be " button ".
Upgrade fast in iteration, Android intelligent machine epoch that machine huge-crowd strategy is prevailing, short, test period project cycle shortens, and determines the active demand to software automated testing.Automated testing method in correlation technique is mainly clicked according to coordinate or control, when adding checkpoint, mainly according to obtaining related control or judging that control property changes.If in the process of software equipment version upgrading, control change can reduce automatic test script versatility, thus affects automatic test efficiency.
Particularly, in an embodiment of the present invention, control object to be measured can be selected in the script recording stage of automatic test, and obtain all control properties of control object to be measured, choose control features obvious, can the control property of this control object to be measured of unique identification as characteristic attribute, further, intercept the topography of control object to be measured, to make the follow-up script playback phase at automatic test can by characteristic attribute, or this control object to be measured be located by topography.Wherein, recording is in the artificial process operated tested application based on certain equipment, is automatically recorded and the information such as operation steps, input data by automation tools.Playback be based on record script testing procedure select different equipment automatic reductions before manually-operated process, be the playback of use-case.
S102 ': the script corresponding with local Computer image genration according to control object to be measured, treats the operation of surveying control object with analog subscriber.
Alternatively, can in the script playback phase of automatic test, by running the first script testing procedure and the second script testing procedure according to priority result, with the operation of analog subscriber to control object to be detected.
Alternatively, in the script recording stage of automatic test, can according to treating the operational requirements surveying control object, generate the script corresponding with control object to be measured and local Computer image genration, such as, user can be treated each operation steps of survey control object and be recorded by the control object operated, generation script testing procedure, treating the operation of surveying control object in order to analog subscriber.
Such as, if control object to be measured is button, in the application scenarios of the control button to be measured of reality, user needs button click, then generate these two script testing procedures of topography of button click and button click, if control object to be measured is scroll bar, user needs to pull scroll bar, then generate these two the script testing procedures of topography pulling scroll bar and pull scroll bar.
Alternatively, the script corresponding with local Computer image genration according to control object to be measured, the operation of surveying control object is treated with analog subscriber, comprise: generate the first script testing procedure corresponding with control object to be measured according to control object to be measured, and generate the second script testing procedure corresponding with topography according to topography; Determine the priority of control object to be measured and topography according to preset rules, obtain priority result; According to the first script testing procedure, the second script testing procedure, and priority result generates corresponding script, treats the operation of surveying control object with analog subscriber.
S103 ': according to the characteristic attribute of control object to be measured and local framing control object to be measured, and treat according to the script of correspondence and survey control object and carry out automatic test.
In an embodiment of the present invention, control object to be detected is located by the characteristic attribute of control object to be detected, also control object to be detected can be located by the topography of control object to be detected, or, also can in conjunction with the characteristic attribute of control object to be detected 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, determine to use suitable mode to locate control object to be measured.
Alternatively, if locate control object to be detected by the topography of control object to be detected, or, by during in conjunction with the characteristic attribute of control object to be detected and local framing control object to be detected, can treat and survey the topography of control object and carry out stencil matching and unique point is searched, to locate control object to be measured.
Such as, in the script playback phase of automatic test, after navigating to control object to be measured, can by running the first script testing procedure corresponding with control object to be measured and the second script testing procedure, with the operation of analog subscriber to control object to be detected, carry out automatic test.
Alternatively, according to characteristic attribute and the local framing control object to be measured of control object to be measured, comprising: according to characteristic attribute, the topography of control object to be measured, and priority result locates control object to be measured.
In the present embodiment, by the script corresponding with local Computer image genration according to control object to be measured, the operation of surveying control object is treated with analog subscriber, according to characteristic attribute and the local framing control object to be measured of control object to be measured, and according to the script of correspondence treat survey control object carry out automatic test, can improve robustness and the versatility of automatic test script, that expands automated testing method realizes scope.
In another embodiment, processor runs the program corresponding with executable program code, for execution by reading the executable program code stored in storer:
S201 ': the characteristic attribute and the topography that obtain control object to be measured.
Wherein, control refers to the ingredient of Windows graphical interfaces, can accept the input of the input equipment such as keyboard or mouse, thus completes certain specific function.Common control is button, OptionButton, edit box, list box, scroll bar such as, and static control etc.
In an embodiment of the present invention, control object to be measured is need to use automated testing method to carry out the control tested.
In an embodiment of the present invention, the characteristic attribute of control object to be measured can be in the control property of control object to be measured, and control features is obvious, can the control property of this control object to be measured of unique identification.
The characteristic attribute of control object to be measured such as can comprise the id mark of control object to be measured, for this control object to be measured of unique identification; Text is a kind of Doctype of computing machine, and such document is mainly used in recording and storing Word message, instead of image, sound and formatted data, may be used for the function identifying this control object to be measured; Control type, for identifying the kind of control object to be measured.
In an embodiment of the present invention, the topography of topography for intercepting this control object to be measured of control object to be measured, such as, the topography of the control object to be measured be truncated to can represent with A.
Such as, suppose that control object to be measured is have the button returning previous step, then the id mark of control object can be " button ", and text can be " returning ", and control type can be " button ".
Upgrade fast in iteration, Android intelligent machine epoch that machine huge-crowd strategy is prevailing, short, test period project cycle shortens, and determines the active demand to software automated testing.Automated testing method in correlation technique is mainly clicked according to coordinate or control, when adding checkpoint, mainly according to obtaining related control or judging that control property changes.If in the process of software equipment version upgrading, control change can reduce automatic test script versatility, thus affects automatic test efficiency.
Particularly, in an embodiment of the present invention, control object to be measured can be selected in the script recording stage of automatic test, and obtain all control properties of control object to be measured, choose control features obvious, can the control property of this control object to be measured of unique identification as characteristic attribute, further, intercept the topography of control object to be measured, to make the follow-up script playback phase at automatic test can by characteristic attribute, or this control object to be measured be located by topography.
Wherein, recording is in the artificial process operated tested application based on certain equipment, is automatically recorded and the information such as operation steps, input data by automation tools.
Playback be based on record script testing procedure select different equipment automatic reductions before manually-operated process, be the playback of use-case.
S202 ': generate the first script testing procedure corresponding with control object to be measured according to control object to be measured, and generate the second script testing procedure corresponding with topography according to topography.
Alternatively, can in the script playback phase of automatic test, by running the first script testing procedure and the second script testing procedure according to priority result, with the operation of analog subscriber to control object to be detected.
Alternatively, in the script recording stage of automatic test, can according to treating the operational requirements surveying control object, generate the script corresponding with control object to be measured and local Computer image genration, such as, user can be treated each operation steps of survey control object and be recorded by the control object operated, generation script testing procedure, treating the operation of surveying control object in order to analog subscriber.
Such as, if control object to be measured is button, in the application scenarios of the control button to be measured of reality, user needs button click, then generate these two script testing procedures of topography of button click and button click, if control object to be measured is scroll bar, user needs to pull scroll bar, then generate these two the script testing procedures of topography pulling scroll bar and pull scroll bar.
S203 ': the priority determining control object to be measured and topography according to preset rules, obtains priority result.
Wherein, priority result comprises that control is preferential, image is preferential, or control and image walk abreast.
In an embodiment of the present invention, preset rules can be: whether the characteristic attribute judging control object to be detected can this control object to be measured of unique identification, if the characteristic attribute of control object to be detected can this control object to be measured of unique identification, then determine that priority result is that control is preferential, if the characteristic attribute of control object to be detected can not abundant this control object to be detected of unique identification, then determine that priority result is that image is preferential, in addition, also the priority of control object to be measured and topography can be determined according to the demand of automatic test application scenarios, if in automatic test application scenarios, the picture quality of the topography of control object to be detected is higher, unique point is obvious, then directly can determine that priority result is that image is preferential, the present invention does not limit this.
S204 ': according to the first script testing procedure, the second script testing procedure, and priority result generates corresponding script, treats the operation of surveying control object with analog subscriber.
Wherein, the first script testing procedure is the script testing procedure corresponding with control object to be measured, and the second script testing procedure is the script testing procedure corresponding with the topography of control object to be detected.
In an embodiment of the present invention, can according to the first script testing procedure, the second script testing procedure, and priority result generates corresponding script, wherein, the replayed section of corresponding script such as, when priority result be control preferential time, perform the first script testing procedure; When priority result be image preferential time, perform the second script testing procedure; When priority result is control and image walks abreast, perform the first script testing procedure, or, perform the second script testing procedure.
S205 ': according to characteristic attribute, the topography of control object to be measured, and priority result locates control object to be measured.
In an embodiment of the present invention, control object to be detected is located by the characteristic attribute of control object to be detected, also control object to be detected can be located by the topography of control object to be detected, or, also can in conjunction with the characteristic attribute of control object to be detected 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, determine to use suitable mode to locate control object to be measured.
Alternatively, if locate control object to be detected by the topography of control object to be detected, or, by during in conjunction with the characteristic attribute of control object to be detected and local framing control object to be detected, can treat and survey the topography of control object and carry out stencil matching and unique point is searched, to locate control object to be measured.
In another embodiment, processor runs the program corresponding with executable program code, for execution by reading the executable program code stored in storer:
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, first the priority result of control object to be detected can be judged, if priority result is that control is preferential, namely show that the characteristic attribute of control object to be detected can unique identification control object to be measured, then trigger and perform step S302 ', if priority result be control preferentially, then can judge whether priority result is other optional priority further.
S302 ': if to be control preferential for priority result, then locate control object to be measured according to the characteristic attribute of control object to be measured.
In an embodiment of the present invention, if priority result is that control is preferential, then obtain in the application scenarios of actual control object to be measured, obtain in whole application scenarios (application scenarios such as, system interface) whole control object and the control features of whole control object, with the characteristic attribute of the control object to be detected of the script recording stage of automatic test, comparison is one by one carried out, to navigate to control to be detected in application scenarios with the control features of the whole control object got.
In the present embodiment, by at priority result be control preferential time, control object to be measured is located according to the characteristic attribute of control object to be measured, make control to be detected topography can not fully unique identification control object to be detected time, control object to be measured can be located by characteristic attribute, in the playback phase of effective guarantee automatic test script, the accuracy of script location, promotes automatic test effect.
In another embodiment, processor runs the program corresponding with executable program code, for execution by reading the executable program code stored in storer:
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, first the priority result of control object to be detected can be judged, if priority result is that image is preferential, namely show that the topography of control object to be detected can unique identification control object to be measured, then trigger and perform step S402 ', if priority result be image preferentially, then can judge whether priority result is other optional priority further.
S402 ': if to be image preferential for priority result, then locate control object to be measured according to the topography of control object to be measured.
In an embodiment of the present invention, if priority result is that image is preferential, then obtain in the application scenarios of actual control object to be measured, intercept the screen picture B of whole application scenarios place equipment, images match is carried out, to locate control object to be measured with the topography A of the control object to be detected of the script recording stage of automatic test and screen picture B.
Alternatively, locate control object to be measured according to the topography of control object to be measured, comprising: treat and survey the topography of control object and carry out stencil matching and unique point is searched, to locate control object to be measured.
Wherein, template matches is for starting point with the upper left corner of screen picture B, the coupling frame C consistent with the size of topography A is set, with this by coupling frame C on screen picture B to the right or move down, obtain the topography B ' of the screen picture B that institute's frame goes out in coupling frame C, wherein, topography B ' is image sequence, the similarity of each pixel of each topography in contrast topography A and topography B ', the topography A ' that in final acquisition topography B ', the similarity of pixel is maximum, control object in the topography A ' that the similarity of this pixel is maximum, be the control object to be measured needing location.
Feature Points Matching extracts the unique point of topography A and screen picture B, wherein, unique point is gray scale such as, or position, the similarity of each unique point in contrast topography A and screen picture B, when having, multiple unique point is similar, and the coordinate figure of similar Feature point correspondence is in error range, then represent has the image similar to topography A in screen picture B, and the control gone out by image similar to topography A in screen picture B institute frame is as the control object to be measured needing to locate.
In the present embodiment, by at priority result be image preferential time, control object to be measured is located according to the topography of control object to be measured, make control to be detected characteristic attribute can not fully unique identification control object to be detected time, control object to be measured can be located by topography, in the playback phase of effective guarantee automatic test script, the accuracy of script location, promotes automatic test effect.
In another embodiment, processor runs the program corresponding with executable program code, for execution by reading the executable program code stored in storer:
S501 ': judge whether priority result is that control and image walk abreast.
In an embodiment of the present invention, under the application scenarios of the control object to be measured of reality, first the priority result of control object to be detected can be judged, walk abreast if priority result is control and image, namely show that the characteristic attribute of control object to be detected and topography all can unique identification control object to be measured, then trigger and perform step S502 ', walk abreast if priority result is not control and image, then can judge whether priority result is other optional priority further.
S502 ': walk abreast if priority result is control and image, then according to the characteristic attribute of control object to be measured, or control object to be measured is located by topography.
In an embodiment of the present invention, walk abreast if priority result is control and image, then according to the demand of the application scenarios of the control object to be measured of reality, the characteristic attribute according to control object to be measured can be selected, or control object to be measured is located by topography.
In the present embodiment, by when priority result is control and image walks abreast, according to the demand of the application scenarios of the control object to be measured of reality, select the characteristic attribute according to control object to be measured, or control object to be measured is located by topography, the applicability of effective lifting automated testing method, by in conjunction with the coupling of characteristic attribute and the coupling of topography, can improve the versatility of test script, expansion robotization realizes scope.
S206 ': treat survey control object according to the script of correspondence and carry out automatic test.
Such as, in the script playback phase of automatic test, after navigating to control object to be measured, can by running the first script testing procedure corresponding with control object to be measured and the second script testing procedure, with the operation of analog subscriber to control object to be detected, carry out automatic test.
In the present embodiment, by determining suitable positioning strategy according to the priority result of control to be detected, promote accuracy and the compatibility of control object location to be detected during automatic test script playback.By the script corresponding with local Computer image genration according to control object to be measured, the operation of surveying control object is treated with analog subscriber, according to characteristic attribute and the local framing control object to be measured of control object to be measured, and according to the script of correspondence treat survey control object carry out automatic test, can improve robustness and the versatility of automatic test script, that expands automated testing method realizes scope.
It should be noted that, in describing the invention, term " first ", " second " etc. only for describing object, and can not be interpreted as instruction or hint relative importance.In addition, in describing the invention, except as otherwise noted, the implication of " multiple " is two or more.
Describe and can be understood in process flow diagram or in this any process otherwise described or method, represent and comprise one or more for realizing the module of the code of the executable instruction of the step of specific logical function or process, fragment or part, and the scope of the preferred embodiment of the present invention comprises other realization, wherein can not according to order that is shown or that discuss, comprise according to involved function by the mode while of basic or by contrary order, carry out n-back test, this should understand by embodiments of the invention person of ordinary skill in the field.
Should be appreciated that each several part of the present invention can realize with hardware, software, firmware or their combination.In the above-described embodiment, multiple step or method can with to store in memory and the software performed by suitable instruction execution system or firmware realize.Such as, if realized with hardware, the same in another embodiment, can realize by any one in following technology well known in the art or their combination: the discrete logic with the logic gates for realizing logic function to data-signal, there is the special IC of suitable combinational logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA) etc.
Those skilled in the art are appreciated that realizing all or part of step that above-described embodiment method carries is that the hardware that can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, this program perform time, step comprising embodiment of the method one or a combination set of.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing module, also can be that the independent physics of unit exists, also can be integrated in a module by two or more unit.Above-mentioned integrated module both can adopt the form of hardware to realize, and the form of software function module also can be adopted to realize.If described integrated module using the form of software function module realize and as independently production marketing or use time, also can be stored in a computer read/write memory medium.
The above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.
In the description of this instructions, specific features, structure, material or feature that the description of reference term " embodiment ", " some embodiments ", " example ", " concrete example " or " some examples " etc. means to describe in conjunction with this embodiment or example are contained at least one embodiment of the present invention or example.In this manual, identical embodiment or example are not necessarily referred to the schematic representation of above-mentioned term.And the specific features of description, structure, material or feature can combine in an appropriate manner in any one or more embodiment or example.
Although illustrate and describe embodiments of the invention above, be understandable that, above-described embodiment is exemplary, can not be interpreted as limitation of the present invention, and those of ordinary skill in the art can change above-described embodiment within the scope of the invention, revises, replace and modification.

Claims (15)

1. an automated testing method, is characterized in that, comprises the following steps:
Obtain characteristic attribute and the topography of control object to be measured;
The script corresponding with local Computer image genration according to described control object to be measured, with the operation of analog subscriber to described control object to be measured;
According to characteristic attribute and the control object to be measured described in the framing of local of described control object to be measured, and according to the script of described correspondence, automatic test is carried out to described control object to be measured.
2. automated testing method as claimed in claim 1, is characterized in that, the described script corresponding with local Computer image genration according to described control object to be measured, with the operation of analog subscriber to described control object to be measured, comprising:
Generate the first script testing procedure corresponding with described control object to be measured according to described control object to be measured, and generate the second script testing procedure corresponding with described topography according to described topography;
Determine the priority of described control object to be measured and described topography according to preset rules, obtain priority result;
According to described first script testing procedure, described second script testing procedure, and described priority result generates corresponding script, with the operation of analog subscriber to described control object to be measured.
3. automated testing method as claimed in claim 1, is characterized in that, the described characteristic attribute according to described control object to be measured and locally control object to be measured described in framing, comprising:
According to characteristic attribute, the described topography of described control object to be measured, and the described control object to be measured in described priority result location.
4. the automated testing method as described in any one of Claims 2 or 3, it is characterized in that, it is preferential that described priority result comprises control, the described characteristic attribute according to described control object to be measured, described topography, and the described control object to be measured in described priority result location, comprising:
Judge whether described priority result is that described control is preferential;
If it is preferential that described priority result is described control, then according to the described control object to be measured in characteristic attribute location of described control object to be measured.
5. automated testing method as claimed in claim 3, it is characterized in that, it is preferential that described priority result also comprises image, the described characteristic attribute according to described control object to be measured, described topography, and the described control object to be measured in described priority result location, comprising:
Judge whether described priority result is that described image is preferential;
If it is preferential that described priority result is described image, then according to topography's described control object to be measured in location of described control object to be measured.
6. automated testing method as claimed in claim 3, it is characterized in that, described priority result comprises control and image walks abreast, the described characteristic attribute according to described control object to be measured, described topography, and the described control object to be measured in described priority result location, comprising:
Judge whether described priority result is that described control and image walk abreast;
Walk abreast if described priority result is described control and image, then according to the described characteristic attribute of described control object to be measured, or the described topography described control object to be measured in location.
7. automated testing method as claimed in claim 5, is characterized in that, the described topography according to the described control object to be measured described control object to be measured in location, comprising:
Stencil matching is carried out to the topography of described control object to be measured and unique point is searched, to locate described control object to be measured.
8. an automatic test device, is characterized in that, comprising:
Acquisition module, for obtaining characteristic attribute and the topography of control object to be measured;
Script generation module, for the script corresponding with local Computer image genration according to described control object to be measured, with the operation of analog subscriber to described control object to be measured;
Test module, for control object to be measured according to the characteristic attribute of described control object to be measured and local framing, and carries out automatic test according to the script of described correspondence to described control object to be measured.
9. automatic test device as claimed in claim 8, it is characterized in that, described script generation module comprises:
Testing procedure generates submodule, for generating the first script testing procedure corresponding with described control object to be measured according to described control object to be measured, and generates the second script testing procedure corresponding with described topography according to described topography;
Priority result obtains submodule, for determining the priority of described control object to be measured and described topography according to preset rules, obtains priority result;
Script generates submodule, and for according to described first script testing procedure, described second script testing procedure, and described priority result generates corresponding script, with the operation of analog subscriber to described control object to be measured.
10. automatic test device as claimed in claim 8, is characterized in that, described test module specifically for:
According to characteristic attribute, the described topography of described control object to be measured, and the described control object to be measured in described priority result location.
11. automatic test devices as described in any one of claim 9 or 10, is characterized in that, it is preferential that described priority result comprises control, described test module also specifically for:
Judge whether described priority result is that described control is preferential;
If it is preferential that described priority result is described control, then according to the described control object to be measured in characteristic attribute location of described control object to be measured.
12. automatic test devices as claimed in claim 10, is characterized in that, it is preferential that described priority result also comprises image, described test module further specifically for:
Judge whether described priority result is that described image is preferential;
If it is preferential that described priority result is described image, then according to topography's described control object to be measured in location of described control object to be measured.
13. automatic test devices as claimed in claim 10, is characterized in that, described priority result comprises control and image and walks abreast, described test module further specifically for:
Judge whether described priority result is that described control and image walk abreast;
Walk abreast if described priority result is described control and image, then according to the described characteristic attribute of described control object to be measured, or the described topography described control object to be measured in location.
14. automatic test devices as claimed in claim 12, is characterized in that, described test module further specifically for:
Stencil matching is carried out to the topography of described control object to be measured and unique point is searched, to locate described control object to be measured.
15. 1 kinds of mobile terminals, is characterized in that, comprising:
Housing;
Processor;
Storer;
Circuit board and power circuit;
Wherein, circuit board is placed in the interior volume that housing surrounds, and processor and storer are arranged on circuit boards; Power circuit, for powering for each circuit of mobile terminal or device; Storer is used for stores executable programs code; Processor runs the program corresponding with executable program code, for execution by reading the executable program code stored in storer: the characteristic attribute and the topography that obtain control object to be measured; The script corresponding with local Computer image genration according to described control object to be measured, with the operation of analog subscriber to described control object to be measured; According to characteristic attribute and the control object to be measured described in the framing of local of described control object to be measured, and according to the script of described correspondence, automatic test is carried out to described control object to be measured.
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 true CN105550114A (en) 2016-05-04
CN105550114B 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 (4)

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

Families Citing this family (1)

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

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 (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391383A (en) * 2017-08-11 2017-11-24 上海巍擎信息技术有限责任公司 The method of testing and test system of a kind of Application Program Interface
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
CN110888799A (en) * 2019-10-14 2020-03-17 京东数字科技控股有限公司 Software testing method and device

Also Published As

Publication number Publication date
CN105550114B (en) 2018-01-19

Similar Documents

Publication Publication Date Title
CN105550114A (en) Automated testing method and apparatus and mobile terminal
US10176079B2 (en) Identification of elements of currently-executing component script
CN111881019B (en) User interface testing method and device
US9274930B2 (en) Debugging system using static analysis
US7895575B2 (en) Apparatus and method for generating test driver
CN105683924A (en) Debugging native code by transitioning from execution in native mode to execution in interpreted mode
JP2007012003A (en) System for providing development environment of feature-oriented software product line
CN104932973A (en) Version compatibility test method and apparatus
CN107665168A (en) A kind of embedded software GUI automated test devices
CN110287098A (en) Automatically create test script method, server and computer readable storage medium
CN105446874A (en) Method and device for detecting resource configuration file
US11030074B2 (en) Code update based on detection of change in runtime code during debugging
CN112068852B (en) Method, system, equipment and medium for installing open-source software based on domestic server
CN103186463B (en) Determine the method and system of the test specification of software
JP2012103786A (en) Test support device, control method, and program
CN104239206A (en) Webpage test method and device
CN103049374B (en) Automatic testing method and device
JP2002099584A (en) System and method for verifying design and computer- readable medium with program for design verification recorded thereon
CN103955429A (en) Method and device for determining regression testing range
CN102147797A (en) Method and device for managing element files in content management system
KR101563494B1 (en) Real-time source code security weaknesses detection apparatus and method according to the file changes
CN107861779A (en) Page object localization method and device, storage medium, electronic equipment
CN113805861B (en) Code generation method based on machine learning, code editing system and storage medium
KR101534493B1 (en) Source code security weakness detection apparatus and method based on structure conversion
CN104732341A (en) Control method and control system for simulating service process and service process operation

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.