CN109145231A - A kind of generation method, device and the electronic equipment of interface element identifier - Google Patents

A kind of generation method, device and the electronic equipment of interface element identifier Download PDF

Info

Publication number
CN109145231A
CN109145231A CN201710498557.6A CN201710498557A CN109145231A CN 109145231 A CN109145231 A CN 109145231A CN 201710498557 A CN201710498557 A CN 201710498557A CN 109145231 A CN109145231 A CN 109145231A
Authority
CN
China
Prior art keywords
interface element
identifier
page
node
interface
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
CN201710498557.6A
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.)
Alibaba Group Holding 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 CN201710498557.6A priority Critical patent/CN109145231A/en
Publication of CN109145231A publication Critical patent/CN109145231A/en
Pending legal-status Critical Current

Links

Abstract

This application discloses generation method, device and the electronic equipments of a kind of interface element identifier.Wherein, the generation method of the interface element identifier, comprising: obtain the interface element in the page;Classify according to preset classifying rules to the interface element, determines the type of the interface element;According to the type of the interface element, identifier is generated with hierarchical relationship of the interface element in the page.The technical solution realizes the automatic mark to the interface element in client end interface without artificial participate in, pass through the characteristic information auxiliary of each interface element and the hierarchical relationship of interface element in the interface of client, interface element is set using unique identifier, make interface element that can interface element be positioned and be identified in different resolution ratio, the equipment of different editions operating system, realize the setting of the identifier automated to interface element, it is readable high, set high-efficient saving human resources.

Description

A kind of generation method, device and the electronic equipment of interface element identifier
Technical field
This application involves interface display processing technology fields, and in particular to a kind of generation method of interface element identifier, A kind of monitoring method and a kind of management method of interface element of interface element.The application is related to a kind of interface element mark simultaneously Know generating means, a kind of electronic equipment, a kind of monitoring device of interface element, another electronic equipment and a kind of interface of symbol The managing device of element.
Background technique
Since the Protozoic face of mobile client has the dynamic and diversity of height, cause to differentiate in different screen Multiple devices between rate, different editions operating system are difficult uniquely to position in the client-side program of the same version, identify One interface element.What the positioning of common interface element, the unique identifier for being identified by the interface element carried out.
When user is operated using client, generally require to use the page jump during client to user from the background Situation is counted.And traditional statistical method is to after interface element manual positioning, the page demarcating identifier and carrying out buries Point can not just generate event and bury a little but if certain controls on the page of user's operation, do not trigger page jump.Once It breaks down during this or the case where other are not available, then interface element can not be positioned, asked to increase The investigation difficulty of topic.And it is also flooded with H5 (HTML 5) page, implementation and client due to the H5 page in the client The primary interface at end is very different.And for the H5 page, there was only interface element in the essential attribute of interface element Id value is unique, but in reality many H5 pages interface element without this attribute (id value), so can not be carried out to the H5 page Unique identifier setting, so as to cause accurately positioning, each interface element is relatively difficult, it is easy to interface element occurs The case where can not positioning.
It can be seen that being positioned in the interface of existing client, identifying that an interface element is more difficult, and develop Person will lead to business intrusion by manually setting the identifier of interface element, and the interface of client once changes, mark Knowing symbol will fail.In addition to this, if need to set unique identifier to multiple interface elements in the client, setting Low efficiency waste of manpower resource.
Summary of the invention
The application provides a kind of generation method of interface element identifier, the monitoring method and one kind of a kind of interface element The management method of interface element, to solve the above problem in the prior art.The application is additionally provided with a kind of interface element mark Know generating means, a kind of electronic equipment, a kind of monitoring device of interface element, another electronic equipment and a kind of interface of symbol The managing device of element.
The application provides a kind of generation method of interface element identifier, the generation method of the interface element identifier, Include:
Obtain the interface element in the page;
Classify according to preset classifying rules to the interface element, determines the type of the interface element;
According to the type of the interface element, identifier is generated with hierarchical relationship of the interface element in the page.
Optionally, the interface element obtained in the page, comprising:
Monitor the selection event to the page;
Interface element when obtaining the triggering selection event, at selection.
Optionally, the preset classifying rules, comprising:
The primary interface element of client and the interface element based on web.
Optionally, the type according to the interface element, it is raw with hierarchical relationship of the interface element in the page At identifier, comprising:
When the type of the interface element is interface element based on web, with the interface element in the page distance root The offset of node generates identifier.
Optionally, the offset with the interface element in the page apart from root node generates identifier, comprising:
Obtain the DOM tree structure in the page;
Determine the interface element, the corresponding node in the DOM tree structure;
The offset between the root node in the node and the DOM tree structure is calculated, using the offset as institute State the identifier of interface element.
Optionally, the root node is BODY node.
Optionally, the offset between the root node calculated in the node and the DOM tree structure, comprising:
Start the hierarchical relationship according to the dom tree with the node, successively obtains class node until getting upwards The root node;
According to the sequence from the root node to the hierarchical relationship of the node, will acquire described in take class node The information of information and the node, as the offset.
Optionally, the type according to the interface element, it is raw with hierarchical relationship of the interface element in the page At identifier, comprising:
When the type of the interface element is client primary interface element, is responded and closed with the view of the interface element System obtains the identifier of father's interface element;
The information of identifier and the interface element based on father's interface element generates the mark of the interface element Know symbol.
Optionally, the identifier of father's interface element, comprising:
The characteristic information of the view controller as belonging to the interface element extremely, parent circle adjacent with the interface element The group identifier of surface element at character string.
Optionally, the information of the identifier based on father's interface element and the interface element generates the boundary The identifier of surface element, comprising:
In the identifier of father's interface element, the characteristic information and view level letter of the interface element is written Breath, using the identifier of father's interface element after write-in as the identifier of the interface element.
Optionally, before the hierarchical relationship described with the interface element in the page generates the step of identifier, packet It includes:
Judge whether the interface element can respond selection event;
If it is not, then when executing the step of the hierarchical relationship generation identifier with the interface element in the page, Include:
Identifier with the characteristic information of view controller belonging to the interface element, as the interface element.
Optionally, after the hierarchical relationship described with the interface element in the page generates the step of identifier, packet It includes:
When the interface element responds selection event, the identifier of the interface element is carried out by preset mode Conversion generates storage character string;
Save the storage character string.
Optionally, after the hierarchical relationship described with the interface element in the page generates the step of identifier, packet It includes:
Show the identifier of the interface element generated.
Correspondingly, the embodiment of the present application also provides a kind of generating means of interface element identifier, the interface element The generating means of identifier, comprising:
Interface element acquiring unit, for obtaining the interface element in the page;
Element classification unit determines the boundary for classifying according to preset classifying rules to the interface element The type of surface element;
Identifier generating unit, for the type according to the interface element, with layer of the interface element in the page Grade relationship generates identifier.
Optionally, the identifier generating unit, comprising: dom tree obtains subelement, node determines subelement and offset Measure computation subunit;
The dom tree obtains subelement, for obtaining the DOM tree structure in the page;
The node determines subelement, for determining the interface element, the corresponding node in the DOM tree structure;
The offset computation subunit, for calculating between the root node in the node and the DOM tree structure Offset, using the offset as the identifier of the interface element.
Optionally, the offset computation subunit, comprising: node obtains subelement and offset obtains subelement;
The node obtains subelement, for starting the hierarchical relationship according to the dom tree with the node, upwards successively Class node is obtained until getting the root node;
The offset obtains subelement, for according to the sequence from the root node to the hierarchical relationship of the node, The information of class node and the information of the node are taken described in will acquire, as the offset.
Optionally, the identifier generating unit, comprising: father's interface element identifier obtaining unit and identifier generate Subelement;
Father's interface element identifier obtaining unit, the type for the interface element are the primary interface of client When element, the identifier of father's interface element is obtained with the view response relation of the interface element;
The identifier generates subelement, for identifier and the interface element based on father's interface element Information generates the identifier of the interface element.
Optionally, father's interface element identifier obtaining unit, the type specifically for the interface element are client When holding primary interface element, the view control as belonging to the interface element is obtained with the view response relation of the interface element The characteristic information of device processed extremely, the group identifier of the parent interface element adjacent with the interface element at character string.
Optionally, the generating means of the interface element identifier, further includes: identifier converting unit and storage are single Member;
The identifier converting unit, for generating mark in the hierarchical relationship with the interface element in the page After symbol, when the interface element responds touch event, the identifier of the interface element is carried out by preset mode Conversion generates storage character string;
The storage unit, for saving the storage character string.
Optionally, the generating means of the interface element identifier, further includes:
Identifier display unit, for the hierarchical relationship with the interface element in the page generate identifier it Afterwards, the identifier of the interface element of generation is shown.
In addition, the embodiment of the present application also provides a kind of electronic equipment, the electronic equipment, comprising:
Processor;
Memory generates program for storing interface element identifier, and described program is reading execution by the processor When, it performs the following operations: obtaining the interface element in the page;The interface element is divided according to preset classifying rules Class determines the type of the interface element;According to the type of the interface element, with level of the interface element in the page Relationship generates identifier.
In addition, the embodiment of the present application also provides a kind of monitoring method of interface element, the monitoring side of the interface element Method, comprising:
Monitor the selection event to the page;
Obtain the identifier for responding the interface element of the selection event;
The identifier of the interface element is converted by preset mode, generates storage character string;
Save the storage character string.
Optionally, described to be converted the identifier of the interface element by preset mode, generate storage character String, comprising:
The identifier of the interface element is converted by the operation mode for name of endorsing, generates storage character string.
Optionally, after the preservation storage character string the step of, comprising:
The storage character string is sent to server end.
Correspondingly, the embodiment of the present application also provides a kind of monitoring device of interface element, the monitoring of the interface element Device, comprising:
Event monitoring unit, for monitoring the selection event to the page;
Identifier obtaining unit, for obtaining the identifier for responding the interface element of the selection event;
Character generation unit, for being converted the identifier of the interface element by preset mode, generation is deposited Store up character string;
Storage unit, for saving the storage character string.
In addition, the embodiment of the present application also provides another electronic equipment, the electronic equipment, comprising:
Processor;
Memory, for storing interface element monitoring programme, described program is executed when reading execution by the processor Following operation: the selection event to the page is monitored;Obtain the identifier for responding the interface element of the selection event;By default Mode the identifier of the interface element is converted, generate storage character string;Save the storage character string.
In addition, the embodiment of the present application also provides a kind of management method of interface element, the manager of the interface element Method, comprising:
Receive the storage character string that client is sent;
The storage character string is converted by preset mode, obtains the identifier of interface element;
Monitor the selection event to the page;
Display responds the identifier of the interface element of the selection event;
By the identifier of the interface element obtained, with the identifier of the interface element for responding the selection event into Row matching, determines the identical interface element of identifier.
Optionally, described to be converted the storage character string by preset mode, obtain the mark of interface element Symbol, comprising:
The storage character string is converted by the operation mode of signature verification, obtains the mark of the interface element Symbol.
Correspondingly, the embodiment of the present application also provides a kind of managing device of interface element, the management of the interface element Device, comprising:
Character string receiving unit is stored, for receiving the storage character string of client transmission;
Identifier obtaining unit obtains Interface Element for converting the storage character string by preset mode The identifier of element;
Event monitoring unit, for monitoring the selection event to the page;
Identifier display unit, for showing the identifier for responding the interface element of the selection event;
Interface element matching unit and responds the selection thing for by the identifier of the interface element obtained The identifier of the interface element of part is matched, and determines the identical interface element of identifier.
Compared with prior art, the application has the following advantages:
Generation method, device and the electronic equipment of a kind of interface element identifier provided by the present application, by obtaining page Interface element in face;Classify according to preset classifying rules to the interface element, determines the class of the interface element Type;According to the type of the interface element, identifier is generated with hierarchical relationship of the interface element in the page.The technology Scheme realizes the automatic mark to the interface element in client end interface without artificial participate in, in client By the characteristic information auxiliary of each interface element and the hierarchical relationship of interface element in interface, unique mark is used to interface element Know symbol to be set, makes interface element can be to Interface Element in different resolution ratio, the equipment of different editions operating system Element is positioned and is identified, the setting of the identifier automated to interface element is realized, readable high, is set high-efficient Save human resources.
Monitoring method, device and the electronic equipment for a kind of interface element that the application also provides, by monitoring to the page Selection event;Obtain the identifier for responding the interface element of the selection event;By preset mode by the Interface Element The identifier of element is converted, and storage character string is generated;Save the storage character string.The technical solution recording responses are used The identifier of the interface element of the selection operation at family can pass through the mark of the interface element of record in client failures Symbol positioning failure is known, to reduce the investigation difficulty of problem.
A kind of management method for interface element that the application also provides, device, the storage word sent by receiving client Symbol string;The storage character string is converted by preset mode, obtains the identifier of interface element;It monitors to the page Selection event;Display responds the identifier of the interface element of the selection event;By the mark of the interface element obtained Symbol is matched with the identifier for the interface element for responding the selection event, determines the identical interface element of identifier. The technical solution has the interface element of identical identifier, positioning failure by determining, so that the investigation for reducing problem is difficult Degree.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The some embodiments recorded in application can also be obtained according to these attached drawings other for those of ordinary skill in the art Attached drawing.
Fig. 1 shows the flow chart of the generation method of the interface element identifier provided according to an embodiment of the present application;
Fig. 2 shows the processes of the offset for calculating interface element and root node provided according to an embodiment of the present application Figure;
Fig. 3 shows the signal of the offset for calculating interface element and root node provided according to an embodiment of the present application Figure;
Fig. 4 shows showing for the identifier of the interface element based on web of the generation provided according to an embodiment of the present application It is intended to;
Fig. 5 shows the signal of the identifier of the primary interface element of the generation provided according to an embodiment of the present application Figure;
Fig. 6 shows the schematic diagram of the generating means of the interface element identifier provided according to an embodiment of the present application;
Fig. 7 shows the schematic diagram of the electronic equipment provided according to an embodiment of the present application;
Fig. 8 shows the flow chart of the monitoring method of the interface element provided according to an embodiment of the present application;
Fig. 9 shows the schematic diagram of the monitoring device of the interface element provided according to an embodiment of the present application;
Figure 10 shows the schematic diagram of another electronic equipment provided according to an embodiment of the present application;
Figure 11 shows the flow chart of the management method of the interface element provided according to an embodiment of the present application;
Figure 12, which shows to provide according to an embodiment of the present application, shows identifier to after interface element progress selection operation Schematic diagram;
Figure 13 shows the schematic diagram of the managing device of the interface element provided according to an embodiment of the present application.
Specific embodiment
It is with reference to the accompanying drawing and specific real in order to be more clearly understood that the above objects, features, and advantages of the application Mode is applied the application is further described in detail.It should be noted that in the absence of conflict, the implementation of the application Feature in example and embodiment can be combined with each other.
Many details are explained in the following description in order to fully understand the application.But the application can Implemented with being much different from other way described herein, those skilled in the art can be in the feelings without prejudice to the application intension Similar popularization is done under condition, therefore, the application is not limited by following public specific implementation.
Embodiments herein provides a kind of generation method of interface element identifier, a kind of monitoring side of interface element Method and a kind of management method of interface element.The application is related to generating means, one kind of a kind of interface element identifier simultaneously Electronic equipment, a kind of monitoring device of interface element, another electronic equipment and a kind of managing device of interface element.Under It is described in detail one by one in the embodiment in face.
At present since the Protozoic face of mobile client has the dynamic and diversity of height, cause in different screen point Multiple devices between resolution, different editions operating system are difficult uniquely to position in the client-side program of the same version, know An other interface element, and position, identify that an interface element is carried out by unique identifier of the interface element.Mesh Preceding unique identifier to setting interface element is carried out manually to interface element by developer.And in the client It is also flooded with H5 (HTML 5) page, since the implementation of the H5 page and the primary interface of client are very different.And For the H5 page, the id value of only interface element is unique in the essential attribute of interface element, but many H5 in reality The interface element of the page is without this attribute (id value), so unique identifier setting can not be carried out to the H5 page, so as to cause essence Each interface element of the positioning of standard is relatively difficult, it is easy to the case where interface element can not position occurs.It can be seen that existing It positioned in the interface of some clients, identify that an interface element is more difficult, and developer is by manually setting Interface Element The identifier of element will lead to business intrusion, and the interface of client once changes, and identifier will fail.Except this it Outside, if need to set unique identifier to multiple interface elements in the client, low efficiency waste of manpower resource is set. For this problem, in the embodiment of the present application, closed by the characteristic information auxiliary of each interface element and the level of interface element System, interface element is set using unique identifier, makes interface element in different resolution ratio, different editions operation system Interface element can be positioned and be identified in the equipment of system, to realize the mark automated to interface element The setting of symbol.
Before the specific steps of detailed description the present embodiment, first the interface element that the technical program is related to is made briefly It is bright.
Interface element refers to the text shown in interface, picture, link, button, title etc., according to interface element Type can be divided into Native interface element and H5 interface element.
Native interface element refers to: the interface element in the primary page in the client.Native exploitation refers to biography It unites APP development mode (primary APP development mode), which will adopt for different intelligent operating systems such as IOS, Android It is developed with different language and frame, which is usually by " Cloud Server data+APP applications client " two part structures At APP is installed on intelligent terminal using all UI elements, data content, logical framework.
H5 (HTML 5) interface element refers to: passing through the interface element in the page of web presentation in the client.Web is opened Hair refers to a kind of frame-type APP development mode (HTML 5APP Development of Framework mode), which has cross-platform advantage, should Mode is usually made of " HTML5 cloud website+APP applications client " two part, and APP applications client need to only install the frame of application Frame part, and the data applied are then each when open APP goes cloud access according to being presented to the user.
Embodiments herein provides a kind of generation method of interface element identifier, the interface element identifier Generation method can be implemented in the client, by the way that the realization module (sdk) of the identifier of interface element is integrated into app, And by way of runtime sdk is loaded in app operation, interface element is automated to realize The setting of identifier.
It should be noted that runtime is a run-time library (Runtime Library) of Objective-C, it is One main library write using C and compilation, is added to the ability of object-oriented and creates Objective-C for C.It believes in class It is loaded in breath (Class information), completes all method distribution and method forwarding.
Sdk refer to Software Development Kit (Software Development Kit) be some software engineers be it is specific Developing instrument when establishing application software such as software package, software frame, hardware platform, operating system set.
The embodiment of the method for the streaming layout interface rendering is as follows:
Referring to FIG. 1, it illustrates the generation methods of the interface element identifier provided according to an embodiment of the present application Flow chart.
The generation method of the interface element identifier, comprising:
Step S101 obtains the interface element in the page.
In the present embodiment, the interface element obtained in the page, can realize in the following way: receive user couple The selection operation in the page that client is shown, and obtain the interface element at the selection operation.
It should be noted that then user is to visitor when the client is operated in on the smart machine for touching screen The selection operation in the page that family end is shown is the touch operation of the page inner boundary element shown to client;As the visitor When family end is operated on the smart machine of non-touch screen, then the selection operation in the page that user customer is shown, is user The page inner boundary element that client is shown by external input device selection operation (such as: carried out a little by mouse It hits).
When receiving the selection operation in the page that user customer is shown, position selected by user can be got Coordinate information, and interface element that is determining by the coordinate information and obtaining the selected place of user.
In the specific implementation, the interface element obtained in the page, may include steps of:
Monitor the selection event to the page;
Interface element when obtaining the triggering selection event, at selection.
It should be noted that if when the client is operated in on the smart machine for touching screen, the selection thing Part includes at least following event:
TouchesBegan:withEvent: screen Times is touched in finger and accuses UITouchPhaseBegan event;
TouchesMoved:withEvent: UITouchPhaseMoved event is reported when finger moves on the screen;
TouchesEnded:withEvent: UITouchPhaseEnded event is reported when finger frames out.
In the present embodiment, after obtaining the triggering touch event, it will create a UITouch associated with finger Object, when finger frames out, system can destroy corresponding UITouch object.The in store letter relevant with finger of UITouch Breath, for example, touch position, time, stage.
UITouch object records the coordinate information of touch point by locationInView method.
It should be understood that touch event will be triggered when user touches the page, and record when event is triggered When horizontal coordinate (such as: clientX), event triggering when vertical coordinate (such as: clientY).
In the present embodiment, client is obtained according to the coordinate information of the touch point recorded when triggering the touch event Interface element at the corresponding coordinate information.
It should be noted that the essential information and choosing of the interface element can be obtained when obtaining the interface element Locating view information when taking generation.Such as: the essential information of the interface element of acquisition can be picture or text etc..
Step S103 classifies to the interface element according to preset classifying rules, determines the interface element Type.
In the present embodiment, described to classify according to preset classifying rules to the interface element, determine the boundary The type of surface element can be realized in the following way: the interface element when selection obtained in step s101 is generated Locating view information is compared with preset classifying rules, carries out the interface element according to preset classifying rules Classification, determines the type of the interface element.
It should be noted that since interface element type can be divided into Native interface element and H5 interface element, so In preset classifying rules, view (view) is defined as two class of native view and Html 5view, and in step View information locating for the interface element is exactly in native view or Html 5view when the selection generation obtained in S101 One kind can be true so view information locating for interface element when by selections that obtains in step s101 generation The type of the fixed interface element is Native interface element or H5 interface element.
Such as: view information locating for the interface element is H5view when the selection generation obtained in step s101, Then and (identical as Html 5view) is compared then in preset classifying rules can determine that the type of the interface element is H5 Interface element, same reason, if choosing view information locating for interface element when generating is native view, institute The type for stating interface element is Native interface element.
Step S105 is generated according to the type of the interface element with hierarchical relationship of the interface element in the page Identifier.
In the present embodiment, the type according to the interface element, with level of the interface element in the page Relationship generate identifier, can realize in the following way: according in step s 103 determine the interface element type, Identifier is generated with the hierarchical relationship of view locating for the interface element.
Since the type of the interface element can be divided into two classes (H5 interface element and Native interface element), so This step is described in detail with two specific examples separately below.
In the present embodiment, when the type of the interface element is interface element (the H5 interface element) based on web, institute It states the hierarchical relationship with the interface element in the page and generates identifier, can realize in the following way: with the interface Offset of the element in the page apart from root node generates identifier.
It should be noted that due to only obtaining the interface element in step s101, and the mark of the interface element Knowing symbol needs the interface element to generate according in the page apart from the offset of root node, so needing first to determine the boundary Position of the surface element in the page, it may be assumed that the position in DOM tree structure, then it is described with the interface element in the page distance The offset of root node generates identifier, specifically comprises the following steps:
Referring to FIG. 2, it illustrates the offsets of the calculating interface element and root node that provide according to an embodiment of the present application The flow chart of amount.
Step S105-1 obtains the DOM tree structure in the page,.
It should be noted that then illustrating the interface element in H5 when the type of the interface element is H5 interface element In the page, and the hierarchical structure of the H5 page is all based on HTML node tree, also referred to as DOM Document Object Model (Document ObjectModel, DOM).Node in DOM node tree possesses hierarchical relationship each other, comprising: father (parent), sub (child) With (sibling) node born of the same parents.Wherein, father node possesses child node;Child node at the same level is referred to as node born of the same parents;In node tree In, top node is referred to as root node;One node can possess any number of child node;Node born of the same parents is to possess identical father's section The node of point.
Referring to FIG. 3, it illustrates the offsets of the calculating interface element and root node that provide according to an embodiment of the present application The schematic diagram of amount.
By taking the DOM node tree in Fig. 3 as an example:
<html>node does not have father node, is root node, it possesses 2 child nodes:<head>with<body>;
<head>with<body>it is node born of the same parents;
<body>father node be<html>node, it possesses 1 child node<div1>;
<div1>father node be<body>node, it possesses 2 child nodes:<div2>with<div3>;
<div3>father node be<div1>, it possesses 1 child node<p>;
<p>father node be<div3>, it possesses 1 picture node " img ".
It should be noted that due to<body>the node definition main body of document,<body>node includes all of document Content (such as text, hyperlink, image, table and list etc..) so in subsequent calculating interface element distance in the page When the offset of root node, be with<body>root node of the node as the dom tree.
Step S105-2 determines the interface element, the corresponding node in the DOM tree structure.
In the present embodiment, the determination interface element, the corresponding node in the DOM tree structure, can adopt It is realized with such as under type: interface element corresponding node in the DOM tree structure is obtained by DOM api.
Such as: the interface element is img, it is determined that the interface element corresponding node in the DOM tree structure For picture node " img ".
Step S105-3 calculates the offset between the root node in the node and the DOM tree structure, will be described inclined Identifier of the shifting amount as the interface element.
In the present embodiment, the offset between the root node calculated in the node and the DOM tree structure, will Identifier of the offset as the interface element, can realize in the following way: calculate the interface element in institute State the offset between the root node body in DOM tree structure in corresponding node, with the DOM tree structure.
It should be noted that the offset specifically refers to the root node body from the DOM tree structure to the boundary Distance of the surface element between node corresponding in the DOM tree structure, it may be assumed that root node body is to the interface element described The path of corresponding node in DOM tree structure.
Such as: it is when the interface element in the page obtained in step s101 is img, then described with the interface element Hierarchical relationship of the img in the page generates identifier, be exactly with img node in the page distance<body>the offset of node is raw At identifier.
In the specific implementation, the offset between the root node calculated in the node and the DOM tree structure, packet Include following steps:
Start the hierarchical relationship according to the dom tree with the node, successively obtains class node until getting upwards The root node;
According to the sequence from the root node to the hierarchical relationship of the node, will acquire described in take class node The information of information and the node, as the offset.
It should be understood that described start successively to obtain parent upwards according to the hierarchical relationship of the dom tree with the node Node is the information in order to determine each father node of the interface element up to getting the root node, so that it is determined that From root to distance between leaf.
By taking the DOM node tree in Fig. 3 as an example:
When the interface element in the page obtained in step s101 is img, the interface element img is in dom tree Node is picture node " img ", then obtains the father node of the picture node " img "<p>node;And father node<P>node is not It is<body>node, so continuing to obtain<p>the father node of node<div3>node;And father node<div3>node be not< Body>node, so continuing father node<div1>node of acquisition<div3>node;And father node<div1>node be not< Body>node, so continuing to obtain<div1>the father node of node<body>node, when having determined<body>it is described after node Picture node " img " arrives<body>offset between node is<body>/<div1>/<div3>/<p>/ img.
As a preferred embodiment, when there is sibling for same level, it can be according to from left to right Reading order, to each sibling carry out digital number label, for example, under<div1>node have<div2>and< Div3>two node then carries out digital number to<div2>and is labeled as 1, carries out digital number to<div3>and is labeled as 2, then exists Execute it is described according to the sequence from the root node to the hierarchical relationship of the node, will acquire described in take class node The information of information and the node, when as the offset, the picture node " img " got is arrived<body>node Between offset are as follows:<body>/<div1>/ 2<div3>/<p>/ img.
It should be noted that the offset can be recorded by way of character string.
Illustrate below by a specific example, the type of the interface element is the interface element (interface H5 based on web Element) when, the identifier of the interface element of generation.
Referring to FIG. 4, it illustrates the marks of the interface element based on web of the generation provided according to an embodiment of the present application Know the schematic diagram of symbol.
As shown in Figure 4, identifier shown in Fig. 4 is the mark for completely subtracting the interface element in prefecture in figure shown in black surround Symbol, and the interface element for completely subtracting prefecture is the interface element based on web, and is to be nested in primary interface element, institute With the identifier of the interface element based on web for UIWindow $ 0UIView:nth-child (0) WVWebView:ntj-child (0)_UIWebViewScrollView:nth-child(0)UIWebBrowserView:nth-child(0)。
Wherein, UIWindow is the primary interface element in iOS App, and UIWindow is the Interface Element of top Interface is presented using UIWindow and UIView in element.UIWindow and the content for not including any default, but it is taken as The container of UIView, for placing UIView all in application.
UIView is responsible for rendering the content in region, and responds the touch event of generation in the region in, in iOS App from From the point of view of inheritance, UIWindow is inherited from UIView, so UIWindow is gone back other than the institute with UIView is functional Increase some distinctive attributes and method.
WVWebView is used to load webpage function inside App, can replace using WVWebView bulky Faster, committed memory is few for UIWebView speed.
ScrollView is the component that UIWebView includes, and is used to be associated with web content and realizes rolling effect, such as UIWebView is embedded into UIScrollView by fruit, and UIScrollView or so can be slided, and UIWebView is slided up and down. The inheritance link of UIWebViewScrollView are as follows: _ UIWebViewScrollView- > UIWebScrollView- > UIScrollView。
And UIWebView is a composed view, the inside includes ScrollView, is one inside ScrollView UIWebBrowserView (content for being responsible for display WebView).
: nth-child (n) selector matches the n-th daughter element for belonging to his father's element, can be any type of element, n It can be number, keyword or formula.Such as: regulation belongs to the background colour of each p of second daughter element of his father's element:
p:nth-child(2)
{
background:#ff0000;
}
It should be noted that Fig. 4 is the identifier for the interface element that the interface element based on web generates, and on the boundary The generation method of surface element identifier in actual use, can distinguish the permission of the client using the above method, as the visitor When family end is the client that client uses, the identifier of the interface element is only generated in client, without in client It is shown in end, client can not also view the identifier of the interface element when in use;When the client is exploitation When the client that person uses, then after the identifier for generating the interface element in client, it can be shown in the client, And it can check the interface element for having generated identifier.
In the present embodiment, described with described when the type of the interface element is the primary interface element of client Hierarchical relationship of the interface element in the page generates identifier, can realize in the following way: with the view of the interface element The identifier of figure response relation acquisition father's interface element;Identifier and the interface element based on father's interface element Information generates the identifier of the interface element.
It should be understood that the interface element obtains father's Interface Element of the interface element according to view response relation to upper layer The information of the interface element is written to institute after the identifier for obtaining father's interface element by the identifier of plain (father's view) The tail end for stating identifier, by the identifier after the information of the interface element after write-in, as the interface element Identifier.
It should be noted that the information of the interface element include: the characteristic information of the interface element (including but not limited to UIButton corresponds to btn feature prefix and button text;UILabel corresponds to lab feature prefix and label character etc.) and it is described View hierarchical information where interface element, and the identifier of father's interface element is recorded in the form of character string , so the tail end of the identifier of institute's father's interface element by the information of the interface element in the form of character string, can be recorded in.
Wherein the hierarchical information where the interface element refers to: by according to priority (such as UIScrollView, UITableView, UICollectionView priority are higher than other general view interface elements), the order of addition of view, be It is no hide, whether be that privately owned class is ranked up, according to after sequence in father's view elements index position generate hierarchical information.
In the present embodiment, if the interface element obtains upper the one of the interface element to upper layer according to view response relation When the identifier of grade father's interface element (father's view), the upper level father interface element generates identifier not yet, then with current On the basis of father's interface element, the father of the upper level again interface element of the upper level father interface element is obtained (relative to the interface The upper second level father interface element of element) identifier, and according to the identifier and the letter of the upper level father interface element Breath generates the identifier of the upper level father interface element and then generates identifier for the interface element.
It should be understood that if the upward several layers father interface element of the interface element does not generate identifier, by working as The view response relation of prezone surface element successively upwards first generates the mark of father's interface element on view response relation layer by layer Symbol until the view controller belonging to the interface element, then regenerates the identifier of the interface element.
It should be noted that being all to respond to close using view controller as the view in the view response relation Root node and downward successively creation view in system.Wherein the view controller be for create and administration view, it is described View controller has unique characteristic information, it may be assumed that the title of the view controller.
It should be understood that obtaining the father interface of the interface element to upper layer according to view response relation in the interface element In the identifier of element (father's view), be the view controller as belonging to the interface element characteristic information extremely, with the boundary The group identifier of the adjacent parent interface element of surface element at character string.
Such as: the identifier of the root node (view controller) in the view response relation is the title of root node;Institute State the identifier of the interface element of the second layer in view response relation are as follows: the title of root node adds the letter of the stratum boundary surface element Breath;The identifier of the interface element of third layer in the view response relation are as follows: the title of root node adds second layer Interface Element The information of element and the information of the stratum boundary surface element, until n-th layer, to form the full link identifier of the view.
Illustrate below by a specific example, when the type of the interface element is primary interface element, generation The identifier of interface element.
Referring to FIG. 5, it illustrates the marks of the primary interface element of the generation provided according to an embodiment of the present application The schematic diagram of symbol.
As shown in Figure 5, identifier shown in Fig. 5 is the mark of interface element return push-button shown in black surround in figure Symbol, and wherein return push-button is primary interface element, so the identifier of interface element return push-button is UIWindow $ 0TMNavigationBarUIButton:ali-label (' return ').
Wherein, UIWindow is the primary interface element in iOS App, and UIWindow is the Interface Element of top Interface is presented using UIWindow in element.UIWindow and the content for not including any default, UIWindow is as view control Device is as container, for placing view all in application.
TMNavigationBar is a control often being used during actual development, can be passed through Navigation bar is arranged in NavigationBar.
Such as: the background color navigationController.navigationBar.barTintCo of navigation bar is set Lor=[UIColorredColor];BarTintColor: this attribute needs just can be used in iOS7 or more, or
The color navigationController.navigationBar.tintColor=of return push-button is set [UIColor whiteColor];It only needs that tintColor attribute is arranged.
UIButton is a very important UI control, is commonly called as " button ", after clicking some control under normal circumstances, can do Respective reaction is all button out.The function of button is relatively more, can show text and show picture, moreover it is possible to adjust at any time The position of intra pictures and text.UIButton can make sound after user clicks with selection (click) event of monitoring users It answers.
Pattern of the ali-label due to configuring UIButton, the attribute of label is writeable, readable.This can be used The text effects of attribute demonstration modification button, text and color.The return that UIButton:ali-label (' return ') refers to by Button.
Specifically, father's view of UIButton:ali-label (' return ') is view TMNavigationBar, and view Father's view of TMNavigationBar is UIWindow.
It should be noted that Fig. 5 is the identifier that primary interface element generates, and in the interface element identifier Generation method in actual use, can distinguish the permission of the client using the above method, when the client is client's use Client when, the identifier of the interface element is only generated in client, without being shown in the client, visitor Family can not also view the identifier of the interface element when in use;When the client is the client that developer uses When, then after the identifier for generating the interface element in client, it can be shown in the client, and can check and give birth to At the interface element of identifier.
As a preferred embodiment, in the generation method of interface element identifier provided by the present application, due to having When a little interface elements are arranged to lower (transparency is lower than 0.02) that hiding or the interface element transparency is set, this (this kind of interface element can not grasp the selection of user for format that a little interface elements are normally used for fixed page or other effects Responded), in order to reduce the calculation amount of the generation method of interface element identifier when being executed, execute step S105 it Before, it also needs to be filtered the interface element, specifically comprise the following steps:
Judge whether the interface element can respond selection event;
If it is not, then when executing the step of the hierarchical relationship generation identifier with the interface element in the page, Include:
Identifier with the characteristic information of view controller belonging to the interface element, as the interface element.
As a preferred embodiment, in the generation method of interface element identifier provided by the present application, due to During the operation of client, can to the selection operation of user carry out response interface element (such as: the navigation with hyperlink Column), the page in client may be made to be jumped, but if certain controls on the page of user's operation, do not touched Page jump is sent out, event can not be just generated and bury a little.Once client is not there is a situation where being available during this, developer is then Can not have accurate element stationkeeping ability, so that the investigation difficulty of problem is increased, in order to be directed to client in the event of a failure Problem repetition and positioning can be quickly carried out, mark is generated with hierarchical relationship of the interface element in the page executing step S105 After the step of knowing symbol, also needs the interface element to response selection operation to record, specifically comprise the following steps:
When the interface element responds selection event, the identifier of the interface element is carried out by preset mode Conversion generates storage character string;
Save the storage character string.
In the present embodiment, described to be converted the identifier of the interface element by preset mode, generation is deposited Character string is stored up, can be realized in the following way: by the operation mode for name of endorsing, the identifier of the interface element being converted To store character string.
It should be understood that the storage character string is to be carried out in a manner of name of endorsing to the identifier of the interface element After encryption, the digital encryption string of formation.
As a preferred embodiment, can be distinguished in the generation method of interface element identifier provided by the present application It is only raw in client when the client is the client that client uses using the permission of the client of the above method At the identifier of the interface element, without being shown in the client, client can not also view described when in use The identifier of interface element;When the client is the client that developer uses, then the interface is generated in client It after the identifier of element, can be shown in the client, and can check the interface element for having generated identifier.
So executing step S105 according to the type of the interface element, with level of the interface element in the page After relationship generates identifier, if the permission of active client is developer's permission, the interface element of generation can be shown Identifier.
In the above-described embodiment, a kind of generation method of interface element identifier is provided, with above-mentioned interface element mark The generation method for knowing symbol is corresponding, and present invention also provides a kind of generating means of interface element identifier.Due to device Embodiment is substantially similar to the embodiment of method, so describing fairly simple, referring to the part of embodiment of the method in place of correlation Explanation.Installation practice described below is only schematical.The generating means of the interface element identifier are implemented Under such as:
Referring to FIG. 6, it illustrates the generating means of the interface element identifier provided according to an embodiment of the present application Schematic diagram.
The generating means of the interface element identifier, comprising: interface element acquiring unit 601, element classification unit 603 And identifier generating unit 605;
The interface element acquiring unit 601, for obtaining the interface element in the page;
The element classification unit 603 is determined for classifying according to preset classifying rules to the interface element The type of the interface element;
The identifier generating unit, for the type according to the interface element, with the interface element in the page Hierarchical relationship generate identifier.
Optionally, the interface element acquiring unit 601, comprising: monitor subelement and interface element obtains subelement;
The monitoring subelement, for monitoring the selection event to the page;
The interface element obtains subelement, interface element when triggering the selection event for obtaining, at selection.
Optionally, the element classification unit 603, specifically for according to the primary interface element of client and based on web Interface element classify to the interface element, determine the type of the interface element.
Optionally, the identifier generating unit 605, the type specifically for the interface element are the boundary based on web When surface element, identifier is generated with offset of the interface element in the page apart from root node.
Optionally, the identifier generating unit, comprising: dom tree obtains subelement, node determines subelement and offset Measure computation subunit;
The dom tree obtains subelement, for obtaining the DOM tree structure in the page;
The node determines subelement, for determining the interface element, the corresponding node in the DOM tree structure;
The offset computation subunit, for calculating between the root node in the node and the DOM tree structure Offset, using the offset as the identifier of the interface element.
Optionally, the offset computation subunit, specifically for calculating in the node and the DOM tree structure Offset between BODY node, using the offset as the identifier of the interface element
Optionally, the offset computation subunit, comprising: node obtains subelement and offset obtains subelement;
The node obtains subelement, for starting the hierarchical relationship according to the dom tree with the node, upwards successively Class node is obtained until getting the root node;
The offset obtains subelement, for according to the sequence from the root node to the hierarchical relationship of the node, The information of class node and the information of the node are taken described in will acquire, as the offset.
Optionally, the identifier generating unit, comprising: father's interface element identifier obtaining unit and identifier generate Subelement;
Father's interface element identifier obtaining unit, the type for the interface element are the primary interface of client When element, the identifier of father's interface element is obtained with the view response relation of the interface element;
The identifier generates subelement, for identifier and the interface element based on father's interface element Information generates the identifier of the interface element.
Optionally, father's interface element identifier obtaining unit, the type specifically for the interface element are client When holding primary interface element, the view control as belonging to the interface element is obtained with the view response relation of the interface element The characteristic information of device processed extremely, the group identifier of the parent interface element adjacent with the interface element at character string.
Optionally, the identifier generates subelement, for the boundary to be written in the identifier of father's interface element The characteristic information and view hierarchical information of surface element, using the identifier of father's interface element after write-in as the interface The identifier of element.
Optionally, the generating means of the interface element identifier, further includes: choose response judging unit;
The selection responds judging unit, for generating mark in the hierarchical relationship with the interface element in the page Before knowing symbol, judge whether the interface element can respond selection event;
Correspondingly, the identifier generating unit, is also used to receive the judging result for choosing response judging unit, if No, with the characteristic information of view controller belonging to the interface element, as the interface element identifier.
Optionally, the generating means of the interface element identifier, further includes: identifier converting unit and storage are single Member;
The identifier converting unit, for generating mark in the hierarchical relationship with the interface element in the page After symbol, when the interface element responds selection event, the identifier of the interface element is carried out by preset mode Conversion generates storage character string;
The storage unit, for saving the storage character string.
Optionally, the generating means of the interface element identifier, further includes: identifier display unit;
The identifier display unit, for generating mark in the hierarchical relationship with the interface element in the page After symbol, the identifier of the interface element of generation is shown.
In the above-described embodiment, provide a kind of interface element identifier generation method and a kind of interface element mark The generating means for knowing symbol, in addition, present invention also provides a kind of electronic equipment;The electronic equipment embodiment is as follows:
Referring to FIG. 7, it illustrates the schematic diagrames of the electronic equipment provided according to an embodiment of the present application.
The electronic equipment, comprising: processor 701;Memory 703;
The memory 703 generates program for storing interface element identifier, and described program is read by the processor It when taking execution, performs the following operations: obtaining the interface element in the page;According to preset classifying rules to the interface element into Row classification, determines the type of the interface element;According to the type of the interface element, with the interface element in the page Hierarchical relationship generates identifier.
For example, the electronic equipment is a smart machine, the smart machine is shown in interface by the app of its installation Show the page, when showing the page, can receive selection operation of the user on its display interface, and grasp according to the selection Make the interface element in the acquisition page;Classify according to preset classifying rules to the interface element, determines the interface The type of element;According to the type of the interface element, identifier is generated with hierarchical relationship of the interface element in the page. Since this electronic equipment uses the generation method of above-mentioned interface element identifier, related place refers to above-mentioned interface element mark The embodiment of the generation method of symbol illustrates that details are not described herein again.
In the above-described embodiment, generation method, a kind of interface element mark of a kind of interface element identifier are provided The generating means and a kind of electronic equipment of symbol, in addition, present invention also provides a kind of monitoring methods of interface element;The boundary The monitoring method embodiment of surface element is as follows:
Referring to FIG. 8, it illustrates the flow charts of the monitoring method of the interface element provided according to an embodiment of the present application.
The monitoring method of the interface element, comprising:
Step S801 monitors the selection event to the page.
In the present embodiment, the selection event monitored to the page, can realize in the following way: pass through Event () monitors the selection event on interface.
It should be noted that then user is to visitor when the client is operated in on the smart machine for touching screen The selection operation in the page that family end is shown is the touch operation of the page inner boundary element shown to client;As the visitor When family end is operated on the smart machine of non-touch screen, then the selection operation in the page that user customer is shown, is user The page inner boundary element that client is shown by external input device selection operation (such as: carried out a little by mouse It hits).
Step S803 obtains the identifier for responding the interface element of the click event.
In the present embodiment, described to obtain the identifier for responding the interface element of the click event, it can use as follows Mode is realized: when being chosen by user to the page, record when event is triggered horizontal coordinate (such as: clientX), Event trigger when vertical coordinate (such as: clientY), be based on the corresponding interface element of the coordinate setting, and obtain described in The identifier that interface element carries.
Step S805 is converted the identifier of the interface element by preset mode, generates storage character string.
In the present embodiment, described to be converted the identifier of the interface element by preset mode, generation is deposited Character string is stored up, can realize: by preset cipher mode, the identifier of the interface element be turned in the following way It changes, generates storage character string.
It should be understood that the storage character string is to be carried out in a manner of name of endorsing to the identifier of the interface element After encryption, the digital encryption string of formation.
Step S807 saves the storage character string.
In the present embodiment, described to save the storage character string, it can realize in the following way: by the storage word Symbol string is stored in local spatial.
As a preferred embodiment, in the monitoring method of interface element provided by the present application, in order in client In the case where not being available, developer can check the problem of client generation, save executing step S807 After the step of storage character string, comprising:
The storage character string is sent to server end.
Since the interface element in client is after responding selection operation, the storage character string can be generated and to described Server end is sent, but the storage character string sent is all not storage character string when problem occurs for client, Storage character string when further including normal use, in order to reduce volume of transmitted data when network transmission, and described in reduction The data volume stored in server end, the technical solution of the application provide a kind of preferred embodiment, under preferred embodiment, Client there is a situation where crash or other be not available when, send the storage character string to the server end.
In the above-described embodiment, a kind of monitoring method of interface element is provided, the monitoring side with above-mentioned interface element Method is corresponding, and present invention also provides a kind of monitoring devices of interface element.Due to the embodiment side of being substantially similar to of device The embodiment of method, so describing fairly simple, the relevent part can refer to the partial explaination of embodiments of method.Described below Installation practice is only schematical.The monitoring device embodiment of the interface element is as follows:
Referring to FIG. 9, it illustrates the schematic diagrames of the monitoring device of the interface element provided according to an embodiment of the present application.
The monitoring device of the interface element, comprising: event monitoring unit 901, identifier obtaining unit 903, character are raw At unit 905 and storage unit 907;
The event monitoring unit 901, for monitoring the selection event to the page;
The identifier obtaining unit 903, for obtaining the identifier for responding the interface element of the click event;
The character generation unit 905, for the identifier of the interface element to be converted by preset mode, Generate storage character string;
The storage unit 907, for saving the storage character string.
Optionally, the character generation unit 905, specifically for the operation mode by name of endorsing by the interface element Identifier converted, generate storage character string.
Optionally, the monitoring device of the interface element, further includes: transmission unit;
The transmission unit, for sending the storage to server end after the preservation storage character string Character string.
In the above-described embodiment, generation method, a kind of interface element mark of a kind of interface element identifier are provided Generating means, a kind of electronic equipment, a kind of monitoring method of interface element and a kind of monitoring device of interface element of symbol, this Outside, present invention also provides another electronic equipments;Another electronic equipment embodiment is as follows:
Referring to FIG. 10, it illustrates the schematic diagrames of another electronic equipment provided according to an embodiment of the present application.
The another kind electronic equipment, comprising: processor 1001;Memory 1003;
Processor 1001;
Memory 1003, for storing interface element monitoring programme, described program read by the processor execute when, It performs the following operations:
Monitor the selection event to the page;Obtain the identifier for responding the interface element of the click event;By default Mode the identifier of the interface element is converted, generate storage character string;Save the storage character string.
For example, the electronic equipment is a smart machine, the smart machine is shown in interface by the app of its installation Show the page, when showing the page, can receive selection operation of the user on its display interface, and grasp according to the selection Make the identifier that acquisition responds the interface element of the click event;And by preset mode by the mark of the interface element Symbol is converted, and storage character string is generated;Finally save the storage character string.Since this electronic equipment uses above-mentioned Interface Element The monitoring method of element, related place refer to the embodiment explanation of the monitoring method of above-mentioned interface element, and details are not described herein again.
In the above-described embodiment, generation method, a kind of interface element mark of a kind of interface element identifier are provided The generating means of symbol, a kind of electronic equipment, a kind of monitoring method of interface element, the monitoring device of a kind of interface element and another One electronic equipment, in addition, present invention also provides a kind of management methods of interface element;The management method of the interface element is real Under applying for example:
Figure 11 is please referred to, it illustrates the processes of the management method of the interface element provided according to an embodiment of the present application Figure.
The management method of the interface element, comprising:
Step S1101 receives the storage character string that client is sent.
It should be noted that the management method of the interface element, it can be in the client with developer's permission, or clothes Business is implemented in device end.
In the present embodiment, the storage character string for receiving client and sending, can realize: current in the following way Client server with developer's permission by network protocols such as TCP/IP connections and sends the storage character string Client connect the interaction of laggard row information, receive the storage character string.
It should be noted that the storage character string is to carry out encrypted digital encryption by preset cipher mode String.
The storage character string is converted by preset mode, obtains the mark of interface element by step S1103 Symbol.
In the present embodiment, described to be converted the storage character string by preset mode, obtain interface element Identifier, can realize: with preset manner of decryption, the storage character string be decrypted in the following way, The identifier of interface element is obtained from the storage character string.
In the present embodiment, the preset manner of decryption is corresponding with preset cipher mode, with signature verification Operation mode be decrypted.
It should be noted that digital signature is a process for encryption, and digital signature authentication is a process for decryption.Number Signature (also known as public key digital signature, Electronic Signature) is a kind of similar common physical signature write on paper, but is used The technology realization in public key encryption field, the method for identifying digital information.A set of digital signature usually define two kinds it is complementary Operation, one is used to sign, another is for verifying.
Step S1105 monitors the selection event to the page.
In the present embodiment, the selection event monitored to the page, can realize: in the following way in the present embodiment In, the selection event monitored to the page can be realized: in the following way by Event () to the selection thing on interface Part is monitored.
It should be noted that when having the client of developer's permission to operate in on the smart machine for touching screen When, then the selection operation in the page that user customer is shown is the touch of the page inner boundary element shown to client Operation;When server end operates on the smart machine of non-touch screen, then user customer is shown the selection in the page The page inner boundary element that operation, which is user, shows client by external input device selection operation (such as: pass through mouse Mark is clicked).
Step S1107, display respond the identifier of the interface element of the selection event.
In the present embodiment, the display responds the identifier of the interface element of the selection event, can use as follows Mode is realized: when being chosen by user to the page, record when event is triggered horizontal coordinate (such as: clientX), Event trigger when vertical coordinate (such as: clientY), be based on the corresponding interface element of the coordinate setting, obtain the boundary The identifier that surface element carries, and the identifier that will acquire carries out in the display equipment of active client or server end Display.
Step S1109, by the identifier of the interface element obtained, with the interface element for responding the selection event Identifier matched, determine the identical interface element of identifier.
In the present embodiment, the identifier of above-mentioned interface element is matched, determines identical two interfaces of identifier Element.
Illustrate below by a specific example, to the management process of interface element.
Figure 13 is please referred to, it illustrates provide to show to after interface element progress selection operation according to an embodiment of the present application The schematic diagram of identifier.
As shown in Figure 13, user carries out selection operation to interface element cart button shown in black surround in figure in Figure 13 Afterwards, the identifier of display interface element cart button is UIWindow in the display screen of active client 0TMNavigationBarTMBadgeButton:ali-label (' shopping cart ').
Wherein, UIWindow is the primary interface element in iOS App, and UIWindow is the Interface Element of top Interface is presented using UIWindow in element.UIWindow and the content for not including any default, UIWindow is as view control Device is as container, for placing view all in application.
TMNavigationBar is a control often being used during actual development, can be passed through Navigation bar is arranged in NavigationBar.
Pattern of the ali-label due to configuring UIButton, the attribute of label is writeable, readable.This can be used The text effects of attribute demonstration modification button, text and color.The return that UIButton:ali-label (' return ') refers to by Button.
TMNavigationBar is a high performance UITableView unlike other similar control.It is that one kind can be with The custom button that addition red dot is shown.TMNavigationBar is that oneself inherits UIButton, a kind of customized band Badge Button, Badge is realized with UIImageView, and position is located at the upper right corner of Button.It is digital then use background transparent UILabel realize.The cart button that ali-label (' shopping cart ') refers to.
Specifically, father's view of TMBadgeButton:ali-label (' shopping cart ') is view TMNavigationBar, and father's view of view TMNavigationBar is UIWindow.
If currently with the client server of developer's permission, interface element after what is received be decrypted When identifier is 0 TMNavigationBar TMBadgeButton:ali-label of UIWindow $ (' shopping cart '), due to connecing The identifier of the interface element received, identical as the identifier of the interface element for being chosen, client judgement receives Storage character string, indicated interface element be user selected by interface element.
In the above-described embodiment, a kind of management method of interface element is provided, the manager with above-mentioned interface element Method is corresponding, and present invention also provides a kind of managing devices of interface element.Due to the embodiment side of being substantially similar to of device The embodiment of method, so describing fairly simple, the relevent part can refer to the partial explaination of embodiments of method.Described below Installation practice is only schematical.The managing device embodiment of the interface element is as follows:
Figure 13 is please referred to, it illustrates the signals of the managing device of the interface element provided according to an embodiment of the present application Figure.
The managing device of the interface element, comprising: storage character string receiving unit 1301, identifier obtaining unit 1303, event monitoring unit 1305, identifier display unit 1307 and interface element matching unit 1309;
The storage character string receiving unit 1301, for receiving the storage character string of client transmission;
The identifier obtaining unit 1303 is obtained for being converted the storage character string by preset mode Take the identifier of interface element;
The event monitoring unit 1305, for monitoring the selection event to the page;
The identifier display unit 1307, for showing the identifier for responding the interface element of the selection event;
The interface element matching unit 1309, for by the identifier of the interface element obtained, with response institute The identifier for stating the interface element of selection event is matched, and determines the identical interface element of identifier.
Optionally, the identifier obtaining unit 1303, specifically for being deposited by the operation mode of signature verification by described Storage character string is converted, and the identifier of the interface element is obtained.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/or The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium Example.
1, computer-readable medium can be by any side including permanent and non-permanent, removable and non-removable media Method or technology realize that information stores.Information can be computer readable instructions, data structure, the module of program or other numbers According to.The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory techniques, CD-ROM are read-only Memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or Other magnetic storage devices or any other non-transmission medium, can be used for storage can be accessed by a computing device information.According to Herein defines, and computer-readable medium does not include non-temporary computer readable media (transitory media), such as modulates Data-signal and carrier wave.
2, it will be understood by those skilled in the art that embodiments herein can provide as the production of method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the application Form.It can be used moreover, the application can be used in the computer that one or more wherein includes computer usable program code The computer program product implemented on storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) Form.
Although the application is disclosed as above with preferred embodiment, it is not for limiting the present invention, any this field skill Art personnel without departing from the spirit and scope of the present invention, can make possible variation and modification, therefore guarantor of the invention Shield range should be subject to the range that the claims in the present invention are defined.

Claims (29)

1. a kind of generation method of interface element identifier characterized by comprising
Obtain the interface element in the page;
Classify according to preset classifying rules to the interface element, determines the type of the interface element;
According to the type of the interface element, identifier is generated with hierarchical relationship of the interface element in the page.
2. the generation method of interface element identifier according to claim 1, which is characterized in that in the acquisition page Interface element, comprising:
Monitor the selection event to the page;
Interface element when obtaining the triggering selection event, at selection.
3. the generation method of interface element identifier according to claim 1, which is characterized in that the preset classification gauge Then, comprising:
The primary interface element of client and the interface element based on web.
4. the generation method of interface element identifier according to claim 3, which is characterized in that described according to the interface The type of element generates identifier with hierarchical relationship of the interface element in the page, comprising:
When the type of the interface element is the interface element based on web, with the interface element apart from root node in the page Offset generate identifier.
5. the generation method of interface element identifier according to claim 4, which is characterized in that described with the Interface Element Offset of the element in the page apart from root node generates identifier, comprising:
Obtain the DOM tree structure in the page;
Determine the interface element, the corresponding node in the DOM tree structure;
The offset between the root node in the node and the DOM tree structure is calculated, using the offset as the boundary The identifier of surface element.
6. the generation method of interface element identifier according to claim 5, which is characterized in that the root node is BODY Node.
7. the generation method of interface element identifier according to claim 5, which is characterized in that described to calculate the node With the offset between the root node in the DOM tree structure, comprising:
Start the hierarchical relationship according to the dom tree with the node, successively obtains class node upwards until getting described Root node;
According to the sequence from the root node to the hierarchical relationship of the node, will acquire described in take the information of class node And the information of the node, as the offset.
8. the generation method of interface element identifier according to claim 3, which is characterized in that described according to the interface The type of element generates identifier with hierarchical relationship of the interface element in the page, comprising:
When the type of the interface element is client primary interface element, obtained with the view response relation of the interface element Take the identifier of father's interface element;
The information of identifier and the interface element based on father's interface element generates the identifier of the interface element.
9. the generation method of interface element identifier according to claim 8, which is characterized in that father's interface element Identifier, comprising:
The characteristic information of the view controller as belonging to the interface element extremely, the parent Interface Element adjacent with the interface element Element group identifier at character string.
10. the generation method of interface element identifier according to claim 9, which is characterized in that described to be based on the father The information of the identifier of interface element and the interface element generates the identifier of the interface element, comprising:
In the identifier of father's interface element, the characteristic information and view hierarchical information of the interface element is written, it will Identifier of the identifier of father's interface element after write-in as the interface element.
11. the generation method of interface element identifier according to claim 8, which is characterized in that described with the boundary Before the step of hierarchical relationship of the surface element in the page generates identifier, comprising:
Judge whether the interface element can respond selection event;
If it is not, then when executing the step of the hierarchical relationship generation identifier with the interface element in the page, comprising:
Identifier with the characteristic information of view controller belonging to the interface element, as the interface element.
12. the generation method of interface element identifier according to claim 1, which is characterized in that described with the boundary After the step of hierarchical relationship of the surface element in the page generates identifier, comprising:
When the interface element responds selection event, the identifier of the interface element is turned by preset mode It changes, generates storage character string;
Save the storage character string.
13. the generation method of interface element identifier according to claim 1, which is characterized in that described with the boundary After the step of hierarchical relationship of the surface element in the page generates identifier, comprising:
Show the identifier of the interface element generated.
14. a kind of generating means of interface element identifier characterized by comprising
Interface element acquiring unit, for obtaining the interface element in the page;
Element classification unit determines the Interface Element for classifying according to preset classifying rules to the interface element The type of element;
Identifier generating unit is closed for the type according to the interface element with level of the interface element in the page System generates identifier.
15. the generating means of interface element identifier according to claim 14, which is characterized in that the identifier generates Unit, comprising:
Dom tree obtains subelement, for obtaining the DOM tree structure in the page;
Node determines subelement, for determining the interface element, the corresponding node in the DOM tree structure;
Offset computation subunit will for calculating the offset between the root node in the node and the DOM tree structure Identifier of the offset as the interface element.
16. the generating means of interface element identifier according to claim 15, which is characterized in that the offset calculates Subelement, comprising:
Node obtains subelement, successively obtains parent upwards according to the hierarchical relationship of the dom tree for starting with the node Node is until get the root node;
Offset obtains subelement, for will acquire according to the sequence from the root node to the hierarchical relationship of the node It is described take the information of class node and the information of the node, as the offset.
17. the generating means of interface element identifier according to claim 14, which is characterized in that the identifier generates Unit, comprising:
Father's interface element identifier obtaining unit, when the type for the interface element is client primary interface element, The identifier of father's interface element is obtained with the view response relation of the interface element;
Identifier generates subelement, and the information for identifier and the interface element based on father's interface element generates The identifier of the interface element.
18. the generating means of interface element identifier according to claim 17, which is characterized in that father's interface element Identifier obtaining unit, when the type specifically for the interface element is client primary interface element, with the interface The view response relation of element obtains the characteristic information of the view controller as belonging to the interface element extremely, with the Interface Element The group identifier of the adjacent parent interface element of element at character string.
19. the generating means of interface element identifier according to claim 14, which is characterized in that further include:
Identifier converting unit, for after the hierarchical relationship with the interface element in the page generates identifier, When the interface element responds selection event, the identifier of the interface element is converted by preset mode, it is raw At storage character string;
Storage unit, for saving the storage character string.
20. the generating means of interface element identifier according to claim 14, which is characterized in that further include:
Identifier display unit, for after the hierarchical relationship with the interface element in the page generates identifier, Show the identifier of the interface element generated.
21. a kind of electronic equipment, which is characterized in that the electronic equipment, comprising:
Processor;
Memory generates program for storing interface element identifier, and described program is held when reading execution by the processor The following operation of row:
Obtain the interface element in the page;Classify according to preset classifying rules to the interface element, determines the boundary The type of surface element;According to the type of the interface element, mark is generated with hierarchical relationship of the interface element in the page Symbol.
22. a kind of monitoring method of interface element characterized by comprising
Monitor the selection event to the page;
Obtain the identifier for responding the interface element of the selection event;
The identifier of the interface element is converted by preset mode, generates storage character string;
Save the storage character string.
23. the monitoring method of interface element according to claim 22, which is characterized in that described to be incited somebody to action by preset mode The identifier of the interface element is converted, and storage character string is generated, comprising:
The identifier of the interface element is converted by the operation mode for name of endorsing, generates storage character string.
24. the monitoring method of interface element according to claim 22, which is characterized in that save the storage word described After the step of symbol string, comprising:
The storage character string is sent to server end.
25. a kind of monitoring device of interface element characterized by comprising
Event monitoring unit, for monitoring the selection event to the page;
Identifier obtaining unit, for obtaining the identifier for responding the interface element of the selection event;
Character generation unit generates storage word for converting the identifier of the interface element by preset mode Symbol string;
Storage unit, for saving the storage character string.
26. a kind of electronic equipment, which is characterized in that the electronic equipment, comprising:
Processor;
Memory, for storing interface element monitoring programme, described program executes as follows when reading execution by the processor Operation:
Monitor the selection event to the page;Obtain the identifier for responding the interface element of the selection event;Pass through preset side Formula converts the identifier of the interface element, generates storage character string;Save the storage character string.
27. a kind of management method of interface element characterized by comprising
Receive the storage character string that client is sent;
The storage character string is converted by preset mode, obtains the identifier of interface element;
Monitor the selection event to the page;
Display responds the identifier of the interface element of the selection event;
Identifier progress by the identifier of the interface element obtained, with the interface element for responding the selection event Match, determines the identical interface element of identifier.
28. the management method of interface element according to claim 27, which is characterized in that described to be incited somebody to action by preset mode The storage character string is converted, and the identifier of interface element is obtained, comprising:
The storage character string is converted by the operation mode of signature verification, obtains the identifier of the interface element.
29. a kind of managing device of interface element characterized by comprising
Character string receiving unit is stored, for receiving the storage character string of client transmission;
Identifier obtaining unit obtains interface element for converting the storage character string by preset mode Identifier;
Event monitoring unit, for monitoring the selection event to the page;
Identifier display unit, for showing the identifier for responding the interface element of the selection event;
Interface element matching unit and responds the selection event for by the identifier of the interface element obtained The identifier of interface element is matched, and determines the identical interface element of identifier.
CN201710498557.6A 2017-06-27 2017-06-27 A kind of generation method, device and the electronic equipment of interface element identifier Pending CN109145231A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710498557.6A CN109145231A (en) 2017-06-27 2017-06-27 A kind of generation method, device and the electronic equipment of interface element identifier

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710498557.6A CN109145231A (en) 2017-06-27 2017-06-27 A kind of generation method, device and the electronic equipment of interface element identifier

Publications (1)

Publication Number Publication Date
CN109145231A true CN109145231A (en) 2019-01-04

Family

ID=64804870

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710498557.6A Pending CN109145231A (en) 2017-06-27 2017-06-27 A kind of generation method, device and the electronic equipment of interface element identifier

Country Status (1)

Country Link
CN (1) CN109145231A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109885357A (en) * 2019-02-25 2019-06-14 努比亚技术有限公司 Method of adjustment, wearable device and the readable storage medium storing program for executing of automatic extinguishing screen time
CN109893852A (en) * 2019-02-26 2019-06-18 北京心智互动科技有限公司 Interface information processing method and processing device
CN110046090A (en) * 2019-03-05 2019-07-23 阿里巴巴集团控股有限公司 The localization method and device of page elements
CN110187880A (en) * 2019-05-30 2019-08-30 北京腾云天下科技有限公司 A kind of similar elemental recognition method, apparatus and calculate equipment
CN110222261A (en) * 2019-05-21 2019-09-10 无线生活(杭州)信息科技有限公司 A kind of method and device of determining eavesdropping target
CN111340958A (en) * 2020-02-12 2020-06-26 广东趣炫网络股份有限公司 SrollView sliding stuck optimization method, device, equipment and readable storage medium
CN111475381A (en) * 2020-04-03 2020-07-31 支付宝(杭州)信息技术有限公司 Page rendering detection method and device
CN112015634A (en) * 2019-05-31 2020-12-01 百度在线网络技术(北京)有限公司 Page structure information generation method and device and electronic equipment
CN113051095A (en) * 2021-03-25 2021-06-29 北京高途云集教育科技有限公司 Method and device for reproducing operation errors of client, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019937A (en) * 2012-12-13 2013-04-03 广东欧珀移动通信有限公司 Human-machine interaction interface traverse test method
US8698835B1 (en) * 2012-10-16 2014-04-15 Google Inc. Mobile device user interface having enhanced visual characteristics
CN104484189A (en) * 2014-12-31 2015-04-01 北京拼图科技有限公司 Construction and design method of application interface
CN105068815A (en) * 2015-08-24 2015-11-18 用友网络科技股份有限公司 Page editor interaction apparatus and method
CN105335283A (en) * 2014-08-01 2016-02-17 阿里巴巴集团控股有限公司 Application testing method and device in terminal equipment
CN106293645A (en) * 2015-05-13 2017-01-04 Tcl集团股份有限公司 A kind of method and system improving Web application interface rendering efficiency
CN106776247A (en) * 2016-11-23 2017-05-31 腾云天宇科技(北京)有限公司 Method, server and system for monitoring control in application

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8698835B1 (en) * 2012-10-16 2014-04-15 Google Inc. Mobile device user interface having enhanced visual characteristics
CN103019937A (en) * 2012-12-13 2013-04-03 广东欧珀移动通信有限公司 Human-machine interaction interface traverse test method
CN105335283A (en) * 2014-08-01 2016-02-17 阿里巴巴集团控股有限公司 Application testing method and device in terminal equipment
CN104484189A (en) * 2014-12-31 2015-04-01 北京拼图科技有限公司 Construction and design method of application interface
CN106293645A (en) * 2015-05-13 2017-01-04 Tcl集团股份有限公司 A kind of method and system improving Web application interface rendering efficiency
CN105068815A (en) * 2015-08-24 2015-11-18 用友网络科技股份有限公司 Page editor interaction apparatus and method
CN106776247A (en) * 2016-11-23 2017-05-31 腾云天宇科技(北京)有限公司 Method, server and system for monitoring control in application

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109885357A (en) * 2019-02-25 2019-06-14 努比亚技术有限公司 Method of adjustment, wearable device and the readable storage medium storing program for executing of automatic extinguishing screen time
CN109885357B (en) * 2019-02-25 2024-01-09 努比亚技术有限公司 Adjustment method for automatic screen-off time, wearable device and readable storage medium
CN109893852A (en) * 2019-02-26 2019-06-18 北京心智互动科技有限公司 Interface information processing method and processing device
CN110046090A (en) * 2019-03-05 2019-07-23 阿里巴巴集团控股有限公司 The localization method and device of page elements
CN110046090B (en) * 2019-03-05 2023-10-03 创新先进技术有限公司 Page element positioning method and device
CN110222261A (en) * 2019-05-21 2019-09-10 无线生活(杭州)信息科技有限公司 A kind of method and device of determining eavesdropping target
CN110187880B (en) * 2019-05-30 2022-12-16 北京腾云天下科技有限公司 Method and device for identifying similar elements and computing equipment
CN110187880A (en) * 2019-05-30 2019-08-30 北京腾云天下科技有限公司 A kind of similar elemental recognition method, apparatus and calculate equipment
CN112015634A (en) * 2019-05-31 2020-12-01 百度在线网络技术(北京)有限公司 Page structure information generation method and device and electronic equipment
CN111340958A (en) * 2020-02-12 2020-06-26 广东趣炫网络股份有限公司 SrollView sliding stuck optimization method, device, equipment and readable storage medium
CN111475381A (en) * 2020-04-03 2020-07-31 支付宝(杭州)信息技术有限公司 Page rendering detection method and device
CN113051095A (en) * 2021-03-25 2021-06-29 北京高途云集教育科技有限公司 Method and device for reproducing operation errors of client, electronic equipment and storage medium
CN113051095B (en) * 2021-03-25 2024-02-13 北京高途云集教育科技有限公司 Method and device for reproducing operation errors of client, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109145231A (en) A kind of generation method, device and the electronic equipment of interface element identifier
US11811805B1 (en) Detecting fraud by correlating user behavior biometrics with other data sources
US11163851B2 (en) Method, apparatus, computer device and storage medium of page displaying
US10534512B2 (en) System and method for identifying web elements present on a web-page
IL275042A (en) Self-adaptive application programming interface level security monitoring
US8640034B2 (en) Remote GUI control by replication of local interactions
US10853097B1 (en) Robotic process automation with secure recording
CN108292231A (en) It generates and applies from data
US7451393B1 (en) System and method for a page rendering framework
US20100058118A1 (en) Storage medium recording information reacquisition procedure generation program and information reacquisition procedure generation apparatus
US20180300465A1 (en) Multiple input neural networks for detecting fraud
US11620454B2 (en) System and method for determining and representing a lineage of business terms and associated business rules within a software application
De Santana et al. Summarizing observational client-side data to reveal web usage patterns
CN106462329A (en) Light dismiss manager
US9262550B2 (en) Processing semi-structured data
US20180300625A1 (en) Neural networks for detecting fraud based on user behavior biometrics
US20180300572A1 (en) Fraud detection based on user behavior biometrics
CN106991036A (en) A kind of abnormal reminding method of information input and system
CN110032360A (en) Flow of transactions creation method, device and server
CN113296653A (en) Simulation interaction model construction method, interaction method and related equipment
CN110020279A (en) Page data processing method, device and storage medium
Milazzo et al. KIND‐DAMA: A modular middleware for Kinect‐like device data management
Waldner et al. Graphical histories of information foraging
CN105681903B (en) A kind of method and device that user interface is presented
CN111142735B (en) Software page creating method and device, terminal equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190104

RJ01 Rejection of invention patent application after publication