CN103365778A - Control test method and device - Google Patents

Control test method and device Download PDF

Info

Publication number
CN103365778A
CN103365778A CN2013102793319A CN201310279331A CN103365778A CN 103365778 A CN103365778 A CN 103365778A CN 2013102793319 A CN2013102793319 A CN 2013102793319A CN 201310279331 A CN201310279331 A CN 201310279331A CN 103365778 A CN103365778 A CN 103365778A
Authority
CN
China
Prior art keywords
control
searching
mode
search
software
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2013102793319A
Other languages
Chinese (zh)
Other versions
CN103365778B (en
Inventor
何国兴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Shangke Information Technology Co Ltd
Priority to CN201310279331.9A priority Critical patent/CN103365778B/en
Publication of CN103365778A publication Critical patent/CN103365778A/en
Application granted granted Critical
Publication of CN103365778B publication Critical patent/CN103365778B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Tests Of Electronic Circuits (AREA)

Abstract

The invention provides a control testing method and device, which are capable of reducing workload of maintenance to an object base used for testing automatization of software. The method comprises the followings: saving one or more pieces of control finding mode information in the object base, wherein the control finding mode information comprises a finding mode of finding a control according to position attribution of the control on the human-computer interface of software; receiving and finding keywords, finding out one or more controls within a predetermined finding range according to keywords and the finding way applicable to the keywords, then outputting the found controls so as to enable the controls to be tested.

Description

A kind of method and apparatus of testing control
Technical field
The present invention relates to a kind of method and apparatus of testing control.
Background technology
An of paramount importance maintenance that link is library of object in the automatic test of software also is to determine that test automation realizes one of most important aspect of cost.Traditional library of object is based on the model of control tree library of object at present, has preserved the object tree at each control place in the library of object, because the enormous quantity of control must cause in the library of object very many object trees to occur.In this case, as long as there is an object for example to cause the variation of object owing to the modification of the interface of software or logic, all object trees that comprise this object all must be revised thereupon, thereby cause the maintenance workload of library of object quite huge.
Summary of the invention
In view of this, the invention provides a kind of method and apparatus of testing control, can reduce the maintenance workload of the used library of object of the automatic test of software.
For achieving the above object, according to an aspect of the present invention, provide a kind of method of testing control.
The method of test control of the present invention comprises: preserve one or more control and search mode information in library of object, described control is searched and is comprised the mode of searching of searching control according to the position attribution of control on the man-machine interface of software in the mode information; Receive search key, according to this key word and the applicable described mode of searching of this key word, find out one or more controls in predetermined control seek scope, the control that finds out of output is for this control is tested again.
Alternatively, also preserve in the described library of object and comprise the control of searching the mode of searching of control according to the explanatory note of control and search mode information.
Alternatively, the control in the object set in the described control seek scope trunk process that is current tested software; Perhaps, the control in the object set in the process of the described control seek scope appointed object that is current tested software.
Alternatively, the described mode of searching comprise according to and described man-machine interface in the preliminary election element between the relative position mode of searching control.
According to a further aspect in the invention, provide a kind of device of testing control.
The device of test control of the present invention comprises: the library of object module, and be used for preserving one or more control and search mode information, described control is searched and is comprised the mode of searching of searching control according to the position attribution of control on the man-machine interface of software in the mode information; Receiver module is used for receiving search key; Search module, be used in predetermined control seek scope, finding out one or more controls according to this key word and the applicable described mode of searching of this key word; Output module is used for control that output finds out for test.
Alternatively, described library of object module also be used for to be preserved and is comprised the control of searching the mode of searching of control according to the explanatory note of control and search mode information.
Alternatively, the control in the object set in the described control seek scope trunk process that is current tested software; Perhaps, the control in the object set in the process of the described control seek scope appointed object that is current tested software.
Alternatively, the described mode of searching comprise according to and described man-machine interface in the preliminary election element between the relative position mode of searching control.
According to technical scheme of the present invention, mainly identify, search control according to the position of control on man-machine interface, need not to rely on the object tree path and identify control, make the structure of library of object obtain significantly simplifying, thereby significantly reduced the maintenance workload of the used library of object of software automated testing.Identify control based on the position in man-machine interface in addition, also help to find the defective of the aspect, control position that exists in the man-machine interface of software.
Description of drawings
Accompanying drawing is used for understanding the present invention better, does not consist of improper restriction of the present invention.Wherein:
Fig. 1 is the synoptic diagram according to the key step of the method for the test control of the embodiment of the invention;
Fig. 2 is the synoptic diagram of basic structure of device of the test control of basic inventive embodiments.
Embodiment
Below in conjunction with accompanying drawing example embodiment of the present invention is explained, to help understanding, they should be thought it only is exemplary comprising the various details of the embodiment of the invention.Therefore, those of ordinary skills will be appreciated that, can make various changes and modification to the embodiments described herein, and can not deviate from scope and spirit of the present invention.Equally, for clarity and conciseness, omitted the description to known function and structure in the following description.
In the present embodiment, preserve in advance one or more control and search mode information in library of object, the control is here searched and is comprised the mode of searching of searching control according to the position attribution of control on the man-machine interface of software in the mode information; Then receive search key, according to this key word and the applicable mode of searching of this key word, in predetermined control seek scope, find out one or more controls, again the control that finds out is tested.Below the technical scheme of present embodiment is elaborated.
Control in the present embodiment is searched and mainly is based on the position of control on software interface.The control seek scope pre-determines, and for example can be the control in the object set in the trunk process of current tested software; It also can be the control in the object set in the process of appointed object of current tested software.Searching according to process is in order to reduce the number of path of object dynamic lookup.Will travel through each control in the seek scope when searching control, the large I of seek scope is specified by predefined object tree number of levels, namely arranges one and searches the degree of depth.
Because be to search according to the position attribution of control on man-machine interface, so when searching, mainly obtain position attribution value and the judgement of each control.According to search strategy and control type, can there be flexile control to search mode.Below be illustrated for example.
A kind of control mode of searching is " orientation+control type ".The orientation can be divided into four kinds: upper and lower, left and right.The search key that need this moment mainly contains reference position, search direction, the control type of searching.For example, lower limb, the search direction of searching reference position and be man-machine interface be upwards, the control type is input frame, then represent to begin upwards to search the control that type is input frame from the man-machine interface lower limb.Can find out to find one or more input frames, also might not find input frame.Finding in the situation of input frame, can export first input frame that finds and this input frame is tested, then continue to search as searching reference position with the position of this input frame, namely search the position that arrives when reference position also can be set as last time and finds first control.
Need to prove that above searching not is directly to carry out in man-machine interface itself, but carries out, and specifically obtains the position attribution of each control in above-mentioned control seek scope.Because man-machine interface is under different display device or different forms state, actual size and wherein the range of a signal of each control all can change, so all be to describe with relative position at the position attribution of software interface design-time control.After getting access to the position attribution of control, whether the position attribution of determining the control that obtains according to search key meets is searched requirement.For example searching reference position is the position that found control last time, direction is upwards, the control type is input frame, then when searching control, to judge whether the current control type that traverses is input frame on the one hand, whether the position that also will judge on the other hand control found on the position of control in last time, only had two aspect conditions all to meet, and thought that just the current control that traverses is the control that will search.
The second control mode of searching is " explanatory note+orientation+control type ".Because the control that has comprises the attribute of explanatory note, for example button generally has literal on it, such as " determining ", " next step ", " submission " etc.According to this mode of searching, when whether the control that traverses in judgement is the control that will search, must be that explanatory note, orientation, control type three aspects: all meet search key and just can be confirmed to be the control that will search.
Can specify an element as object of reference, according to searching control with the relative position (upper and lower, left and right etc.) of this object of reference in man-machine interface.Object of reference can be specified equally flexibly, such as one section text, a picture or a control etc.Like this, the third control mode of searching can be " object of reference sign+orientation+control type "; The 4th kind of control mode of searching can be " object of reference sign+orientation+control type ".In addition, also can preserve in the library of object and comprise the control of searching the mode of searching of control according to the words identification of control and search mode information.That is to say that the control mode of searching also can be the mode of " explanatory note+control type ".Search mode and aforementioned similar.
When carrying out the method for test control of present embodiment, can adopt step shown in Figure 1 to carry out.Fig. 1 is the synoptic diagram according to the key step of the method for the test control of the embodiment of the invention.
Step S11: determine the control seek scope.
Step S12: receive the control search key.
Step S13: search mode information according to the control in control search key and the library of object, in the control seek scope, search control.
Step S14: the quantity of judging the control that finds.If 0, return step S12, search according to other control search keies; If 1, enter step S15; If greater than 1, enter step S16.If knownly before test should find at least one control, but confirm there is not control according to the judgement of this step, can confirm that then mistake appears in software, can start follow-up error handler.And existing mode according to object tree identification control can't be found the defective that may exist aspect the position of control on man-machine interface.
Step S15: the control that output finds.Enter step S18 after this step.
Step S16: export a control that finds.Enter step S18 after this step.
Step S17: judge whether the control that finds is all exported.If return step S12, otherwise return step S16.
Step S18: the control to output is tested.
By carrying out above flow process, the specified type in the control seek scope of determining among the step S11 and the control of position can be found out also acceptance test.Content in the used library of object only is that control is searched mode information, and than a large amount of object tree at the control place of magnanimity, the library of object structure in the present embodiment has obtained significantly simplifying, and maintenance workload also significantly reduces thereupon.
Fig. 2 is the synoptic diagram of basic structure of device of the test control of basic inventive embodiments.As shown in Figure 2, the device 20 of test control mainly comprises library of object module 21, receiver module 22, searches module 23 and output module 24.
Library of object module 21 is used for preserving one or more control and searches mode information, and described control is searched and comprised the mode of searching of searching control according to the position attribution of control on the man-machine interface of software in the mode information; Receiver module 22 is used for receiving search key; Searching module 23 is used for finding out one or more controls according to this key word and the applicable described mode of searching of this key word in predetermined control seek scope; Output module 24 is used for control that output finds out for test.Library of object module 21 also can be used for preserving and comprises the control of searching the mode of searching of control according to the explanatory note of control and search mode information.
Technical scheme according to the embodiment of the invention, mainly identify, search control according to the position of control on man-machine interface, need not to rely on the object tree path and identify control, make the structure of library of object obtain significantly simplifying, thereby significantly reduced the maintenance workload of the used library of object of software automated testing.Identify control based on the position in man-machine interface in addition, also help to find the defective of the aspect, control position that exists in the man-machine interface of software.
Ultimate principle of the present invention has below been described in conjunction with specific embodiments, but, it is to be noted, for those of ordinary skill in the art, can understand whole or any steps or the parts of method and apparatus of the present invention, can be in the network of any calculation element (comprising processor, storage medium etc.) or calculation element, realized that with hardware, firmware, software or their combination this is that those of ordinary skills use their basic programming skill just can realize in the situation of having read explanation of the present invention.
Therefore, purpose of the present invention can also be by realizing in any program of calculation element operation or batch processing.Described calculation element can be known fexible unit.Therefore, purpose of the present invention also can be only by providing the program product that comprises the program code of realizing described method or device to realize.That is to say that such program product also consists of the present invention, and the storage medium that stores such program product also consists of the present invention.Obviously, described storage medium can be any storage medium of developing in any known storage medium or future.
It is pointed out that also that in apparatus and method of the present invention obviously, each parts or each step can decompose and/or reconfigure.These decomposition and/or reconfigure and to be considered as equivalents of the present invention.And, carry out the step of above-mentioned series of processes and can order naturally following the instructions carry out in chronological order, but do not need necessarily to carry out according to time sequencing.Some step can walk abreast or carry out independently of one another.
Above-mentioned embodiment does not consist of limiting the scope of the invention.Those skilled in the art should be understood that, depend on designing requirement and other factors, and various modifications, combination, sub-portfolio and alternative can occur.Any modification of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., all should be included within the protection domain of the present invention.

Claims (8)

1. a method of testing control is characterized in that, comprising:
Preserve one or more control and search mode information in library of object, described control is searched and is comprised the mode of searching of searching control according to the position attribution of control on the man-machine interface of software in the mode information;
Receive search key, according to this key word and the applicable described mode of searching of this key word, find out one or more controls in predetermined control seek scope, the control that finds out of output is for this control is tested again.
2. method according to claim 1 is characterized in that, also preserves in the described library of object to comprise the control of searching the mode of searching of control according to the explanatory note of control and search mode information.
3. method according to claim 1 and 2 is characterized in that,
Control in the object set in the trunk process that described control seek scope is current tested software; Perhaps,
Control in the object set in the process of the appointed object that described control seek scope is current tested software.
4. method according to claim 1 and 2 is characterized in that, the described mode of searching comprise according to and described man-machine interface in the preliminary election element between the relative position mode of searching control.
5. a device of testing control is characterized in that, comprising:
The library of object module is used for preserving one or more control and searches mode information, and described control is searched and comprised the mode of searching of searching control according to the position attribution of control on the man-machine interface of software in the mode information;
Receiver module is used for receiving search key;
Search module, be used in predetermined control seek scope, finding out one or more controls according to this key word and the applicable described mode of searching of this key word;
Output module is used for control that output finds out for test.
6. device according to claim 5 is characterized in that, described library of object module also be used for to be preserved and comprised the control of searching the mode of searching of control according to the explanatory note of control and search mode information.
7. according to claim 5 or 6 described devices, it is characterized in that,
Control in the object set in the trunk process that described control seek scope is current tested software; Perhaps,
Control in the object set in the process of the appointed object that described control seek scope is current tested software.
8. according to claim 5 or 6 described devices, it is characterized in that, the described mode of searching comprise according to and described man-machine interface in the preliminary election element between the relative position mode of searching control.
CN201310279331.9A 2013-07-03 2013-07-03 A kind of method and apparatus testing control Active CN103365778B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310279331.9A CN103365778B (en) 2013-07-03 2013-07-03 A kind of method and apparatus testing control

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310279331.9A CN103365778B (en) 2013-07-03 2013-07-03 A kind of method and apparatus testing control

Publications (2)

Publication Number Publication Date
CN103365778A true CN103365778A (en) 2013-10-23
CN103365778B CN103365778B (en) 2016-12-28

Family

ID=49367183

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310279331.9A Active CN103365778B (en) 2013-07-03 2013-07-03 A kind of method and apparatus testing control

Country Status (1)

Country Link
CN (1) CN103365778B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107329898A (en) * 2017-06-30 2017-11-07 上海摩软通讯技术有限公司 Terminal interface automated testing method and system
CN107861779A (en) * 2017-09-20 2018-03-30 东软集团股份有限公司 Page object localization method and device, storage medium, electronic equipment
CN109800161A (en) * 2018-12-28 2019-05-24 网宿科技股份有限公司 A kind of components testing method of user interface, electronic equipment and can storage medium
CN113485909A (en) * 2021-06-01 2021-10-08 杭州网易云音乐科技有限公司 Test method, test device, computing device, and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5943048A (en) * 1997-11-19 1999-08-24 Microsoft Corporation Method and apparatus for testing a graphic control area
CN102024050A (en) * 2010-12-16 2011-04-20 浙江大学 Web browsing method
CN103049369A (en) * 2011-10-14 2013-04-17 阿里巴巴集团控股有限公司 Automated testing method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5943048A (en) * 1997-11-19 1999-08-24 Microsoft Corporation Method and apparatus for testing a graphic control area
CN102024050A (en) * 2010-12-16 2011-04-20 浙江大学 Web browsing method
CN103049369A (en) * 2011-10-14 2013-04-17 阿里巴巴集团控股有限公司 Automated testing method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张灿 等: "一种基于Android平台GUI录制回放工具的设计与实现", 《计算机应用与软件》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107329898A (en) * 2017-06-30 2017-11-07 上海摩软通讯技术有限公司 Terminal interface automated testing method and system
CN107861779A (en) * 2017-09-20 2018-03-30 东软集团股份有限公司 Page object localization method and device, storage medium, electronic equipment
CN109800161A (en) * 2018-12-28 2019-05-24 网宿科技股份有限公司 A kind of components testing method of user interface, electronic equipment and can storage medium
CN113485909A (en) * 2021-06-01 2021-10-08 杭州网易云音乐科技有限公司 Test method, test device, computing device, and medium
CN113485909B (en) * 2021-06-01 2023-10-27 杭州网易云音乐科技有限公司 Test method, test device, computing equipment and medium

Also Published As

Publication number Publication date
CN103365778B (en) 2016-12-28

Similar Documents

Publication Publication Date Title
US10467266B2 (en) Information query
US10268758B2 (en) Method and system of acquiring semantic information, keyword expansion and keyword search thereof
CN105446874B (en) A kind of detection method and device of resource distribution file
CN110765247B (en) Input prompting method and device for question-answering robot
CN108415941A (en) A kind of spiders method, apparatus and electronic equipment
CN103365778A (en) Control test method and device
CN117033667B (en) Knowledge graph construction method and device, storage medium and electronic equipment
US10169053B2 (en) Loading a web page
CN103886092A (en) Method and device for providing terminal failure problem solutions
CN103942264A (en) Method and device for pushing webpages containing news information
CN109426415B (en) Method and device for generating cascade selector
US10678514B2 (en) Method and device for generating code assistance information
CN112818126B (en) Training method, application method and device for network security corpus construction model
CN103870563A (en) Method and device for determining subject distribution of given text
CN108255891B (en) Method and device for judging webpage type
CN101727451B (en) Method and device for extracting information
CN115061928A (en) Micro-service automatic testing method and device, electronic equipment and storage medium
CN114116773A (en) Structured Query Language (SQL) text auditing method and device
US9189633B2 (en) Download management method and device based on android browser
CN107196789B (en) Method and device for checking base station parameters
CN103838877A (en) Method and device for pushing timeliness information webpage results based on search
KR20150027426A (en) Apparatus and Method for Verifying Scripts Automatically
CN110955813A (en) Data crawling method and device
CN114880027B (en) Method and device for checking unloading data of spacecraft memory and storage medium
CN116432185B (en) Abnormality detection method and device, readable storage medium and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant