CN106155712A - The acquisition methods of a kind of Windows control property and device - Google Patents

The acquisition methods of a kind of Windows control property and device Download PDF

Info

Publication number
CN106155712A
CN106155712A CN201510137093.7A CN201510137093A CN106155712A CN 106155712 A CN106155712 A CN 106155712A CN 201510137093 A CN201510137093 A CN 201510137093A CN 106155712 A CN106155712 A CN 106155712A
Authority
CN
China
Prior art keywords
control
target widget
software
window
attribute
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510137093.7A
Other languages
Chinese (zh)
Inventor
刘熙哲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201510137093.7A priority Critical patent/CN106155712A/en
Publication of CN106155712A publication Critical patent/CN106155712A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The application provides a kind of control acquisition methods and device.Described method includes: judge whether target widget is Windows standard control;If described target widget is not Windows standard control, then sends control by process communication and obtain the request software to the described target widget of installation, obtain the control property of software described in acquisition request for described software according to described control;From the control property of described software, whole attributes of described target widget are obtained according to known target widget attribute.By the technical scheme of the application, it is possible to achieve the acquisition to different classes of control property.

Description

The acquisition methods of a kind of Windows control property and device
Technical field
The application relates to field of computer technology, particularly relates to the acquisition side of a kind of Windows control property Method and device.
Background technology
It is Windows standard control that Windows control can be divided into two classes, a class from framework realizes, Another kind of is the research and development of products root non-standard control according to requirement developing.For Windows standard control Attribute, can use existing instrument to be identified obtaining.But, for the attribute of non-standard control, Owing to it uses non-standard Development of Framework, so there is presently no effective identification and acquisition methods.
Summary of the invention
In view of this, the application provides a kind of control acquisition methods and device.
Specifically, the application is achieved by the following technical solution:
A kind of acquisition methods of Windows control property, described method includes:
Judge whether target widget is Windows standard control;
If described target widget is not Windows standard control, then sends control and obtain request to installation The software of described target widget, obtains software described in acquisition request for described software according to described control Control property;
From the control property of described software, described target widget is obtained according to known target widget attribute All attributes.
Further, described control acquisition request includes: window handle, store path and storage format;
Described control obtains request, for all controls obtained in described software under this window for described software Part attribute, and all control properties under described window are stored described storage road with described storage format In footpath;
Target widget attribute known to described basis obtains described target widget from the control of described software, Including:
The all control properties under described window are obtained from described store path;
Described target widget is obtained according in the known target widget attribute all controls from described window Whole attributes.
Further, described control acquisition request includes: window handle;
Described control obtains request, for all controls obtained in described software under this window for described software Part attribute, and all control properties under described window are returned;
Target widget attribute known to described basis obtains described target widget from the control of described software All attributes, including:
Receive all control properties under the described window that described software is returned by process communication;
Described target widget is obtained according in the known target widget attribute all controls from described window Whole attributes.
Further, described method also includes:
Without getting whole attributes of described target widget within the default time, then resend Control obtains request to the software installing described target widget.
Further, described method also includes:
When resending control and obtaining the number of times that the number of times arrival asked is preset, if the most do not got Whole attributes of described target widget, then return and obtain failure information.
A kind of acquisition device of Windows control property, described device includes:
Judging unit, it is judged that whether target widget is Windows standard control;
Transmitting element, when described target widget is not Windows standard control, is sent out by process communication Send control to obtain the request software to the described target widget of installation, obtain according to described control for described software Take the control property of software described in acquisition request;
Acquiring unit, obtains described from the control property of described software according to known target widget attribute Whole attributes of target widget.
Further, described control acquisition request includes: window handle, store path and storage format;
Described control obtains request, for all controls obtained in described software under this window for described software Part attribute, and all control properties under described window are stored described storage road with described storage format In footpath;
Described acquiring unit, specifically obtains all control properties under described window from described store path, And obtain described target widget according in the known target widget attribute all controls from described window All attributes.
Further, described control acquisition request includes: window handle;
Described control obtains request, for all controls obtained in described software under this window for described software Part attribute, and all control properties under described window are returned;
Described acquiring unit, the concrete institute received under the described window that described software is returned by process communication There is control property, and according to the known target widget attribute all controls from described window obtain institute State whole attributes of target widget.
Further, described device also includes:
Retransmission unit, when not getting whole attribute of described target widget within the default time, Resend control and obtain request to the software installing described target widget.
Further, described retransmission unit, obtain what the number of times arrival asked was preset when resending control During number of times, if the most not getting whole attributes of described target widget, then return and obtain failure information.
By above description it can be seen that the application is when obtaining target widget, can first judge target widget Whether it is Windows standard control, and when target widget is not Windows standard control, passes through Communication between process sends control and obtains the request software to the described target widget of installation, non-to obtain Whole attributes of Windows standard control, thus realize the acquisition to different classes of control property.
Accompanying drawing explanation
Fig. 1 is the acquisition methods of a kind of Windows control property shown in the application one exemplary embodiment Flow chart.
Fig. 2 is the structural representation of a kind of terminal shown in the application one exemplary embodiment.
Fig. 3 is the acquisition device of a kind of Windows control property shown in the application one exemplary embodiment Structural representation.
Detailed description of the invention
Here will illustrate exemplary embodiment in detail, its example represents in the accompanying drawings.Following When description relates to accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represents same or analogous Key element.Embodiment described in following exemplary embodiment does not represent the institute consistent with the application There is embodiment.On the contrary, they only with as appended claims describes in detail, the one of the application The example of the apparatus and method that a little aspects are consistent.
It is only merely for describing the purpose of specific embodiment at term used in this application, and is not intended to be limiting The application." a kind of " of singulative used in the application and appended claims, " institute State " and " being somebody's turn to do " be also intended to include most form, unless context clearly shows that other implications.Also should Work as understanding, term "and/or" used herein refer to and comprise one or more be associated list item Any or all possible combination of purpose.
Although should be appreciated that may use term first, second, third, etc. various to describe in the application Information, but these information should not necessarily be limited by these terms.These terms only be used for by same type of information that This distinguishes.Such as, in the case of without departing from the application scope, the first information can also be referred to as Two information, similarly, the second information can also be referred to as the first information.Depend on linguistic context, as in this institute Use word " if " can be construed to " and ... time " or " when ... time " or " response In determining ".
For the problems referred to above, the application provides a kind of control to obtain scheme, it is possible to achieve mark Windows Quasi-control and the acquisition of non-standard control.
Fig. 1 is the acquisition methods of a kind of Windows control property shown in the application one exemplary embodiment Flow chart.
Refer to Fig. 1, the application provides the acquisition methods of a kind of Windows control property, can apply In terminal, include following steps:
Step 101, it is judged that whether target widget is Windows standard control.If described target widget It not Windows standard control, then perform step 102.
In the present embodiment, when obtaining target widget, first judge whether target widget is Windows mark Quasi-control.In this step, described target can be obtained in the way of using acquisition Windows standard control Control is to judge.Specifically, the Windows standard control of offer in correlation technique can be provided Acquisition instrument obtains described target widget, such as: AutoIt instrument, WinRunner instrument etc., this Shen Please this is not particularly limited.
If successfully getting described target widget, then illustrate that described target widget is Windows standard control Part, can test described control or debug.Without getting described target widget, then Illustrate that described target widget is not Windows standard control, perform step 102.
Step 102, sends control by process communication and obtains the request software to the described target widget of installation, The control property of software described in acquisition request is obtained according to described control for described software.
Judged result based on abovementioned steps 101, if described target widget is not Windows standard control Part, i.e. cannot get described target widget, then at this by the way of obtaining Windows standard control In step, and the software installing described target widget carries out the communication between process, to obtain described target control Whole attributes of part.
In this step, control acquisition request can be sent by self-defining interaction protocol described to installing The software of target widget.Described transmission control obtains request can include following two situation:
Situation one, described control obtain request in carry window handle, store path and storage lattice Formula, then obtains request by described control and is sent to install the software of described target widget, such as: pass through The interface that described software externally provides sends described control and obtains request.Wherein, described window handle is institute State the window handle at target widget place.The software of described installation targets control obtains receiving described control After taking request, obtain all control properties under the window that described window handle is corresponding, then according to described All control properties are stored under described store path by storage format.
Specifically, described storage format can be file format, such as: xml form, csv form etc., Described store path can be file path.Described software is by all control property foundations under described window Described file format generates file, and is stored under described file path by the file of generation, is then back to Confirmation.
Situation two, described control obtain request in carry window handle, then by described control obtain please Seek the software being sent to install described target widget.In this case, the soft of described target widget is installed Part, after receiving the acquisition request of described control, obtains all controls under the window that described window handle is corresponding Then the described all control properties got are returned by part attribute by the communication between process.
Step 103, obtains described from the control property of described software according to known target widget attribute Whole attributes of target widget.
In the present embodiment, a control has generally included many attributes, such as: control title, control Coordinate, control handle etc..Described known target widget attribute can be configured in advance by user, than As: control ID etc., this is not particularly limited by the application.Based on abovementioned steps 102, described when installing After the software of target widget obtains the control property of software described in acquisition request according to described control, in this step In Zhou, described target widget can be obtained from described control property according to known target widget attribute All attributes.
Specifically, obtaining two kinds of different situations of request for sending control in step 102, this step is also Can distinguish the following two kinds situation:
Situation one, described control obtain request and include: window handle, store path and storage format. In this case, all control properties under described window are stored in institute by the software of installation targets control State under store path, and return confirmation by the communication between process.In this step, receiving After described confirmation, all control properties under described window can be obtained from described store path, Then described target is obtained according in the known target widget attribute all control properties from described window Whole attributes of control.Such as: the software of installation targets control can be by all controls under described window Attribute is stored as tabular form, and every a line storage has whole attributes of a control, at this in the list In the case of, terminal can travel through this list, and usual described known target control property determines described target control The row at part place, then obtains whole attributes of storage in this row, to obtain the whole of described target widget Attribute.
Situation two, described control obtain request and include: window handle.In this case, described in installing All control properties under described window are returned by the software of target widget.In this step, described in receiving All control properties under the described window that process returns, then according to known target widget attribute from institute State the whole attributes obtaining described target widget in all control properties under window.
Further, in another alternative embodiment of the application, it is provided with the timeout mechanism that control obtains. Specifically, on the basis of the embodiment shown in Fig. 1, the acquisition methods of described Windows control property Also include:
In step 104, it may be judged whether get whole attributes of described target widget within the default time.
In the present embodiment, can in step 103 according to known target widget attribute from described software Control property in obtain described target widget the process of whole attributes carry out timing, and judge whether Get whole attributes of described target widget in the time preset, obtain without within the default time Get whole attributes of described target widget, then return step 102.Wherein, the described default time can To be configured by developer, this is not particularly limited by the application.
Further, developer can also arrange the number of times retried, and i.e. resending control acquisition please The number of times asked.When resending control and obtaining the number of times that the number of times arrival asked is preset, if also do not had Get whole attributes of described target widget, then can return acquisition failure information.
Optionally, in another embodiment of the application, when step 101 judging, described target widget is not During Windows standard control, can first judge whether the software of installation targets control is provided with its control The acquisition mode of attribute, if it is not, perform step 102, sends control and obtains request.If it has, Then can obtain mode by the control property that described software provides and obtain whole attributes of described target widget. As an example it is assumed that the software of installation targets control is provided with Figure recognition mode, can pass according to mouse The coordinate entered is to position target widget, then when determining that target widget is not Windows standard control, and can To be obtained whole attributes of described target widget by described Figure recognition mode, this is not made spy by the application Different restriction.
By above description it can be seen that the application is when obtaining target widget, can first judge target widget Whether it is Windows standard control, and when target widget is not Windows standard control, passes through Communication between process sends control and obtains the request software to the described target widget of installation, non-to obtain Whole attributes of Windows standard control, thus realize the acquisition to different classes of control property.
Corresponding with the embodiment of the acquisition methods of the application Windows control property, the application also provides for A kind of acquisition device of Windows control property.Device described herein can be realized by software, Can also realize by the way of hardware or software and hardware combining.As a example by implemented in software, the application The acquisition device of Windows control property, as the device on a logical meaning, is to be set by its place Computer program instructions corresponding in nonvolatile memory is read operation shape in internal memory by standby processor Become.
Refer to Fig. 2 and Fig. 3, the application provides the acquisition device 200 of a kind of Windows control property, Can apply in terminal, described device 200 includes: judging unit 201, transmitting element 202, obtain Take unit 203 and retransmission unit 204.
Wherein, described judging unit 201, it is judged that whether target widget is Windows standard control;
Described transmitting element 202, when described target widget is not Windows standard control, by entering Cheng Tongxin sends control and obtains the request software to the described target widget of installation, for described software according to institute State control and obtain the control property of software described in acquisition request;
Described acquiring unit 203, according to known target widget attribute from the control property of described software Obtain whole attributes of described target widget.
Further, described control acquisition request includes: window handle, store path and storage format;
Described control obtains request, for all controls obtained in described software under this window for described software Part attribute, and all control properties under described window are stored described storage road with described storage format In footpath;
Described acquiring unit 203, specifically obtains all controls under described window from described store path Attribute, and obtain described target according in the known target widget attribute all controls from described window Whole attributes of control.
Further, described control acquisition request includes: window handle;
Described control obtains request, for all controls obtained in described software under this window for described software Part attribute, and all control properties under described window are returned;
Described acquiring unit 203, concrete receives under the described window that described software is returned by process communication All control properties, and obtain according in the known target widget attribute all controls from described window Take whole attributes of described target widget.
Described retransmission unit 204, is not getting the whole of described target widget within the default time During attribute, resend control and obtain request to the software installing described target widget.
Further, described retransmission unit 204, obtain the number of times arrival of request in advance when resending control If number of times time, if the most not getting whole attributes of described target widget, then return obtain unsuccessfully Information.
In said apparatus, the function of unit and the process that realizes of effect specifically refer in said method corresponding Step realize process, do not repeat them here.
The foregoing is only the preferred embodiment of the application, not in order to limit the application, all at this Within the spirit of application and principle, any modification, equivalent substitution and improvement etc. done, should be included in Within the scope of the application protection.

Claims (10)

1. the acquisition methods of a Windows control property, it is characterised in that described method includes:
Judge whether target widget is Windows standard control;
If described target widget is not Windows standard control, then sends control by process communication and obtain Take the request software to the described target widget of installation, obtain request for described software according to described control and obtain Take the control property of described software;
From the control property of described software, described target widget is obtained according to known target widget attribute All attributes.
Method the most according to claim 1, it is characterised in that
Described control obtains request and includes: window handle, store path and storage format;
Described control obtains request, for all controls obtained in described software under this window for described software Part attribute, and all control properties under described window are stored described storage road with described storage format In footpath;
Target widget attribute known to described basis obtains described target widget from the control of described software All attributes, including:
The all control properties under described window are obtained from described store path;
Described target widget is obtained according in the known target widget attribute all controls from described window Whole attributes.
Method the most according to claim 1, it is characterised in that
Described control obtains request and includes: window handle;
Described control obtains request, for all controls obtained in described software under this window for described software Part attribute, and all control properties under described window are returned;
Target widget attribute known to described basis obtains described target widget from the control of described software All attributes, including:
Receive all control properties under the described window that described software is returned by process communication;
Described target widget is obtained according in the known target widget attribute all controls from described window Whole attributes.
Method the most according to claim 1, it is characterised in that described method also includes:
Without getting whole attributes of described target widget within the default time, then resend Control obtains request to the software installing described target widget.
Method the most according to claim 4, it is characterised in that described method also includes:
When resending control and obtaining the number of times that the number of times arrival asked is preset, if the most do not got Whole attributes of described target widget, then return and obtain failure information.
6. the acquisition device of a Windows control property, it is characterised in that described device includes:
Judging unit, it is judged that whether target widget is Windows standard control;
Transmitting element, when described target widget is not Windows standard control, is sent out by process communication Send control to obtain the request software to the described target widget of installation, obtain according to described control for described software Take the control property of software described in acquisition request;
Acquiring unit, obtains described from the control property of described software according to known target widget attribute Whole attributes of target widget.
Device the most according to claim 6, it is characterised in that
Described control obtains request and includes: window handle, store path and storage format;
Described control obtains request, for all controls obtained in described software under this window for described software Part attribute, and all control properties under described window are stored described storage road with described storage format In footpath;
Described acquiring unit, specifically obtains all control properties under described window from described store path, And obtain described target widget according in the known target widget attribute all controls from described window All attributes.
Device the most according to claim 6, it is characterised in that
Described control obtains request and includes: window handle;
Described control obtains request, for all controls obtained in described software under this window for described software Part attribute, and all control properties under described window are returned;
Described acquiring unit, the concrete institute received under the described window that described software is returned by process communication There is control property, and according to the known target widget attribute all controls from described window obtain institute State whole attributes of target widget.
Device the most according to claim 6, it is characterised in that described device also includes:
Retransmission unit, when not getting whole attribute of described target widget within the default time, Resend control and obtain request to the software installing described target widget.
Device the most according to claim 9, it is characterised in that
Described retransmission unit, arrives, when the number of times resending control acquisition request, the number of times preset further Time, if the most not getting whole attributes of described target widget, then return and obtain failure information.
CN201510137093.7A 2015-03-26 2015-03-26 The acquisition methods of a kind of Windows control property and device Pending CN106155712A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510137093.7A CN106155712A (en) 2015-03-26 2015-03-26 The acquisition methods of a kind of Windows control property and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510137093.7A CN106155712A (en) 2015-03-26 2015-03-26 The acquisition methods of a kind of Windows control property and device

Publications (1)

Publication Number Publication Date
CN106155712A true CN106155712A (en) 2016-11-23

Family

ID=57340283

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510137093.7A Pending CN106155712A (en) 2015-03-26 2015-03-26 The acquisition methods of a kind of Windows control property and device

Country Status (1)

Country Link
CN (1) CN106155712A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108008955A (en) * 2017-12-15 2018-05-08 北京小米移动软件有限公司 Show the method, apparatus of self-defined control information
CN108920045A (en) * 2018-06-21 2018-11-30 上海二三四五网络科技有限公司 A kind of control method and control device of Fast Installation application program

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007014297A2 (en) * 2005-07-26 2007-02-01 Invensys Systems, Inc. Method and system for hierarchical namespace
CN1988448A (en) * 2005-12-23 2007-06-27 华为技术有限公司 Communication device and its interactive method between modules
CN102467442A (en) * 2010-11-02 2012-05-23 腾讯科技(深圳)有限公司 Software testing method, system and equipment
CN102541728A (en) * 2010-12-14 2012-07-04 北京新媒传信科技有限公司 Method for expanding identifiable control of automatic test tool
CN104461892A (en) * 2014-12-15 2015-03-25 北京国双科技有限公司 User-defined control acquiring method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007014297A2 (en) * 2005-07-26 2007-02-01 Invensys Systems, Inc. Method and system for hierarchical namespace
CN1988448A (en) * 2005-12-23 2007-06-27 华为技术有限公司 Communication device and its interactive method between modules
CN102467442A (en) * 2010-11-02 2012-05-23 腾讯科技(深圳)有限公司 Software testing method, system and equipment
CN102541728A (en) * 2010-12-14 2012-07-04 北京新媒传信科技有限公司 Method for expanding identifiable control of automatic test tool
CN104461892A (en) * 2014-12-15 2015-03-25 北京国双科技有限公司 User-defined control acquiring method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108008955A (en) * 2017-12-15 2018-05-08 北京小米移动软件有限公司 Show the method, apparatus of self-defined control information
CN108008955B (en) * 2017-12-15 2021-01-01 北京小米移动软件有限公司 Method and device for displaying user-defined control information
CN108920045A (en) * 2018-06-21 2018-11-30 上海二三四五网络科技有限公司 A kind of control method and control device of Fast Installation application program

Similar Documents

Publication Publication Date Title
KR102360926B1 (en) Autofill user devices
US20090240814A1 (en) Unified pairing for wireless devices
US20140109114A1 (en) Dynamic application programming interface publication for providing web services
US9558055B2 (en) System level memory leak detection
CN102419729A (en) Parallel test execution
CN101371230B (en) Reporting information to a network
CN108471343B (en) Method and device for determining communication check code, and communication check method and system
CN106155712A (en) The acquisition methods of a kind of Windows control property and device
CN109815120A (en) Test method, device, computer equipment and the storage medium of application
CN106201864A (en) A kind of application programming interface API method of testing, device and mobile device
CN102708032B (en) Method and device for detecting hot plug of secure digital card
KR20170010300A (en) Methods for processing request message in M2M system and Apparatuses thereof
US20080195671A1 (en) Device Management System Using Log Management Object and Method for Generating and Controlling Logging Data Therein
CN110789580A (en) Communication detection method, equipment and system of train network control system
US9880813B2 (en) RTE code generating method and apparatus performing the same
US20140218181A1 (en) Method and apparatus for controlling device
US20220272009A1 (en) Incorporation of a trace visualization with a traffic graph visualization in a service mesh
CN110839018A (en) File transmission method and system based on power distribution automation
CN106789304B (en) Network equipment configuration synchronization method and device
US20150089298A1 (en) Methods, systems, and computer-readable media for testing applications on a handheld device
CN103970515A (en) Control method and system for client and interface resource thereof
CN111131369B (en) APP use condition transmission method and device, electronic equipment and storage medium
CN113852610A (en) Message processing method and device, computer equipment and storage medium
KR101415270B1 (en) Network system monitoring application installed on computing device
CN105450410A (en) Verifying method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20200918

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200918

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

TA01 Transfer of patent application right
RJ01 Rejection of invention patent application after publication

Application publication date: 20161123

RJ01 Rejection of invention patent application after publication