CN104679519A - Method and device for acquiring functions of graphic user interface software - Google Patents
Method and device for acquiring functions of graphic user interface software Download PDFInfo
- Publication number
- CN104679519A CN104679519A CN201510104809.3A CN201510104809A CN104679519A CN 104679519 A CN104679519 A CN 104679519A CN 201510104809 A CN201510104809 A CN 201510104809A CN 104679519 A CN104679519 A CN 104679519A
- Authority
- CN
- China
- Prior art keywords
- menu
- node
- software
- window
- control
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Landscapes
- Digital Computer Display Output (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention discloses a method and a device for acquiring the functions of graphic user interface software. The method comprises the following steps: analyzing the user interface of tested software by using a Microsoft user interactive automation (MS-UIA) framework provided by a Windows operating system, and acquiring menu type and dialog box type control elements in a main interface; acquiring a sub-menu or sub-dialog box window by automatically triggering the click events of menus and controls, and finding out elements included in the menu type or dialog box type controls of all hierarchies of the tested software recursively; analyzing a menu hierarchical relationship or a dialog box window calling relationship to obtain the functional composition structure of the tested software. By adopting the method and the device for acquiring the functions of the graphic user interface software, the functions of the graphic interface software can be acquired automatically, rapidly and accurately.
Description
Technical field
The present invention relates to technical field of software engineering, particularly relate to a kind of graphical user interface software function acquisition methods and device.
Background technology
Graphic User Interface software is simple to operate with it, intuitively, be conveniently used widely, compared with embedded software, Graphic User Interface software comprises a lot of windows, a lot of control is comprised again in each window, the various combination of these window controls constitutes the different function of software, user, by the control on operation interface, realizes the function of regulation.The diversity of window control and the complicacy of combination, cause being difficult to by the function of conventional method acquisition designed by software, namely allow to accomplish, its workload is also very large.
Software function is the important attribute of software, is the basis of the work such as software size tolerance, software development and the estimation of test job amount.At present, software requirement mainly comes from Software Requirement Specification document, software development V model traditionally, software development needs through several stages such as demand analysis → Outline Design → detailed design → coding → tests, wherein, software requirement analysis is the work first needing to carry out, and in the software requirement analysis stage, specifies the demand of software.There are the following problems for the determined software requirement of this development mode: 1, consistance is poor, theoretically, the documents such as Software Requirement Specification should be consistent with software version, but in detailed programs, due to a variety of causes, developer is difficult to the software requirement that upgrades in time, causes software requirement to there is larger difference with actual software; 2, software function acquisition workload is large.Graphical user interface software function is various and complicated, is no matter by reading related software document or by actual executive software, workload is all very large.
Along with widely using of the new software development model such as rapid prototype development, software development enters the epoch of iteratively faster, the degree of dependence of developer to software requirement there occurs change, could start programing work after no longer requiring first clearly detailed software requirement.
In view of this, for filling up the blank of the function automatic acquisition technology of existing technical field of software engineering, and the technical matters existed in software function is obtained for graphic user interface, be necessary to provide a kind of new graphical user interface software function acquisition methods and device, the function that Graphic User Interface software has can be obtained automatically, quickly and accurately.
Summary of the invention
In order to solve the problem, a kind of graphical user interface software function acquisition methods provided by the invention and device, can obtain the function that Graphic User Interface software has automatically, quickly and accurately.
The invention provides a kind of graphical user interface software function acquisition methods, comprise: S1, the Microsoft user interactions robotization MS-UIA framework utilizing Windows operating system to provide, the user interface of tested software is analyzed, obtains the menu class in main interface and dialog class control element; S2, by automatically triggering the click event of menu and control, obtain secondary menu or secondary dialog box window, according to this mode, recurrence finds out the element comprised in the menu class of all levels of tested software or dialog class control; S3, by analyzing menu hierarchical relationship or dialog box window call relation, draw the function composition structure of tested software.
As a kind of embodiment, described step S1 comprises further: the root node being built control tree in window by current window handle, use the TreeWalker class that UIA framework provides, employing extreme saturation algorithm recurrence Construction take current window as the control tree of root node, thus obtains all controls and information thereof in window.
As a kind of embodiment, described employing extreme saturation algorithm recurrence Construction take current window as the control tree of root node, comprises further: using the starting point of the main window parameter rootElement of tested program as traversal; First find first child node of rootElement during traversal, if this node is menu control, then need all child nodes traveling through current node, at this moment, first launched by menu, then call the Invoke control scheme of the child node after expansion, other node types here do not process; The child node control of recursive traversal current node, after processing child node control, the sibling of process current node.
As a kind of embodiment, the hierarchical relationship of described menu or dialog box obtains, and comprise further: all controls and the information thereof that acquire the main interfaces windows of tested software, this information is shown with tree structure; Carry out filtering according to control type ControlType attribute and obtain the interface element that control type is menu or dialog box; When control type is menu interface element, obtaining master menu, triggering GUI event by calling invoke control scheme, the artificial operation clicking menu item of simulation, the Submenu Items of recursive lookup the current set of menu, and the hierarchical relationship of preserving master menu and submenu; When control type is dialog interface element, obtain main window, GUI event is triggered by calling invoke control scheme, the artificial operation clicking each button of simulation, the subwindow of recursive lookup current window, to obtain the call relation between window, and the call relation between window is saved as the hierarchical relationship of main window and subwindow.
As a kind of embodiment, the Submenu Items of described recursive lookup the current set of menu, and preserve the hierarchical relationship of master menu and submenu, comprise further: import main window node into, and obtain first child node; Judge whether this node is empty, if this node is non-NULL, then judges whether this node is menu, if this node is menu, enters Invoke control scheme further, and recursive traversal child node, if this node is not menu, recursive traversal child node; If this node is not menu, recursive traversal child node; After recurrence, the process brotgher of node; If this node is sky, terminate.
As a kind of embodiment, the subwindow of described recursive lookup current window, to obtain the call relation between window, and saves as the hierarchical relationship of main window and subwindow by the call relation between window, comprises further: import main window node into; Obtain first child node; Judge whether this node is empty, if this node is non-NULL, judges whether this node is button, if this node is button, then enters Invoke control scheme further, and recursive traversal child node, with the aftertreatment brotgher of node; If this node is not button, terminate; If this node is sky, terminate.
As a kind of embodiment, described S3 comprises further: menu level call relation chained list and window call in chained list the functional imperative containing software, stop to certain the function that node constitutes software from the start node of chained list, all paths of chained list constitute the function that software has; After obtaining menu and window and level call relation thereof respectively, first find all child nodes of function, find from this child node funcall relation upwards by backtracking, chained list is called by traverse menus level call relation chained list and window, and traversing result is converted to text display manner and graphic display mode respectively, to obtain all functions and the function composition structural drawing of tested software.
Present invention also offers a kind of graphical user interface software function acquisition device, comprise: ultimate analysis module, the Microsoft user interactions robotization MS-UIA framework provided for utilizing Windows operating system, the user interface of tested software is analyzed, obtains the menu class in main interface and dialog class control element; Analytic hierarchy process module, for the click event by automatically triggering menu and control, obtains secondary menu or secondary dialog box window, according to this mode, and recurrence finds out the element comprised in the menu class of all levels of tested software or dialog class control; Structural generation module, for by analyzing menu hierarchical relationship or dialog box window call relation, draws the function composition structure of tested software.
The technical scheme provided as can be seen from the embodiment of the invention described above, adopts method proposed by the invention and device, directly can extract the function designed by software from software interface, revolutionize the obtain manner of software function.This method can reduce the workload of developer on the one hand, and the time of writing software requirement document can be used for software function and realize by developer more, improves software development efficiency; The consistance of software requirement and final software can be ensured on the other hand.Because software requirement derives from the execution result interface of final software, developer no longer needs manual frequent updating software requirement document, fundamentally solves Software functional requirements and the inconsistent difficult problem of software simulating.
The aspect that the present invention adds and advantage will part provide in the following description, and these will become obvious from the following description, or be recognized by practice of the present invention.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme of the embodiment of the present invention, below the accompanying drawing used required in describing embodiment is briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of the graphical user interface software function acquisition methods of one embodiment of the invention;
Fig. 2 is the acquisition window control of one embodiment of the invention and the schematic flow sheet of information thereof;
Fig. 3 is the schematic flow sheet of the acquisition menu level call relation of one embodiment of the invention;
Fig. 4 is the schematic flow sheet of the acquisition window call relation of one embodiment of the invention;
Fig. 5 is the schematic flow sheet obtaining function for menu class software scene of one embodiment of the invention;
Fig. 6 is the structural representation of the menu class software interface control tree of one embodiment of the invention;
Fig. 7 is the structural representation of the menu class menu level call relation of one embodiment of the invention;
Fig. 8 is the function composition diagram of the Students'Management System software of one embodiment of the invention;
Fig. 9 is the feature path figure of the Students'Management System software of one embodiment of the invention;
Figure 10 is the schematic flow sheet of the graphical user interface software function acquisition methods of one embodiment of the invention.
Embodiment
Be described below in detail embodiments of the present invention, the example of described embodiment is shown in the drawings, and wherein same or similar label represents same or similar element or has element that is identical or similar functions from start to finish.Being exemplary below by the embodiment be described with reference to the drawings, only for explaining the present invention, and can not limitation of the present invention being interpreted as.
Those skilled in the art of the present technique are appreciated that unless expressly stated, and singulative used herein " ", " one ", " described " and " being somebody's turn to do " also can comprise plural form.Should be further understood that, the wording used in instructions of the present invention " comprises " and refers to there is described feature, integer, step, operation, element and/or assembly, but does not get rid of and exist or add other features one or more, integer, step, operation, element, assembly and/or their group.Should be appreciated that, when we claim element to be " connected " or " coupling " to another element time, it can be directly connected or coupled to other elements, or also can there is intermediary element.In addition, " connection " used herein or " coupling " can comprise wireless connections or couple.Wording "and/or" used herein comprises one or more arbitrary unit listing item be associated and all combinations.
Those skilled in the art of the present technique are appreciated that unless otherwise defined, and all terms used herein (comprising technical term and scientific terminology) have the meaning identical with the general understanding of the those of ordinary skill in field belonging to the present invention.Should also be understood that those terms defined in such as general dictionary should be understood to have the meaning consistent with the meaning in the context of prior art, unless and define as here, can not explain by idealized or too formal implication.
For ease of the understanding to the embodiment of the present invention, be further explained explanation below in conjunction with accompanying drawing for several specific embodiment, and each embodiment does not form the restriction to the embodiment of the present invention.
For this situation and current faced the problems referred to above, the present invention proposes the method being obtained software function by the graphic user interface of analysis software, mainly solve the function technical matters obtaining software how quickly and accurately and have.
Graphic user interface class software, its displaying interface mode is mainly divided into two kinds: based on menu window and the interface based on dialog box window.Although these two kinds of graphic user interface class software show styles are different, identical method can be adopted to obtain software function.Microsoft UI Automation (the being called for short UIA) framework that this programme mainly utilizes Microsoft's Windows operating system to provide, the user interface of tested software is analyzed, obtain the menu in main interface and control element, then by automatically triggering the click event of menu and control, obtain secondary menu or secondary dialog box window, mode according to this, recurrence finds out the element comprised in the menu of all levels of tested software or dialog box, by analyzing menu hierarchical relationship or dialog box window call relation, draw the function composition structure of tested software.Main for tested software boundary division as shown in Figure 1, is menu class software and dialog class software by the main working process of this programme; Obtain main interface menu item for menu class software, obtain main interface button control for dialog class software; Recursion method is adopted to obtain menu hierarchical relationship and window call relation respectively; According to menu hierarchical relationship and window call relation systematic function and function composition diagram.
Microsoft's user interactions robotization (Microsoft UI Automation is called for short " MS-UIA ") framework is a substitute of MSAA technology: namely allow control and application program have better accessibility (accessible).Briefly, it is exactly several dll, provides a set of API and Interface, and corresponding pattern, allow the developer of software follow this pattern and go to realize corresponding interface, thus the user of software can better use this software.IA has redesigned a set of framework, no matter is to traditional winform, or new wpf, defines a set of unified model; The use of its API is also relatively simpler; Meanwhile, together with .net framework 3.0, also there is the instrument of individual UISpy, everybody can be assisted to use UIA.
MS-UIA exactly defines two role:UIA Provider and software itself, mainly the developer of software goes to realize relevant interface according to corresponding pattern, UIA Client and automatized script and relevant assistive technology applications, from the angle of tester, mainly call corresponding API and go to realize automatic test script.
UIA Provider: developer determines control behavior and realizes corresponding UIA control pattern, for standard control, acquiescence supports UIA, and for self-defining control, need the interface that the behavior realizing this control defines corresponding to UIA.
UIA Client: comparatively speaking, UIA Client is then simple a lot, and only need call relevant UIA API has removed automatic test script.
UIA mainly contains 4 DLL:UIAutomationProvider.dll, defines the interface of various actions, such as, supposes there is a self-defining control, and developer thinks that it needs to support Dock behavior, just needs to realize IDockProvider interface.UIAutomaitonClient.dll, defines various control scheme, and some are used for supporting the subsidiary conditions search class of better orient control.UIAutomationCore.dll is then used to support the communication between UIA provider and client.The standard control that UIAutomationClientssideProviders.dll is then mainly used for supporting traditional winform.
The Tree Model of UIA, in UIA, each part of program UI is considered to an AutomationElement class, they are tree-shaped structures, Desktop is considered to the root of the UIA dendrogram of each windows based app, from the definition of class, we also can see the RootElement attribute having a static in an AutomationElement class.In the structure of this tree, one has View Model in 3, is respectively Raw View, Control View and Content View.The information that Raw View provides is maximum, is also the basis of other view, is close to the programming structure of program itself most; Control View is the subset of Raw View, it be close to most final user can the UI structure of perception, but it does not comprise can not be mutually mutual with user some UI, the header of such as Iistview, toolbar etc.Content View is then a subset of Control View, and it only comprises the control of energy and user's direct interaction real information, such as accepts the Textbox of input through keyboard, selects the Combobox of different value; The controls such as such as Iable then can not be included in wherein.Everybody can open UISpy, for certain application, looks at what 3 view have different, has one like this and be familiar with more intuitively.
The Control Pattern of UIA, UIA probably define altogether 38 kinds of pattern, represent conventional control behavior, and they also can provide some concrete functional attributes.For UIA Provider, the thing done is exactly the relevant behavior of definition control, finds the pattern that the behavior is corresponding, and realizes this pattern; For client, namely access relevant method and attribute, realize robotization.As certain control needs ValuePattern, then what provider with client was corresponding is then:
Clients | Provider | Description |
ValuePattern | IValuePattern | Set or get value |
The Properties of UIA, each property are identified by a numeral and name, and the digital ID of provider determines attribute request; Client then obtains the content of concrete a certain attribute by AutomationProperty class.
The Events of UIA, UIA adopt subscribe model, instead of former broadcast event model.Define four kinds of event types: Property change, Element action, Structure change and Global desktop change.
The relation of the class of several key, if utilize UIA to do automatic test, several classes with the most use are exactly AutomatonElement, the Condition of various Pattern and several assisted search, they are all under the name space of the System.Windows.Automation of UIAutomationClent.dll: in AutomationElement class, define various conventional control property, event and we start the RootElement that mentions; Each attribute is an AutomationProperty type; And each event is AutomationEvent type, they are all inherited from Automationldentifier class.And for each Pattern, then define that this Pattern supports conventional method and attribute.
2.1 control information obtain
Various different types of control is comprised in graphic user interface, as menu, text box, dialog box, list box, from the angle of composition software function, only have menu control relevant with software function with button control, therefore, only need consider the information how obtaining this two classes control and comprise, wherein menu class control mainly obtains each menu item in window interface, and dialog class control mainly obtains the button control in window interface.Achieve the above object, first Water demand graphic user interface class software interface element organizational form.Find by analyzing, under UIA framework in Windows operating system, element in interface all arranges according to tree structure, the startup interface of software is the root node of this tree structure, these elements can conduct interviews with the form of AutomationElement object, and obtain the multiple attribute of object by AutomationID, Name, ControlType etc.Simultaneously, adopt TreeWalker/FindAll method can travel through object and conditioning inquiry, like this, for certain window, the process obtaining the control that this window comprises in fact just becomes the process of the tree structure that traversal is root node with this window.As a kind of embodiment, obtain the main flow of window control and information thereof as shown in Figure 2, input window title, and obtain window handle; Window interface element is obtained according to window handle; First child node is obtained from window interface element; Judge that whether this node is empty, if not then recursive traversal child node process the brotgher of node, if terminate.Such as, the example one hereafter provided is the key code realizing obtaining control and information thereof in window.
As shown in Figure 2, the core concept of the method is the window handle obtaining current window, the root node of control tree in window is built by current window handle, use the TreeWalker class that UIA framework provides, employing extreme saturation algorithm recurrence Construction take current window as the control tree of root node, thus obtains all controls and information thereof in window.Specific implementation process is: by calling Windows api function FindWindow (null, title), and wherein parametric t itle is the heading character string of current lookup window, returns the window handle of this window; Call UIA framework function AutomationElement.FromHandle (hwnd), import current window handle into function, return an elements A utomationElement in UI robotization catalogue, be current window interface element herein; Call the TreeWalker.ControlViewWalker.GetFirstChild (rootElement) in TreeWalker class and TreeWalker.ControlViewWalker.GetNextSibling (elementNode) function, recursive traversal obtains the control tree of current window, finally obtains whole control that tested software current window comprises and set membership thereof.Menu class and dialog class software are all adopted and are obtained interface control and relation thereof in a like fashion.
2.2 menu level Relation acquisitions
When designing menu class software, usually according to the function of tonic chord of software and the menu item of subfunction division software, therefore, the hierarchical relationship of menu item directly reflects software function and composition situation thereof; Although dialog class software seldom occurs in large-scale or business software, because its displaying interface is succinct, operation is convenient, be still widely adopted in the design of Small Scale Software at present.For this kind of software, the call relation between window directly reflects function and the composition situation thereof of software.
Below for menu class software, elaborate the process obtaining menu level call relation.By the method introduced in 2.1 joints, first all controls and the information thereof of the main interfaces windows of tested software can be obtained, this information is shown with tree structure, then carries out filtering according to control type ControlType attribute obtaining the interface element that control type is menu.On the basis obtaining the main menu item, need to find the submenu under master menu, and set up the hierarchical relationship of menu.GUI event is triggered, the artificial operation clicking menu of simulation, the Submenu Items of recursive lookup the current set of menu, and the hierarchical relationship of preserving master menu and submenu by calling invoke control scheme.The acquisition process of dialog class software and menu class software is similar, and it is using the ControlType attribute interface element that is button as starting point, and each push-botton operation is clicked in simulation one by one, obtains call relation between window, thus obtains function and the composition thereof of software.As a kind of embodiment, obtain menu level call relation process flow diagram as shown in Figure 3, import main window node into, and obtain first child node; Judge whether this node is empty, if this node is non-NULL, then judges whether this node is menu, if this node is menu, enters Invoke control scheme further, and recursive traversal child node, if this node is not menu, recursive traversal child node; If this node is not menu, recursive traversal child node; After recurrence, the process brotgher of node; If this node is sky, terminate.Such as, the example two hereafter provided is the concise and to the point description algorithms obtaining menu hierarchical relationship.
This algorithmic function import the main window that parameter rootElement is tested program into, the starting point namely traveled through.First first child node of rootElement is found during traversal, if this node is menu control, then need all child nodes traveling through current node, at this moment, first menu is launched, then call the Invoke control scheme (being equivalent to click menu item) of the child node after expansion; Other node types here do not process.The child node control of recursive traversal current node, after processing child node control, the sibling of process current node.
2.3 window call relations obtain
As a kind of embodiment, obtain window call relation process flow diagram as shown in Figure 4, import main window node into; Obtain first child node; Judge whether this node is empty, if this node is non-NULL, judges whether this node is button, if this node is button, then enters Invoke control scheme further, and recursive traversal child node, with the aftertreatment brotgher of node; If this node is not button, terminate; If this node is sky, terminate.Such as, the example three hereafter provided is the main algorithm codes obtaining all child nodes of function.
2.4 software functions and function composition diagram generate
By the method for 2.1 and 2.2, obtain menu and window and level call relation thereof respectively, on this basis, chained list is called by traverse menus level call relation chained list and window, and traversing result is converted to text display manner and graphic display mode respectively, all functions and the function composition structural drawing of tested software can be obtained.
Menu level call relation chained list and window call in chained list the functional imperative containing software, stop to certain the function that node constitutes software from the start node of chained list, all paths of chained list constitute the function that software has, therefore, just the acquisition process of software function is become the ergodic process of chained list.Generate all child nodes that first tested software funcall routing algorithm mainly finds function, found from this child node funcall relation upwards by backtracking.
In order to obtain software function composition structural drawing, in the present invention, the main Microsoft Microsoft Automatic Graph Layout of employing drawing framework generates software function composition figure.In menu level call relation acquisition process, the menu level call relation obtained is stored with the form of chained list, save the set membership structure of menu item in this chained list, therefore, can searching loop menu level call relation chained list be passed through, obtain the set membership of menu item, then, drawing function graph.AddEdge (pc.parent, pc.child) is called, draw out the annexation of father node to child node, thus generate software function composition structural drawing.The example four hereafter provided is definition of menu level call relation list structure.
Present invention also offers a kind of graphical user interface software function acquisition device, comprise: ultimate analysis module, the Microsoft user interactions robotization MS-UIA framework provided for utilizing Windows operating system, the user interface of tested software is analyzed, obtains the menu class in main interface and dialog class control element; Analytic hierarchy process module, for the click event by automatically triggering menu and control, obtains secondary menu or secondary dialog box window, according to this mode, and recurrence finds out the element comprised in the menu class of all levels of tested software or dialog class control; Structural generation module, for by analyzing menu hierarchical relationship or dialog box window call relation, draws the function composition structure of tested software.
advantage of the present invention and good effect
Software function is the embodiment of software usefulness, adopts method proposed by the invention and device, directly can extract the function designed by software from software interface, revolutionize the obtain manner of software function.This method can reduce the workload of developer on the one hand, and the time of writing software requirement document can be used for software function and realize by developer more, improves software development efficiency; The consistance of software requirement and final software can be ensured on the other hand.Because software requirement derives from the execution result interface of final software, developer no longer needs manual frequent updating software requirement document, fundamentally solves Software functional requirements and the inconsistent difficult problem of software simulating.
In addition, adopt the method that the present invention proposes, tester can grasp the function composition of tested software intuitively, accurately and rapidly, understands the functional requirement of tested software, for Test Sample Design provides foundation; Software project management personnel intuitively, accurately and rapidly can grasp software size, for software project management provides technical support.
concrete enforcement scene
Below for the menu class software that Fig. 5 provides, describe in detail and realize specific embodiment of the invention process.This software is the administrative class software typically comprising graphic user interface, the exemplary functions such as newly-built, deletion possessing that management software has.
4.1 controls obtain
Control acquisition algorithm in adopting this programme 2.1 to save, by analyzing tested software interface, obtains window interface control tree as shown in Figure 6.Software interface window comprises the control type such as menu item, form, toolbar, tree view and title block, and wherein form, tree view are data exhibiting class control, and toolbar, title block are non-productive operation class control, and menu item control is software function class control.
4.2 menu levels obtain
According to the menu item content got, use the algorithm in 2.2 joints in this programme, obtain menu level call relation as shown in Figure 7.
4.3 software functions and function composition diagram generate
According to the menu item content got and menu hierarchical relationship, the algorithm in using this programme 2.3 to save carries out the drafting of software function composition figure and the extraction of feature path.As shown in Figure 8, as shown in Figure 9, wherein, every a line content correspond to a function of software to feature path to the function composition diagram of this Students'Management System software.
One of ordinary skill in the art will appreciate that: accompanying drawing is the schematic diagram of an embodiment, the module in accompanying drawing or flow process might not be that enforcement the present invention is necessary.
As seen through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add required general hardware platform by software and realizes.Based on such understanding, technical scheme of the present invention can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product can be stored in storage medium, as ROM/RAM, magnetic disc, CD etc., comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform the method described in some part of each embodiment of the present invention or embodiment.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, between each embodiment identical similar part mutually see, what each embodiment stressed is the difference with other embodiments.Especially, for device or system embodiment, because it is substantially similar to embodiment of the method, so describe fairly simple, relevant part illustrates see the part of embodiment of the method.Apparatus and system embodiment described above is only schematic, the wherein said unit illustrated as separating component or can may not be and physically separates, parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of module wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.Those of ordinary skill in the art, when not paying creative work, are namely appreciated that and implement.
The above; be only the present invention's preferably embodiment, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; the change that can expect easily or replacement, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.
software code example
Example one, be the main algorithm code realizing obtaining control and information thereof in window below:
Example two, be the main algorithm code obtaining menu hierarchical relationship below:
Example three, be the main algorithm code obtaining function all child nodes below:
Upwards the main algorithm code of back track function call relation is described below:
Example four, be the definition of menu level call relation list structure below:
The main code of software for drawing function composition structural drawing is described below:
private void CreateFunGraph(IList<ParentChild>pcList)
{
// create window
System.Windows.Forms.Form form=new System.Windows.Forms.Form();
// create viewer object
Microsoft.Glee.GraphViewerGdi.GViewer viewer=new Microsoft.Glee.GraphViewerGdi.GViewer (); // create graph object
Microsoft.Glee.Drawing.Graph graph=new Microsoft.Glee.Drawing.Graph(″graph″);
// draw graph of a relation
if(pcList.Count!=0)
{
foreach(ParentChild pc in pcList)
{
graph.AddEdge(pc.parent,pc.child);
}
}
viewer.Graph=graph;
form.SuspendLayout();
viewer.Dock=System.Windows.Forms.DockStyle.Fill;
form.Controls.Add(viewer);
form.ResumeLayout();
form.ShowDialog();
}
Claims (8)
1. a graphical user interface software function acquisition methods, is characterized in that, comprising:
S1, the Microsoft user interactions robotization MS-UIA framework utilizing Windows operating system to provide, analyze the user interface of tested software, obtain the menu class in main interface and dialog class control element;
S2, by automatically triggering the click event of menu and control, obtain secondary menu or secondary dialog box window, according to this mode, recurrence finds out the element comprised in the menu class of all levels of tested software or dialog class control;
S3, by analyzing menu hierarchical relationship or dialog box window call relation, draw the function composition structure of tested software.
2. method according to claim 1, is characterized in that, described step S1 comprises further:
Built the root node of control tree in window by current window handle, use the TreeWalker class that UIA framework provides, employing extreme saturation algorithm recurrence Construction take current window as the control tree of root node, thus obtains all controls and information thereof in window.
3. method according to claim 2, is characterized in that, described employing extreme saturation algorithm recurrence Construction take current window as the control tree of root node, comprises further:
Using the starting point of the main window parameter rootElement of tested program as traversal;
First find first child node of rootElement during traversal, if this node is menu control, then need all child nodes traveling through current node, at this moment, first launched by menu, then call the Invoke control scheme of the child node after expansion, other node types here do not process;
The child node control of recursive traversal current node, after processing child node control, the sibling of process current node.
4. method according to claim 3, is characterized in that, the hierarchical relationship of described menu or dialog box obtains, and comprises further:
Acquire all controls and the information thereof of the main interfaces windows of tested software, this information is shown with tree structure;
Carry out filtering according to control type ControlType attribute and obtain the interface element that control type is menu or dialog box;
When control type is menu interface element, obtaining master menu, triggering GUI event by calling invoke control scheme, the artificial operation clicking menu item of simulation, the Submenu Items of recursive lookup the current set of menu, and the hierarchical relationship of preserving master menu and submenu;
When control type is dialog interface element, obtain main window, GUI event is triggered by calling invoke control scheme, the artificial operation clicking each button of simulation, the subwindow of recursive lookup current window, to obtain the call relation between window, and the call relation between window is saved as the hierarchical relationship of main window and subwindow.
5. method according to claim 4, is characterized in that, the Submenu Items of described recursive lookup the current set of menu, and preserves the hierarchical relationship of master menu and submenu, comprises further:
Import main window node into, and obtain first child node; Judge whether this node is empty, if this node is non-NULL, then judges whether this node is menu, if this node is menu, enters Invoke control scheme further, and recursive traversal child node, if this node is not menu, recursive traversal child node; If this node is not menu, recursive traversal child node; After recurrence, the process brotgher of node; If this node is sky, terminate.
6. method according to claim 4, is characterized in that, the subwindow of described recursive lookup current window, to obtain the call relation between window, and the call relation between window is saved as the hierarchical relationship of main window and subwindow, comprises further:
Import main window node into; Obtain first child node; Judge whether this node is empty, if this node is non-NULL, judges whether this node is button, if this node is button, then enters Invoke control scheme further, and recursive traversal child node, with the aftertreatment brotgher of node; If this node is not button, terminate; If this node is sky, terminate.
7. method according to claim 1, is characterized in that, described S3 comprises further:
Menu level call relation chained list and window call in chained list the functional imperative containing software, stop the function that node constitutes software from the start node of chained list to certain, and all paths of chained list constitute the function that software has;
After obtaining menu and window and level call relation thereof respectively, first find all child nodes of function, find from this child node funcall relation upwards by backtracking, chained list is called by traverse menus level call relation chained list and window, and traversing result is converted to text display manner and graphic display mode respectively, to obtain all functions and the function composition structural drawing of tested software.
8. a graphical user interface software function acquisition device, is characterized in that, comprising:
Ultimate analysis module, the Microsoft user interactions robotization MS-UIA framework provided for utilizing Windows operating system, analyzes the user interface of tested software, obtains the menu class in main interface and dialog class control element;
Analytic hierarchy process module, for the click event by automatically triggering menu and control, obtains secondary menu or secondary dialog box window, according to this mode, and recurrence finds out the element comprised in the menu class of all levels of tested software or dialog class control;
Structural generation module, for by analyzing menu hierarchical relationship or dialog box window call relation, draws the function composition structure of tested software.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510104809.3A CN104679519B (en) | 2015-03-10 | 2015-03-10 | Graphical user interface software function acquisition methods and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510104809.3A CN104679519B (en) | 2015-03-10 | 2015-03-10 | Graphical user interface software function acquisition methods and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104679519A true CN104679519A (en) | 2015-06-03 |
CN104679519B CN104679519B (en) | 2018-05-15 |
Family
ID=53314634
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510104809.3A Active CN104679519B (en) | 2015-03-10 | 2015-03-10 | Graphical user interface software function acquisition methods and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104679519B (en) |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106227544A (en) * | 2016-07-28 | 2016-12-14 | 浪潮集团有限公司 | A kind of interface architecture implementation method based on uboot |
CN106294167A (en) * | 2016-08-16 | 2017-01-04 | 济南大学 | The automatic traversal method of Android Application Program Interface and system |
CN107168692A (en) * | 2017-04-01 | 2017-09-15 | 山东超越数控电子有限公司 | A kind of handheld subscriber interface implementing method and system based on ReWorks operating systems |
CN107169323A (en) * | 2017-05-11 | 2017-09-15 | 南京大学 | Packet inspection method is beaten again in a kind of Android application based on layout cluster figure |
CN108958847A (en) * | 2017-05-24 | 2018-12-07 | 广东爱瓦力科技股份有限公司 | A kind of Android system simulation click automatic execution method |
CN109214165A (en) * | 2017-07-04 | 2019-01-15 | 武汉安天信息技术有限责任公司 | A kind of judgment method of the rights statements legitimacy of pre-installed applications program and judge system |
CN109542553A (en) * | 2018-10-26 | 2019-03-29 | 北京慧流科技有限公司 | The information extraction method and device and storage medium of user interface UI element |
CN110457122A (en) * | 2019-07-31 | 2019-11-15 | 中国工商银行股份有限公司 | Task processing method, Task Processing Unit and computer system |
CN111142983A (en) * | 2018-11-06 | 2020-05-12 | 上海摩软通讯技术有限公司 | Method and system for managing operation interface |
CN111158746A (en) * | 2019-12-31 | 2020-05-15 | 中国银行股份有限公司 | Method and device for acquiring call relation |
CN111459365A (en) * | 2020-04-03 | 2020-07-28 | 南方电网科学研究院有限责任公司 | Method for managing user-defined consultation help application |
CN111530083A (en) * | 2020-05-26 | 2020-08-14 | 网易(杭州)网络有限公司 | Interface checking method and device |
CN112199301A (en) * | 2020-11-30 | 2021-01-08 | 北京七维视觉科技有限公司 | User interface automation test method, electronic device and storage medium |
CN113900634A (en) * | 2021-10-25 | 2022-01-07 | 联想(北京)有限公司 | Data processing method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7100150B2 (en) * | 2002-06-11 | 2006-08-29 | Sun Microsystems, Inc. | Method and apparatus for testing embedded examples in GUI documentation |
CN101916225A (en) * | 2010-09-02 | 2010-12-15 | 于秀山 | Graphical user interface software function coverage testing method |
CN102135936A (en) * | 2010-12-31 | 2011-07-27 | 华为技术有限公司 | Method and system for generating test case |
CN102243586A (en) * | 2011-07-22 | 2011-11-16 | 于秀山 | Method for automatically acquiring software function diagram |
-
2015
- 2015-03-10 CN CN201510104809.3A patent/CN104679519B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7100150B2 (en) * | 2002-06-11 | 2006-08-29 | Sun Microsystems, Inc. | Method and apparatus for testing embedded examples in GUI documentation |
CN101916225A (en) * | 2010-09-02 | 2010-12-15 | 于秀山 | Graphical user interface software function coverage testing method |
CN102135936A (en) * | 2010-12-31 | 2011-07-27 | 华为技术有限公司 | Method and system for generating test case |
CN102243586A (en) * | 2011-07-22 | 2011-11-16 | 于秀山 | Method for automatically acquiring software function diagram |
Non-Patent Citations (2)
Title |
---|
刘伟: "《基于UIA技术的软件自动化测试框架实践》", 《计算机光盘图案件与应用》 * |
金京: "《基于UIA的自动化测试框架的设计与实现》", 《中国优秀硕士学位论文全文数据库信息科技辑》 * |
Cited By (22)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106227544B (en) * | 2016-07-28 | 2019-06-18 | 山东浪潮人工智能研究院有限公司 | A kind of interface architecture implementation method based on uboot |
CN106227544A (en) * | 2016-07-28 | 2016-12-14 | 浪潮集团有限公司 | A kind of interface architecture implementation method based on uboot |
CN106294167A (en) * | 2016-08-16 | 2017-01-04 | 济南大学 | The automatic traversal method of Android Application Program Interface and system |
CN106294167B (en) * | 2016-08-16 | 2018-08-10 | 济南大学 | The automatic traversal method of Android Application Program Interfaces and system |
CN107168692A (en) * | 2017-04-01 | 2017-09-15 | 山东超越数控电子有限公司 | A kind of handheld subscriber interface implementing method and system based on ReWorks operating systems |
CN107169323A (en) * | 2017-05-11 | 2017-09-15 | 南京大学 | Packet inspection method is beaten again in a kind of Android application based on layout cluster figure |
CN108958847A (en) * | 2017-05-24 | 2018-12-07 | 广东爱瓦力科技股份有限公司 | A kind of Android system simulation click automatic execution method |
CN109214165B (en) * | 2017-07-04 | 2021-02-05 | 武汉安天信息技术有限责任公司 | Judgment method and judgment system for validity of permission declaration of pre-installed application program |
CN109214165A (en) * | 2017-07-04 | 2019-01-15 | 武汉安天信息技术有限责任公司 | A kind of judgment method of the rights statements legitimacy of pre-installed applications program and judge system |
CN109542553A (en) * | 2018-10-26 | 2019-03-29 | 北京慧流科技有限公司 | The information extraction method and device and storage medium of user interface UI element |
CN111142983A (en) * | 2018-11-06 | 2020-05-12 | 上海摩软通讯技术有限公司 | Method and system for managing operation interface |
CN111142983B (en) * | 2018-11-06 | 2024-04-09 | 上海摩软通讯技术有限公司 | Management method and system of operation interface |
CN110457122A (en) * | 2019-07-31 | 2019-11-15 | 中国工商银行股份有限公司 | Task processing method, Task Processing Unit and computer system |
CN110457122B (en) * | 2019-07-31 | 2022-02-22 | 中国工商银行股份有限公司 | Task processing method, task processing device and computer system |
CN111158746B (en) * | 2019-12-31 | 2024-01-23 | 中国银行股份有限公司 | Method and device for acquiring call relationship |
CN111158746A (en) * | 2019-12-31 | 2020-05-15 | 中国银行股份有限公司 | Method and device for acquiring call relation |
CN111459365A (en) * | 2020-04-03 | 2020-07-28 | 南方电网科学研究院有限责任公司 | Method for managing user-defined consultation help application |
CN111459365B (en) * | 2020-04-03 | 2021-06-25 | 南方电网科学研究院有限责任公司 | Method for managing user-defined consultation help application |
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 |
CN112199301A (en) * | 2020-11-30 | 2021-01-08 | 北京七维视觉科技有限公司 | User interface automation test method, electronic device and storage medium |
CN113900634A (en) * | 2021-10-25 | 2022-01-07 | 联想(北京)有限公司 | Data processing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN104679519B (en) | 2018-05-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104679519A (en) | Method and device for acquiring functions of graphic user interface software | |
EP2151773B1 (en) | Synchronous to asynchronous web page conversion | |
US7577909B2 (en) | Flexible management user interface from management models | |
US20210034336A1 (en) | Executing a process-based software application in a first computing environment and a second computing environment | |
US9021440B1 (en) | System and method for automated test script generation | |
US7925977B2 (en) | Architecture solution map builder | |
AU2014216556B2 (en) | Building applications for configuring processes | |
Kamimura et al. | Extracting candidates of microservices from monolithic application code | |
US9754230B2 (en) | Deployment of a business intelligence (BI) meta model and a BI report specification for use in presenting data mining and predictive insights using BI tools | |
US8856747B2 (en) | Enterprise JavaBeans explorer | |
US20140181154A1 (en) | Generating information models in an in-memory database system | |
CN103984626B (en) | A kind of method and device for generating test case script | |
US20080015911A1 (en) | Methods and apparatuses for developing business solutions | |
WO2016161178A1 (en) | System and method for automated cross-application dependency mapping | |
US20170220457A1 (en) | Constructing test-centric model of application | |
CN104731588B (en) | Page layout document generating method and page layout file creating apparatus | |
US11556702B2 (en) | Orchestration of crud operations for a hierarchical web service data model in a spreadsheet | |
US20120060141A1 (en) | Integrated environment for software design and implementation | |
US20050172264A1 (en) | Architecture for converting control types in a data bound user interface | |
Reinecke et al. | Phase-type fitting using HyperStar | |
CN104615544A (en) | Problem-oriented GUI software correlation function analysis method and device | |
US20200110592A1 (en) | Auto-deployment of applications | |
Mushtaq et al. | Multilingual source code analysis: State of the art and challenges | |
CN112667221A (en) | Deep learning model construction method and system for developing IDE (integrated development environment) based on deep learning | |
US20080155431A1 (en) | User interface supporting processes with alternative paths |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20230327 Address after: No. 66, Zizhuyuan Road, Haidian District, Beijing 100048 Patentee after: China Software Evaluation Center Address before: 100036 Courtyard 6, Wanshou Road, Haidian District, Beijing Patentee before: Yu Xiushan |