CN109542431A - Control property analysis method, device, electronic equipment and storage medium - Google Patents
Control property analysis method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN109542431A CN109542431A CN201811142635.XA CN201811142635A CN109542431A CN 109542431 A CN109542431 A CN 109542431A CN 201811142635 A CN201811142635 A CN 201811142635A CN 109542431 A CN109542431 A CN 109542431A
- Authority
- CN
- China
- Prior art keywords
- control
- attribute
- acquisition
- electronic equipment
- predeterminable area
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000004458 analytical method Methods 0.000 title claims abstract description 27
- 238000000034 method Methods 0.000 claims abstract description 52
- 238000004590 computer program Methods 0.000 claims description 19
- 230000007246 mechanism Effects 0.000 claims description 14
- 238000012545 processing Methods 0.000 claims description 9
- 238000012544 monitoring process Methods 0.000 claims description 4
- 238000013461 design Methods 0.000 abstract description 18
- 230000008569 process Effects 0.000 abstract description 10
- 238000012986 modification Methods 0.000 abstract description 6
- 230000004048 modification Effects 0.000 abstract description 6
- 230000009286 beneficial effect Effects 0.000 abstract 1
- 230000006870 function Effects 0.000 description 20
- 238000004321 preservation Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 238000012360 testing method Methods 0.000 description 6
- 239000004973 liquid crystal related substance Substances 0.000 description 4
- 230000000149 penetrating effect Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000005611 electricity Effects 0.000 description 3
- 241000209094 Oryza Species 0.000 description 2
- 235000007164 Oryza sativa Nutrition 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 210000004556 brain Anatomy 0.000 description 2
- 239000003086 colorant Substances 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 239000003973 paint Substances 0.000 description 2
- 235000009566 rice Nutrition 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000003780 insertion Methods 0.000 description 1
- 230000037431 insertion Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 238000010998 test method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
A kind of control property analysis method, comprising: the predeterminable area of Application Program Interface to be measured in setting electronic equipment;Obtain the attribute of all controls in the predeterminable area;Whether the attribute for comparing the control obtained is consistent with the attribute of the control prestored;When the attribute of the control of acquisition and the inconsistent attribute of the control prestored, marks the control and export the attribute information of the control.The present invention also provides a kind of control property analytical equipment, electronic equipment and storage mediums.Whether the control that electronic equipment application program interface can be tested through the invention is consistent with design original text, it is accurately obtained the interface control and its current attribute not being inconsistent with design original text, and exportable the interface control of adjustment in need and its document/screenshot of attribute, both it had facilitated the interface Walkthrough process of designer or Developmental Engineer is facilitated to compare modification, and be also beneficial to the displaying of interface application.
Description
Technical field
The present invention relates to automatic test fields, and in particular to a kind of control property analysis method, device, electronic equipment and
Storage medium.
Background technique
Design application interface is needed in existing application program (App) development process, existing application interface is certainly
Although the test method implementation procedure of dynamicization can be realized full automation, to interface control attributive analysis the step
In there is still a need for a large amount of test manpowers to go to realize.For example, when having designed the interface of the application program, it is also necessary to designer
Whether the control property that naked eyes compare the interface is consistent with the control property on design original text.
Presently preferred method is to be analyzed using the plug-in unit of Selenium-IDE, but this tool is also required to test
Personnel clicking operation and record control property value step by step.Especially when interface and more control, need to put into
Many manpowers and time.On the other hand, also it is unfavorable for the operation of scripting by the mode for clicking record by hand, it always cannot be by
During being integrated into automation.Once user interface development team changes wherein several control properties simultaneously, the bottom of so as to cause
Layer application programming interface (Application Programming Interface, API) fails, and original automation is surveyed
Example on probation can not obtain correctly as a result, it is desirable to tester carries out the inspection of large area manually, greatly reduce testing efficiency.
Summary of the invention
In view of the foregoing, it is necessary to propose a kind of control property analysis method, device, electronic equipment and storage medium,
It can be accurately obtained and design the interface control and its current attribute that original text is not inconsistent.
The first aspect of the present invention provides a kind of control property analysis method, is applied in electronic equipment, the method packet
It includes:
Set the predeterminable area of Application Program Interface to be measured in electronic equipment;
Obtain the attribute of all controls in the predeterminable area;
Whether attribute and the corresponding attribute for prestoring the control for comparing the control of each acquisition are consistent;And
When the attribute of the control of any acquisition and the inconsistent corresponding attribute for prestoring the corresponding control, described in label
The inconsistent control of attribute is target widget and the attribute information for exporting control described in the target.
Preferably, the method also includes: according to the Attribute tuning of the corresponding control prestored of the target widget
Target widget in the predeterminable area.
Preferably, before the control in the predeterminable area according to the Attribute tuning of the control prestored, the side
Method further include:
Determine whether the control obtained has locked;
When the control for determining the acquisition is unlocked, attribute volume is carried out according to control of the edit instruction to the acquisition
Volume, wherein the edit instruction is generated according to the attribute of the control prestored;
When the control for determining the acquisition has locked, whether the control of acquisition described in real-time monitoring has been unlocked;And
When the control of the acquisition has unlocked, attribute volume is carried out according to control of the edit instruction to the acquisition
Volume.
Preferably, the attribute of the control includes control type and characteristic value, wherein the characteristic value is used for unique identification
Target widget.
Preferably, described the step of obtaining the attribute of all controls in the predeterminable area, includes:
Control type is encapsulated to and is obtained method name character string corresponding to control type, using reflection mechanism obtain with
The method of the corresponding target widget of control type;
The method for calling target widget obtained, and it is passed to the corresponding characteristic value of the control type, obtain the spy
Target widget corresponding to value indicative.
Preferably, it is obtaining in the predeterminable area after the attribute of all controls, the method also includes to preset shape
The attribute for the control that formula record obtains.
Preferably, the presets include at least one of textual form and chain sheet form.
The second aspect of the present invention provides a kind of control property analytical equipment, and described device includes:
Setting module, for setting the predeterminable area of Application Program Interface to be measured in electronic equipment;
Module is obtained, for obtaining the attribute of all controls in the predeterminable area;
Comparison module, for compare each acquisition control attribute and the corresponding attribute for prestoring the control whether one
It causes;And
Processing module, it is inconsistent for the attribute of the control when any acquisition and the corresponding attribute for prestoring the control
When, the inconsistent control of the label attribute is target widget and the attribute information for exporting the target widget.
The third aspect of the present invention provides a kind of electronic equipment, and the electronic equipment includes processor and memory, described
Processor is for realizing the control property analysis method when executing the computer program stored in the memory.
The fourth aspect of the present invention provides a kind of computer readable storage medium, deposits on the computer readable storage medium
Computer program is contained, the computer program realizes the control property analysis method when being executed by processor.
Control property analysis method, device, electronic equipment and storage medium of the present invention, the method includes obtaining
The attribute of all controls in the predeterminable area;Compare the attribute of the control obtained and the attribute of the control prestored whether one
It causes;When the attribute of the control of acquisition and the inconsistent attribute of the control prestored, marks the control and export the control
The attribute information of part.Whether the control that electronic equipment application program interface can be tested is consistent with design original text, is accurately obtained and sets
Meter the original text interface control and its current attribute that are not inconsistent, and the document of the interface control of exportable adjustment in need and its attribute/
Screenshot had both facilitated the UI Walkthrough process of designer or Developmental Engineer is facilitated to compare modification.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis
The attached drawing of offer obtains other attached drawings.
Fig. 1 is the flow chart for the control property analysis method that the embodiment of the present invention one provides.
Fig. 2 is the functional block diagram of control property analytical equipment provided by Embodiment 2 of the present invention.
Fig. 3 is the schematic diagram for the electronic equipment that the embodiment of the present invention three provides.
The present invention that the following detailed description will be further explained with reference to the above drawings.
Specific embodiment
To better understand the objects, features and advantages of the present invention, with reference to the accompanying drawing and specific real
Applying example, the present invention will be described in detail.It should be noted that in the absence of conflict, the embodiment of the present invention and embodiment
In feature can be combined with each other.
In the following description, numerous specific details are set forth in order to facilitate a full understanding of the present invention, described embodiment is only
It is only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill
Personnel's every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Unless otherwise defined, all technical and scientific terms used herein and belong to technical field of the invention
The normally understood meaning of technical staff is identical.Term as used herein in the specification of the present invention is intended merely to description tool
The purpose of the embodiment of body, it is not intended that in the limitation present invention.
Description and claims of this specification and term " first " in above-mentioned attached drawing, " second " and " third " etc. are
For distinguishing different objects, not for description particular order.In addition, term " includes " and their any deformations, it is intended that
Non-exclusive include in covering.Such as the process, method, system, product or equipment for containing a series of steps or units do not have
It is defined in listed step or unit, but optionally further comprising the step of not listing or unit, or optionally further comprising
For the intrinsic other step or units of these process, methods, product or equipment.
The control property analysis method application of the embodiment of the present invention is in the electronic device.It is described for needing into control property
The electronic equipment of analysis can directly integrate analytic function provided by method of the invention, or installation on an electronic device
For realizing the client of method of the invention.For another example, method provided by the present invention can also be with Software Development Kit
The form of (Software Development Kit, SDK) operates in the equipment such as server, and analysis is provided in the form of SDK
Analytic function can be realized by the interface provided in the interface of function, electronic equipment or other equipment.
Embodiment one
Fig. 1 is the flow chart for the control property analysis method that the embodiment of the present invention one provides.It is described according to different requirements,
Execution sequence in flow chart can change, and certain steps can be omitted.
The predeterminable area of Application Program Interface to be measured in S11, setting electronic equipment.
In the present embodiment, the preset areas of Application Program Interface to be measured in gesture operation setting electronic equipment can be passed through
Domain.Specifically, user can be described to determine by the point or slide specified on the Application Program Interface to be measured
Predeterminable area.For example, three points specified on Application Program Interface to be measured by user, determine a border circular areas, it is described
Border circular areas is predeterminable area;Or user's slide on Application Program Interface to be measured draws a rectangular graph, it is described
Rectangular graph is predeterminable area.
In the present embodiment, the electronic equipment may include, but be not limited to personal computer (Personal
Computer, PC), personal digital assistant (Personal Digital Assistant, PDA), radio hand-held equipment, plate electricity
Brain (Tablet Computer), smart phone etc..Above-mentioned electronic equipment is only citing, and non exhaustive, including but not limited to above-mentioned
Mobile terminal.
In the present embodiment, the electronic equipment includes display screen, and the display screen can have touch function,
Such as liquid crystal (Liquid Crystal Display, LCD) display screen or Organic Light Emitting Diode (Organic Light-
Emitting Diode, OLED) display screen.The display screen is for showing the contents such as Application Program Interface to be measured.It is described to answer
It can be the included application program of electronic equipment with program, such as phone, short message, setting, camera, photo, mail, memorandum, sound
Happy player, video player, calendar, weather etc.;It can also be any third party in the operating system for be installed on electronic equipment
Using, such as golden house keeper, wechat, microblogging, iqiyi.com, youku.com, healthy 160, Jingdone district, Baidu's glutinous rice, Baidu map, KuGoo sound
The application such as pleasure, Netease's cloud music, mobile phone Taobao.The application program can also be a webpage of the browser on electronic equipment
Program (webApp), for example, phonegap etc..
S12, the attribute for obtaining all controls in the predeterminable area.
In the present embodiment, the attribute of the control is for controlling it in the display effect at interface.The attribute packet of control
Include control type, characteristic value, wherein the characteristic value is used for unique identification target widget.The characteristic value may include control
Width, the coordinate of control, the distance of each other controls of back gauge of control, the display position of content, control in control
Textcolor, control text style, control content of text, control background, control picture, control can in middle size text, control
In opinion property, control content at a distance from control frame, specified paint distribution proportion of remaining control etc. after control.
In the present embodiment, tool can be obtained by control to obtain the category of all controls in the predeterminable area
Property.
By taking Android system (Andriod) as an example, tool can be obtained using the control in Android system
Hierarchyviewer obtains the attribute of all controls in the predeterminable area.Another in Android system can also be used
Control obtains the attribute that tool uiautomatorviewer obtains all controls in the predeterminable area.It is understood that also
The acquisition that tool realizes the attribute of all controls in the predeterminable area can be obtained using other controls.
In the other embodiment of the present invention, above-mentioned control obtains tool and is not limited to apply the tool in Android system,
Other be can be applied to such as ios system or windows phone system.
In preferred embodiment of the invention, tester chooses (i.e. selection in advance after corresponding acquisition modes in advance
After corresponding control acquisition tool), a corresponding control can be provided and obtain interface, obtain control so that above-mentioned control obtains tool
The attribute of part.For example, if utilizing the side of ViewServer (view service) when obtaining control with hierarchyviewer tool
Formula obtains the attribute of control in a manner of socket (socket) communication, and provides corresponding API (Application
Programming Interface, application programming interface) interface;In another example if with uiautomatorviewer tool
When obtaining control, the attribute of control can be obtained by way of xml document, and provide corresponding api interface.
In another embodiment, control can also be obtained using reflection mechanism, reflection mechanism can be realized by JAVA.Instead
The code that the mechanism of penetrating can be such that designer creates assembles at runtime, without carrying out source code link between the components.By anti-
The mechanism of penetrating may be implemented batch and obtain multiple target widgets.
Due to the diversification of control type, reflection mechanism can be used, control type is packaged to obtain different type
Control, by way of example, specific steps may is that
A) control type is encapsulated to and obtained method name character string corresponding to control type, obtained using reflection mechanism
The method of target widget corresponding with control type;
B) method for calling target widget obtained, and it is passed to the corresponding characteristic value of the control type, to obtain
Target widget corresponding to the characteristic value.In certain occasions, single character string can be used as characteristic value, at other
It closes, then the combination of more than one character string is needed to carry out constitutive characteristic value.For the ease of at interface, there are when multiple identical controls
Each control is distinguished, the order of the control to be searched in the result can also be identified.
In a preferred embodiment of the invention, obtaining in the predeterminable area after the attribute of all controls, institute
The method of stating further includes the attribute for recording the control of acquisition in a preset form.For example, recording the category of the control of acquisition in the form of text
Property.Specifically, in preferred embodiment of the invention, it is relevant to the attribute of the control in the same operation interface, is recorded in
In the same text.In preferred embodiment of the invention, in the file of textual form, one is indicated with a line in text
The attribute of control.In the same row, with attribute different in the same control in space interval.
In preferred embodiment of the invention, the mode for recording the attribute of control in the form of text is not limited to above institute
The mode stated can also include other modes, attribute etc. different in same control is distinguished for example, by using separator.
It, can also be using the attribute of other forms record control in the other embodiment of the present invention.
In preferred embodiment of the invention, the attribute of above-mentioned control can also be saved in the form of chained list.In other words,
It is associated between predeterminable area and control, control and attribute.For example, predeterminable area is corresponding with the predeterminable area
All controls be mutually related chain sheet form save, and by control with all properties under the control to be mutually related
Chain sheet form saves.In preferred embodiment of the invention, it is above-mentioned " with chain sheet form preservation " description with " protect in the form of text
Deposit " description do not conflict, with the description that chain sheet form saves be in order to illustrate predeterminable area and control, control and its attribute it
Between incidence relation.
This method can obtain tool (selecting corresponding control acquisition methods) using corresponding control, pass through offer
Api interface obtains the attribute of the control in predeterminable area, and the content that will acquire is stored (such as above in the form of corresponding
The preservation in the form of text, and with chain sheet form association preservation etc.).
S13, compare each acquisition control attribute and the corresponding attribute for prestoring the control it is whether consistent.
In the present embodiment, the electronic equipment further includes a storage unit, is previously stored in the storage unit
The all properties of all controls of the Application Program Interface of electronic equipment.The all properties of all controls prestored and designer
The design manuscript of design is consistent.
Specifically, when the attribute of the control of any acquisition and the inconsistent corresponding attribute for prestoring the control, explanation
Control design is unqualified in the predeterminable area, and process enters step S14;
When the attribute of the control of any acquisition and all consistent corresponding attribute for prestoring the control, illustrate described default
Control design is qualified in region, terminates process.
S14, when the attribute of the control of any acquisition and the inconsistent corresponding attribute for prestoring the control, described in label
The inconsistent control of attribute is target widget and the attribute information for exporting the target widget.
In the present embodiment, described that the mesh can be marked by way of carrying out retouching side to control in different colors
Control is marked, attribute information that is described and exporting the target widget is described so that tester checks the target widget attribute
And compare modification.
In the present embodiment, screenshot preservation can also be carried out to the interface where the target widget, facilitates tester
Member checks.
Preferably, the method also includes according to the corresponding Attribute tuning for prestoring the control of the target widget
Target widget in predeterminable area.
In the present embodiment, the control in the predeterminable area is adjusted according to edit instruction, to realize that automation is adjusted
The function of control in whole current interface.Editor's edit instruction is according to current attribute information and the control prestored
What attribute information generated.
For example, if the current attribute information of the control of the acquisition includes the length 5cm of the control obtained, and the institute prestored
The length for stating control is 8cm, then the edit instruction, which can be, is updated to length 8cm for the length 5cm of the control of the acquisition;
For another example, it if the frame that the current attribute information of the control of the acquisition includes the control obtained is Transparent color, and prestores described
The border color of control is black, then the edit instruction can be to update the frame of the Transparent color of the control of the acquisition
For the frame of black, above-mentioned example is merely illustrative, and this is not limited by the present invention.
It should be noted that if the control of the acquisition has locked, then active user can not to the control of the acquisition into
Row attributes edit, therefore, before the control in the predeterminable area according to the Attribute tuning of the control prestored, the side
Method further include: the step of whether control obtained has locked determined.
Specifically, when the control of the acquisition is unlocked, attribute is carried out according to control of the edit instruction to the acquisition
Editor, wherein the edit instruction is generated according to the attribute of the control prestored;When the control of the acquisition has locked,
Then attributes edit can not be carried out according to control of the edit instruction to the acquisition, at this point it is possible to obtain described in real-time monitoring
Control whether unlocked, and when the control of the acquisition has unlocked, according to the edit instruction to the control of the acquisition
Carry out attributes edit.Certainly, active user, can also be to the acquisition before carrying out attributes edit to the control of the acquisition
Control is locked, so that other users temporarily can not carry out attributes edit to the control of the acquisition.
In conclusion control property analysis method provided by the invention includes, application program to be measured in electronic equipment is set
The predeterminable area at interface;Obtain the attribute of all controls in the predeterminable area;It compares the attribute of the control obtained and prestores
Whether the attribute of the control is consistent;When the attribute of the control of acquisition and the inconsistent attribute of the control prestored, label
The control and the attribute information for exporting the control.Can test electronic equipment application program interface control whether with design
Original text is consistent, and is accurately obtained and design the original text interface control and its current attribute that are not inconsistent, and the interface of exportable adjustment in need
Document/screenshot of control and its attribute had both facilitated the UI Walkthrough process of designer or Developmental Engineer is facilitated to compare modification.
The above is only a specific embodiment of the invention, but scope of protection of the present invention is not limited thereto, for
For those skilled in the art, without departing from the concept of the premise of the invention, improvement, but these can also be made
It all belongs to the scope of protection of the present invention.
Below with reference to the 2nd to 3 figure, respectively the functional module to the electronic equipment for realizing above-mentioned control property analysis method and
Hardware configuration is introduced.
Embodiment two
Fig. 2 is the functional block diagram in control property analytical equipment preferred embodiment of the present invention.
In some embodiments, the control property analytical equipment 20 (hereinafter referred to as " analytical equipment 20 ") runs on electricity
In sub- equipment.The analytical equipment 20 may include multiple functional modules as composed by program code segments.The analytical equipment
The program code of each program segment in 20 can store in memory, and as performed by least one processor, to execute
(being detailed in Fig. 1 and its associated description) anti-theft function.
In the present embodiment, function of the analytical equipment 20 according to performed by it can be divided into multiple functional modules.
The functional module may include: setting module 201, obtain module 202, comparison module 203 and processing module 204.The present invention
So-called module, which refers to, a kind of performed by least one processor and can complete the series of computation of fixed function
Machine program segment, storage is in memory.It in some embodiments, will be in subsequent embodiment in detail about the function of each module
It states.
The setting module 201 is used to set the predeterminable area of Application Program Interface to be measured in electronic equipment.
In the present embodiment, the preset areas of Application Program Interface to be measured in gesture operation setting electronic equipment can be passed through
Domain.Specifically, user can be described to determine by the point or slide specified on the Application Program Interface to be measured
Predeterminable area.For example, three points specified on Application Program Interface to be measured by user, determine a border circular areas, it is described
Border circular areas is predeterminable area;Or user's slide on Application Program Interface to be measured draws a rectangular graph, it is described
Rectangular graph is predeterminable area.
In the present embodiment, the electronic equipment may include, but be not limited to personal computer (Personal
Computer, PC), personal digital assistant (Personal Digital Assistant, PDA), radio hand-held equipment, plate electricity
Brain (Tablet Computer), smart phone etc..Above-mentioned electronic equipment is only citing, and non exhaustive, including but not limited to above-mentioned
Mobile terminal.
In the present embodiment, the electronic equipment includes display screen, and the display screen can have touch function,
Such as liquid crystal (Liquid Crystal Display, LCD) display screen or Organic Light Emitting Diode (Organic Light-
Emitting Diode, OLED) display screen.The display screen is for showing the contents such as Application Program Interface to be measured.It is described to answer
It can be the included application program of electronic equipment with program, such as phone, short message, setting, camera, photo, mail, memorandum, sound
Happy player, video player, calendar, weather etc.;It can also be any third party in the operating system for be installed on electronic equipment
Using, such as golden house keeper, wechat, microblogging, iqiyi.com, youku.com, healthy 160, Jingdone district, Baidu's glutinous rice, Baidu map, KuGoo sound
The application such as pleasure, Netease's cloud music, mobile phone Taobao.The application program can also be a webpage of the browser on electronic equipment
Program (webApp), for example, phonegap etc..
The attribute for obtaining module 202 and being used to obtain all controls in the predeterminable area.
In the present embodiment, the attribute of the control is for controlling it in the display effect at interface.The attribute packet of control
Include control type, characteristic value, wherein the characteristic value is used for unique identification target widget.The characteristic value may include control
Width, the coordinate of control, the distance of each other controls of back gauge of control, the display position of content, control in control
Textcolor, control text style, control content of text, control background, control picture, control can in middle size text, control
In opinion property, control content at a distance from control frame, specified paint distribution proportion of remaining control etc. after control.
In the present embodiment, tool can be obtained by control to obtain the category of all controls in the predeterminable area
Property.
By taking Android system (Andriod) as an example, tool can be obtained using the control in Android system
Hierarchyviewer obtains the attribute of all controls in the predeterminable area.Another in Android system can also be used
Control obtains the attribute that tool uiautomatorviewer obtains all controls in the predeterminable area.It is understood that also
The acquisition that tool realizes the attribute of all controls in the predeterminable area can be obtained using other controls.
In the other embodiment of the present invention, above-mentioned control obtains tool and is not limited to apply the tool in Android system,
Other be can be applied to such as ios system or windows phone system.
In preferred embodiment of the invention, tester chooses (i.e. selection in advance after corresponding acquisition modes in advance
After corresponding control acquisition tool), a corresponding control can be provided and obtain interface, obtain control so that above-mentioned control obtains tool
The attribute of part.For example, if utilizing the side of ViewServer (view service) when obtaining control with hierarchyviewer tool
Formula obtains the attribute of control in a manner of socket (socket) communication, and provides corresponding API (Application
Programming Interface, application programming interface) interface;In another example if with uiautomatorviewer tool
When obtaining control, the attribute of control can be obtained by way of xml document, and provide corresponding api interface.
In another embodiment, control can also be obtained using reflection mechanism, reflection mechanism can be realized by JAVA.Instead
The code that the mechanism of penetrating can be such that designer creates assembles at runtime, without carrying out source code link between the components.By anti-
The mechanism of penetrating may be implemented batch and obtain multiple target widgets.
Due to the diversification of control type, reflection mechanism can be used, control type is packaged to obtain different type
Control, by way of example, specific steps may is that
A) control type is encapsulated to and obtained method name character string corresponding to control type, obtained using reflection mechanism
The method of target widget corresponding with control type;
B) method for calling target widget obtained, and it is passed to the corresponding characteristic value of the control type, to obtain
Target widget corresponding to the characteristic value.In certain occasions, single character string can be used as characteristic value, at other
It closes, then the combination of more than one character string is needed to carry out constitutive characteristic value.For the ease of at interface, there are when multiple identical controls
Each control is distinguished, the order of the control to be searched in the result can also be identified.
In a preferred embodiment of the invention, obtaining in the predeterminable area after the attribute of all controls, institute
The method of stating further includes the attribute for recording the control of acquisition in a preset form.For example, recording the category of the control of acquisition in the form of text
Property.Specifically, in preferred embodiment of the invention, it is relevant to the attribute of the control in the same operation interface, is recorded in
In the same text.In preferred embodiment of the invention, in the file of textual form, one is indicated with a line in text
The attribute of control.In the same row, with attribute different in the same control in space interval.
In preferred embodiment of the invention, the mode for recording the attribute of control in the form of text is not limited to above institute
The mode stated can also include other modes, attribute etc. different in same control is distinguished for example, by using separator.
It, can also be using the attribute of other forms record control in the other embodiment of the present invention.
In preferred embodiment of the invention, the attribute of above-mentioned control can also be saved in the form of chained list.In other words,
It is associated between predeterminable area and control, control and attribute.For example, predeterminable area is corresponding with the predeterminable area
All controls be mutually related chain sheet form save, and by control with all properties under the control to be mutually related
Chain sheet form saves.In preferred embodiment of the invention, it is above-mentioned " with chain sheet form preservation " description with " protect in the form of text
Deposit " description do not conflict, with the description that chain sheet form saves be in order to illustrate predeterminable area and control, control and its attribute it
Between incidence relation.
This method can obtain tool (selecting corresponding control acquisition methods) using corresponding control, pass through offer
Api interface obtains the attribute of the control in predeterminable area, and the content that will acquire is stored (such as above in the form of corresponding
The preservation in the form of text, and with chain sheet form association preservation etc.).
The comparison module 203 is used to compare attribute and the corresponding attribute for prestoring the control of the control of each acquisition
It is whether consistent.
In the present embodiment, the electronic equipment further includes a storage unit, is previously stored in the storage unit
The all properties of all controls of the Application Program Interface of electronic equipment.The all properties of all controls prestored and designer
The design manuscript of design is consistent.
Specifically, when the attribute of the control of any acquisition and the inconsistent corresponding attribute for prestoring the control, explanation
Control design is unqualified in the predeterminable area;
When the attribute of the control of any acquisition and all consistent corresponding attribute for prestoring the control, illustrate described default
Control design is qualified in region.
The processing module 204 be used for when the control of any acquisition attribute and the corresponding attribute for prestoring the control not
When consistent, the control for marking the attribute inconsistent is target widget and the attribute information for exporting the target widget.
In the present embodiment, the analytical equipment 20 can by way of carrying out retouching side to control in different colors come
Mark the target widget, attribute information that is described and exporting the target widget, so that tester checks the target control
Part attribute simultaneously compares modification.
In the present embodiment, the analytical equipment 20 can also carry out screenshot guarantor to the interface where the target widget
It deposits, tester is facilitated to check.
Preferably, the processing module 204 can also be according to the corresponding attribute for prestoring the control of the target widget
Adjust the target widget in the predeterminable area.
In the present embodiment, the control in the predeterminable area is adjusted according to edit instruction, to realize that automation is adjusted
The function of control in whole current interface.Editor's edit instruction is according to current attribute information and the control prestored
What attribute information generated.
For example, if the current attribute information of the control of the acquisition includes the length 5cm of the control obtained, and the institute prestored
The length for stating control is 8cm, then the edit instruction, which can be, is updated to length 8cm for the length 5cm of the control of the acquisition;
For another example, it if the frame that the current attribute information of the control of the acquisition includes the control obtained is Transparent color, and prestores described
The border color of control is black, then the edit instruction can be to update the frame of the Transparent color of the control of the acquisition
For the frame of black, above-mentioned example is merely illustrative, and this is not limited by the present invention.
It should be noted that if the control of the acquisition has locked, then active user can not to the control of the acquisition into
Row attributes edit, therefore, before the control in the predeterminable area according to the Attribute tuning of the control prestored, the place
Reason module 204 is also used to determine whether the control of acquisition has locked.
Specifically, when the control of the acquisition is unlocked, attribute is carried out according to control of the edit instruction to the acquisition
Editor, wherein the edit instruction is generated according to the attribute of the control prestored;When the control of the acquisition has locked,
Then attributes edit can not be carried out according to control of the edit instruction to the acquisition, at this point it is possible to obtain described in real-time monitoring
Control whether unlocked, and when the control of the acquisition has unlocked, according to the edit instruction to the control of the acquisition
Carry out attributes edit.Certainly, active user, can also be to the acquisition before carrying out attributes edit to the control of the acquisition
Control is locked, so that other users temporarily can not carry out attributes edit to the control of the acquisition.
In conclusion analytical equipment 20 of the present invention, including setting module 201, acquisition module 202, comparison module
203 and processing module 204.The setting module 201 is used to set the predeterminable area of Application Program Interface to be measured in electronic equipment;
The attribute for obtaining module 202 and being used to obtain all controls in the predeterminable area;The comparison module 203 is obtained for comparing
Whether the attribute of the control taken is consistent with the attribute of the control prestored;The processing module 204 is used for when the control obtained
Attribute it is inconsistent with the attribute of the control that prestores when, mark the control and export the attribute information of the control.Institute
State analytical equipment 20 can test electronic equipment application program interface control whether with design original text be consistent, be accurately obtained and design
The interface control and its current attribute that original text is not inconsistent, and the document of the interface control of exportable adjustment in need and its attribute/cut
Figure had both facilitated the UI Walkthrough process of designer or Developmental Engineer is facilitated to compare modification.
The above-mentioned integrated unit realized in the form of software function module, can store and computer-readable deposit at one
In storage media.Above-mentioned software function module is stored in a storage medium, including some instructions are used so that a computer
It is each that equipment (can be personal computer, double screen equipment or the network equipment etc.) or processor (processor) execute the present invention
The part of a embodiment the method.
Fig. 3 is the schematic diagram for the electronic equipment that the embodiment of the present invention three provides.
The electronic equipment 3 includes: memory 31, at least one processor 32, is stored in the memory 31 and can
The computer program 33 and at least one communication bus 34 run at least one described processor 32.
At least one described processor 32 realizes that above-mentioned control property analysis method is real when executing the computer program 33
Apply the step in example.
Illustratively, the computer program 33 can be divided into one or more module/units, it is one or
Multiple module/units are stored in the memory 31, and are executed by least one described processor 32, to complete this hair
It is bright.One or more of module/units can be the series of computation machine program instruction section that can complete specific function, described
Instruction segment is for describing implementation procedure of the computer program 33 in the electronic equipment 3.
The electronic equipment 3 can be mobile phone, tablet computer, personal digital assistant (Personal Digital
Assistant, PDA) etc. application program is installed equipment.It will be understood by those skilled in the art that the schematic diagram 3 is only
The example of electronic equipment 3 does not constitute the restriction to electronic equipment 3, may include components more more or fewer than diagram, or
Certain components or different components are combined, such as the electronic equipment 3 can also include input-output equipment, network insertion
Equipment, bus etc..
At least one described processor 32 can be central processing unit (Central Processing Unit, CPU),
It can also be other general processors, digital signal processor (Digital Signal Processor, DSP), dedicated integrated
Circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..The processor 32 can be microprocessor or the processor 32 is also possible to any conventional place
Device etc. is managed, the processor 32 is the control centre of the electronic equipment 3, is set using various interfaces and the entire electronics of connection
Standby 3 various pieces.
The memory 31 can be used for storing the computer program 33 and/or module/unit, and the processor 32 passes through
Operation executes the computer program and/or module/unit being stored in the memory 31, and calls and be stored in memory
Data in 31 realize the various functions of the electronic equipment 3.The memory 31 can mainly include storing program area and storage
Data field, wherein storing program area can application program needed for storage program area, at least one function (for example sound plays
Function, image player function etc.) etc.;Storage data area, which can be stored, uses created data (such as sound according to electronic equipment 3
Frequency evidence, phone directory etc.) etc..In addition, memory 31 may include high-speed random access memory, it can also include non-volatile
Memory, such as hard disk, memory, plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital
(Secure Digital, SD) card, flash card (Flash Card), at least one disk memory, flush memory device or other
Volatile solid-state part.
If the integrated module/unit of the electronic equipment 3 is realized in the form of SFU software functional unit and as independent
Product when selling or using, can store in a computer readable storage medium.Based on this understanding, the present invention is real
All or part of the process in existing above-described embodiment method, can also instruct relevant hardware come complete by computer program
At the computer program can be stored in a computer readable storage medium, and the computer program is held by processor
When row, it can be achieved that the step of above-mentioned each embodiment of the method.Wherein, the computer program includes computer program code, institute
Stating computer program code can be source code form, object identification code form, executable file or certain intermediate forms etc..It is described
Computer-readable medium may include: any entity or device, recording medium, U that can carry the computer program code
Disk, mobile hard disk, magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only Memory), arbitrary access
Memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It needs
It is bright, the content that the computer-readable medium includes can according in jurisdiction make laws and patent practice requirement into
Row increase and decrease appropriate, such as do not include electric load according to legislation and patent practice, computer-readable medium in certain jurisdictions
Wave signal and telecommunication signal.
In several embodiments provided by the present invention, it should be understood that arriving, disclosed electronic equipment and method can be with
It realizes by another way.For example, electronic equipment embodiment described above is only schematical, for example, the list
The division of member, only a kind of logical function partition, there may be another division manner in actual implementation.
It, can also be in addition, each functional unit in each embodiment of the present invention can integrate in same treatment unit
It is that each unit physically exists alone, can also be integrated in same unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of hardware adds software function module.
It is obvious to a person skilled in the art that invention is not limited to the details of the above exemplary embodiments, Er Qie
In the case where without departing substantially from spirit or essential attributes of the invention, the present invention can be realized in other specific forms.Therefore, no matter
From the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the present invention is by appended power
Benefit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent elements of the claims
Variation is included in the present invention.Any reference signs in the claims should not be construed as limiting the involved claims.This
Outside, it is clear that one word of " comprising " is not excluded for other units or, odd number is not excluded for plural number.The multiple units stated in system claims
Or device can also be implemented through software or hardware by a unit or device.The first, the second equal words are used to indicate name
Claim, and does not indicate any particular order.
Finally it should be noted that the above examples are only used to illustrate the technical scheme of the present invention and are not limiting, although reference
Preferred embodiment describes the invention in detail, those skilled in the art should understand that, it can be to of the invention
Technical solution is modified or equivalent replacement, without departing from the spirit of the technical scheme of the invention range.
Claims (10)
1. a kind of control property analysis method is applied in electronic equipment, which is characterized in that the described method includes:
Set the predeterminable area of Application Program Interface to be measured in electronic equipment;
Obtain the attribute of all controls in the predeterminable area;
Whether attribute and the corresponding attribute for prestoring the control for comparing the control of each acquisition are consistent;And
When the attribute of the control of any acquisition and the inconsistent corresponding attribute for prestoring the corresponding control, the attribute is marked
Inconsistent control is target widget and the attribute information for exporting control described in the target.
2. control property analysis method as described in claim 1, which is characterized in that the method also includes: according to the mesh
Mark the target widget in predeterminable area described in the Attribute tuning of the corresponding control prestored of control.
3. control property analysis method as claimed in claim 2, which is characterized in that in the attribute according to the control prestored
Before adjusting the control in the predeterminable area, the method also includes:
Determine whether the control obtained has locked;
When the control for determining the acquisition is unlocked, attributes edit is carried out according to control of the edit instruction to the acquisition,
In, the edit instruction is generated according to the attribute of the control prestored;
When the control for determining the acquisition has locked, whether the control of acquisition described in real-time monitoring has been unlocked;And
When the control of the acquisition has unlocked, attributes edit is carried out according to control of the edit instruction to the acquisition.
4. control property analysis method as described in claim 1, which is characterized in that the attribute of the control includes control type
And characteristic value, wherein the characteristic value is used for unique identification target widget.
5. control property analysis method as claimed in claim 4, which is characterized in that described obtain in the predeterminable area is owned
The step of attribute of control includes:
Control type is encapsulated to and obtained method name character string corresponding to control type, utilizes reflection mechanism acquisition and control
The method of the corresponding target widget of type;
The method for calling target widget obtained, and it is passed to the corresponding characteristic value of the control type, obtain the characteristic value
Corresponding target widget.
6. control property analysis method as described in claim 1, which is characterized in that obtaining all controls in the predeterminable area
After the attribute of part, the method also includes recording the attribute of the control of acquisition in a preset form.
7. control property analysis method as claimed in claim 6, which is characterized in that the presets include at least text shape
One of formula and chain sheet form.
8. a kind of control property analytical equipment, which is characterized in that described device includes:
Setting module, for setting the predeterminable area of Application Program Interface to be measured in electronic equipment;
Module is obtained, for obtaining the attribute of all controls in the predeterminable area;
Whether comparison module, the attribute and the corresponding attribute for prestoring the control for comparing the control of each acquisition are consistent;
And
Processing module, for when the attribute of the control of any acquisition and the inconsistent corresponding attribute for prestoring the control, institute
Stating the control for marking the attribute inconsistent is target widget and the attribute information for exporting the target widget.
9. a kind of electronic equipment, which is characterized in that the electronic equipment includes processor and memory, and the processor is for holding
Control property as claimed in any of claims 1 to 7 in one of claims point is realized when the computer program stored in the row memory
Analysis method.
10. a kind of computer readable storage medium, computer program, feature are stored on the computer readable storage medium
It is, the computer program realizes control property as claimed in any of claims 1 to 7 in one of claims point when being executed by processor
Analysis method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811142635.XA CN109542431A (en) | 2018-09-28 | 2018-09-28 | Control property analysis method, device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811142635.XA CN109542431A (en) | 2018-09-28 | 2018-09-28 | Control property analysis method, device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109542431A true CN109542431A (en) | 2019-03-29 |
Family
ID=65841295
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811142635.XA Pending CN109542431A (en) | 2018-09-28 | 2018-09-28 | Control property analysis method, device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109542431A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111045924A (en) * | 2019-10-31 | 2020-04-21 | 口碑(上海)信息技术有限公司 | Processing method, device and equipment for user interface visual acceptance |
CN111530083A (en) * | 2020-05-26 | 2020-08-14 | 网易(杭州)网络有限公司 | Interface checking method and device |
CN112434489A (en) * | 2020-11-24 | 2021-03-02 | 深圳市明源云科技有限公司 | Chart file processing method and device |
CN112988586A (en) * | 2021-03-25 | 2021-06-18 | 腾讯科技(深圳)有限公司 | Control testing method and device, electronic equipment and storage medium |
CN113377366A (en) * | 2021-07-09 | 2021-09-10 | 北京字跳网络技术有限公司 | Control editing method, device, equipment, readable storage medium and product |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140229920A1 (en) * | 2013-02-13 | 2014-08-14 | Sap Ag | Dynamic scenario testing of web application |
CN104809053A (en) * | 2014-01-23 | 2015-07-29 | 阿里巴巴集团控股有限公司 | Control style testing method and device |
CN105550101A (en) * | 2015-12-02 | 2016-05-04 | 北京奇虎科技有限公司 | Test method for application program, electronic device and system |
CN106033393A (en) * | 2015-03-13 | 2016-10-19 | 展讯通信(天津)有限公司 | Method and system for testing application program, and mobile terminal |
CN106067125A (en) * | 2016-06-03 | 2016-11-02 | 武汉大学 | The structural type advertising fraud detection method of a kind of Android platform and system |
-
2018
- 2018-09-28 CN CN201811142635.XA patent/CN109542431A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140229920A1 (en) * | 2013-02-13 | 2014-08-14 | Sap Ag | Dynamic scenario testing of web application |
CN104809053A (en) * | 2014-01-23 | 2015-07-29 | 阿里巴巴集团控股有限公司 | Control style testing method and device |
CN106033393A (en) * | 2015-03-13 | 2016-10-19 | 展讯通信(天津)有限公司 | Method and system for testing application program, and mobile terminal |
CN105550101A (en) * | 2015-12-02 | 2016-05-04 | 北京奇虎科技有限公司 | Test method for application program, electronic device and system |
CN106067125A (en) * | 2016-06-03 | 2016-11-02 | 武汉大学 | The structural type advertising fraud detection method of a kind of Android platform and system |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111045924A (en) * | 2019-10-31 | 2020-04-21 | 口碑(上海)信息技术有限公司 | Processing method, device and equipment for user interface visual acceptance |
CN111530083A (en) * | 2020-05-26 | 2020-08-14 | 网易(杭州)网络有限公司 | Interface checking method and device |
CN111530083B (en) * | 2020-05-26 | 2023-09-08 | 网易(杭州)网络有限公司 | Interface inspection method and device |
CN112434489A (en) * | 2020-11-24 | 2021-03-02 | 深圳市明源云科技有限公司 | Chart file processing method and device |
CN112434489B (en) * | 2020-11-24 | 2024-03-12 | 深圳市明源云科技有限公司 | Graph file processing method and device |
CN112988586A (en) * | 2021-03-25 | 2021-06-18 | 腾讯科技(深圳)有限公司 | Control testing method and device, electronic equipment and storage medium |
CN112988586B (en) * | 2021-03-25 | 2023-07-14 | 腾讯科技(深圳)有限公司 | Control testing method and device, electronic equipment and storage medium |
CN113377366A (en) * | 2021-07-09 | 2021-09-10 | 北京字跳网络技术有限公司 | Control editing method, device, equipment, readable storage medium and product |
CN113377366B (en) * | 2021-07-09 | 2024-03-12 | 北京字跳网络技术有限公司 | Control editing method, device, equipment, readable storage medium and product |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109542431A (en) | Control property analysis method, device, electronic equipment and storage medium | |
AU2012283812B2 (en) | Method for associating third party content with online document signing | |
CN107122301A (en) | Interface detection method and device | |
CN109725901A (en) | Development approach, device, equipment and the computer storage medium of front-end code | |
CN108228305A (en) | Display methods, device, storage medium and the electronic equipment of five application page | |
US9495282B2 (en) | Method and systems for a dashboard testing framework in an online demand service environment | |
CN109828906A (en) | UI automated testing method, device, electronic equipment and storage medium | |
CN107832207A (en) | Interface performance test method, apparatus, storage medium and computer equipment | |
CN107015804A (en) | A kind of method and system by the quick exploration project of provisioning API | |
CN108132879A (en) | Automated software testing method, platform, terminal and medium | |
CN110275826A (en) | Automated testing method, device and computer readable storage medium | |
CN107741904A (en) | Test machine method of automatic configuration, device, equipment and storage medium | |
CN112199093A (en) | Resource checking method, device, equipment and computer readable storage medium | |
CN110309099A (en) | Interface managerial method, device, equipment and computer readable storage medium | |
CN106919406A (en) | A kind of desktop application component issue, update method and device | |
CN105915657A (en) | Data synchronization method and device, and client | |
CN109271313A (en) | Code test method, device and computer readable storage medium | |
CN110825395B (en) | Multi-plug-in layered deployment system, device and medium | |
CN105912328A (en) | Method and device for displaying web system page, and web system | |
CN108345658A (en) | Algorithm calculates decomposing process, server and the storage medium of track | |
CN108427637A (en) | Test cases recommends method, electronic device and readable storage medium storing program for executing | |
CN108845924A (en) | Control response region display control method, electronic device and storage medium | |
CN111984882A (en) | Data processing method, system and equipment | |
CN112306606A (en) | Method and equipment for presenting control style | |
CN115237425A (en) | Code viewing method and device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190329 |
|
RJ01 | Rejection of invention patent application after publication |