CN109446092A - The method, apparatus and electronic equipment be identified to user interface UI element - Google Patents

The method, apparatus and electronic equipment be identified to user interface UI element Download PDF

Info

Publication number
CN109446092A
CN109446092A CN201811291510.3A CN201811291510A CN109446092A CN 109446092 A CN109446092 A CN 109446092A CN 201811291510 A CN201811291510 A CN 201811291510A CN 109446092 A CN109446092 A CN 109446092A
Authority
CN
China
Prior art keywords
tag field
dynamic binding
class
function
attribute tag
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
CN201811291510.3A
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.)
Beijing Microlive Vision Technology Co Ltd
Original Assignee
Beijing Microlive Vision Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Microlive Vision Technology Co Ltd filed Critical Beijing Microlive Vision Technology Co Ltd
Priority to CN201811291510.3A priority Critical patent/CN109446092A/en
Publication of CN109446092A publication Critical patent/CN109446092A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

This application involves technical field of computer software development, disclose the method, apparatus and electronic equipment that a kind of pair of user interface UI element is identified, wherein, it include: to increase dynamic binding attribute tag field in default root class to the method that user interface UI element is identified, dynamic binding attribute tag field is embodied as sky;When then running automated test tool, by calling the Hook Function of predefined type accordingly to modify the realization of dynamic binding attribute tag field, so that returning to corresponding UI component identification when reading dynamic binding attribute tag field.The method of the embodiment of the present application, so that by calling the Hook Function of predefined type accordingly to modify the realization of dynamic binding attribute tag field, automatically UI element can be identified, the convenience of UI component identification is not only increased, and avoids the problems such as obscuring, bear the same name of UI component identification.

Description

The method, apparatus and electronic equipment be identified to user interface UI element
Technical field
This application involves technical field of computer software development, specifically, this application involves a kind of couple of user interface UI The method, apparatus and electronic equipment that element is identified.
Background technique
With the development of information technology and internet, people gradually from the epoch of absence of information entered into information overload when Generation, more and more wider, the application program (APPlication, abbreviation APP) developed for electronic equipment of application of electronic equipment It is more and more.Wherein, any one application program requires to carry out it a large amount of test job before publication is online, such as The UI element of APP is largely tested, to guarantee the reliability of application program, reduces user in the use process of application program In the probability that encounters problems.
Usually when carrying out the test of UI element, need that UI element is marked in advance, existing labeling method, usually It is that UI rubidium marking to be used is needed to each one by one manually in application code AccessibilityIdentifier (character string identification for referring to UI element), i.e., be identified UI element.The hair of the application In the specific implementation process, finding this labeling method, not only workload is huge by bright people, but also is easy to be used to carry out by attacker Conversed analysis, in addition, be also easy giving a name for UI element because name not detailed and indigestion, or because of the same name and band Carry out some not expected problems.
Summary of the invention
The purpose of the application is intended at least can solve above-mentioned one of technological deficiency, and spy proposes following technical scheme:
In a first aspect, providing the method that a kind of pair of user interface UI element is identified, comprising:
Increase dynamic binding attribute tag field in default root class, dynamic binding attribute tag field is embodied as sky;
When running automated test tool, by calling the Hook Function of predefined type to dynamic binding attribute tag field Realization accordingly modified so that returning to corresponding UI component identification when reading dynamic binding attribute tag field.
In one possible implementation, the class to use, the class for showing content are inherited for needs and be used for Any one of class of input content, by calling realization of the Hook Function of predefined type to dynamic binding attribute tag field Accordingly modified, comprising:
Corresponding initialization function is hooked by Hook Function, and by dynamic binding attribute marker word in initialization function Section is assigned a value of corresponding class name.
In another possible implementation, when there is repeatability UI element in any sort, for each repeatability UI Dynamic binding attribute tag field is assigned a value of corresponding class name and UI element respectively in corresponding initialization function by element The combination of predetermined mark.
In another possible implementation, for for showing the class of content or for the class of input content, pass through The Hook Function of predefined type is called accordingly to modify the realization of dynamic binding attribute tag field, comprising:
Determine target set content;
Corresponding set content function is hooked by Hook Function, and by dynamic binding attribute mark in set content function Note field is assigned a value of the value of target set content.
In another possible implementation, for the class for input content, by the hook for calling predefined type Function accordingly modifies the realization of dynamic binding attribute tag field, comprising:
Scheduled setting placeholder function is hooked by Hook Function, and will dynamic in scheduled setting placeholder function Bind properties tag field is assigned a value of the value of placeholder.
In another possible implementation, method is applied to IOS operating system, wherein presetting root class includes NSObject, automated test tool include UITest.
Second aspect provides the device that a kind of pair of user interface UI element is identified, comprising:
First processing module, for increasing dynamic binding attribute tag field, dynamic binding attribute mark in default root class Note field is embodied as sky;
Second processing module, when for running automated test tool, by calling the Hook Function of predefined type to dynamic The realization of state bind properties tag field is accordingly modified, so that returning to phase when reading dynamic binding attribute tag field The UI component identification answered.
In one possible implementation, the class to use, the class for showing content are inherited for needs and be used for Any one of class of input content, Second processing module are specifically used for hooking corresponding initialization function by Hook Function, And dynamic binding attribute tag field is assigned a value of corresponding class name in initialization function.
In another possible implementation, Second processing module is specifically used for first when there is repeatability UI in any sort When plain, dynamic binding attribute tag field is assigned a value of respectively in corresponding initialization function for each repeatability UI element The combination of corresponding class name and the predetermined mark of UI element.
In another possible implementation, for for showing the class of content or for the class of input content, second Processing module is specifically used for determining target set content;And for hooking corresponding set content function by Hook Function, And dynamic binding attribute tag field is assigned a value of to the value of target set content in set content function.
In another possible implementation, for the class for input content, Second processing module is specifically used for logical It crosses Hook Function and hooks scheduled setting placeholder function, and by dynamic binding attribute mark in scheduled setting placeholder function Note field is assigned a value of the value of placeholder.
In another possible implementation, which is applied to IOS operating system, wherein presetting root class includes NSObject, automated test tool include UITest.
The third aspect, provides a kind of electronic equipment, including memory, processor and storage on a memory and can located The computer program that runs on reason device, processor is realized when executing described program above-mentioned to be identified user interface UI element Method.
Fourth aspect provides a kind of computer readable storage medium, calculating is stored on computer readable storage medium Machine program, the program realize the above-mentioned method being identified to user interface UI element when being executed by processor.
The method provided by the embodiments of the present application being identified to user interface UI element increases in default root class and realizes For empty dynamic binding attribute tag field, when being follow-up operation automated test tool UI element it is automatic identify provide before Propose guarantee;When running automated test tool, by calling the Hook Function of predefined type to dynamic binding attribute tag field Realization accordingly modified so that realization of the Hook Function to dynamic binding attribute tag field by calling predefined type It is accordingly modified, UI element can be identified automatically, realize the automation of UI component identification, which not only improves UI The convenience of component identification, and effectively prevent the problems such as obscuring, bear the same name of UI component identification, while according to this kind of mode UI component identification can accurately know code position where attribute.
The additional aspect of the application and advantage will be set forth in part in the description, these will become from the following description It obtains obviously, or recognized by the practice of the application.
Detailed description of the invention
The application is above-mentioned and/or additional aspect and advantage will become from the following description of the accompanying drawings of embodiments Obviously and it is readily appreciated that, in which:
Fig. 1 is the flow diagram of the method being identified to user interface UI element of the embodiment of the present application;
Fig. 2 is the basic structure schematic diagram of the device being identified to user interface UI element of the embodiment of the present application;
Fig. 3 is the structural schematic diagram of the electronic equipment of the embodiment of the present application.
Specific embodiment
Embodiments herein is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end Same or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attached The embodiment of figure description is exemplary, and is only used for explaining the application, and cannot be construed to the limitation to the application.
Those skilled in the art of the present technique are appreciated that unless expressly stated, singular " one " used herein, " one It is a ", " described " and "the" may also comprise plural form.It is to be further understood that being arranged used in the description of the present application Diction " comprising " refer to that there are the feature, integer, step, operation, element and/or component, but it is not excluded that in the presence of or addition Other one or more features, integer, step, operation, element, component and/or their group.It should be understood that when we claim member Part is " connected " or when " coupled " to another element, it can be directly connected or coupled to other elements, or there may also be Intermediary element.In addition, " connection " used herein or " coupling " may include being wirelessly connected or wirelessly coupling.It is used herein to arrange Diction "and/or" includes one or more associated wholes for listing item or any cell and all combinations.
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with attached drawing to the application embodiment party Formula is described in further detail.
Currently, needing in advance to be identified UI element, so as to automated test tool when carrying out UI automatic test Can accurately find the UI element clicked, the operation such as judgement state.Existing labeling method, usually in application program generation In code, needing UI rubidium marking AccessibilityIdentifier to be used to each one by one manually (is the one of UI element A character string identification), i.e., UI element is identified, not only workload is huge, but also is easy to be used to carry out inversely by attacker Analysis, in addition, being also easy giving a name for UI element because naming not detailed and indigestion, or bring one because of of the same name A little not expected problems.
The method, apparatus provided by the present application that user interface UI element is identified and electronic equipment, it is intended to solve existing There is the technical problem as above of technology.
How the technical solution of the application and the technical solution of the application are solved with specifically embodiment below above-mentioned Technical problem is described in detail.These specific embodiments can be combined with each other below, for the same or similar concept Or process may repeat no more in certain embodiments.Below in conjunction with attached drawing, embodiments herein is described.
Embodiment one
The embodiment of the present application provides the method that a kind of pair of user interface UI element is identified, as shown in Figure 1, comprising:
Step S110 increases dynamic binding attribute tag field in default root class, dynamic binding attribute tag field It is embodied as sky.
Specifically, one can be increased in default root class and is embodied as empty dynamic binding attribute tag field, that is, had The dynamic binding attribute tag field is existing for empty real in the program code of body, namely is arranged to the dynamic binding attribute tag field Anything is not done when value, returns to sky always when reading the dynamic binding attribute tag field.
Step S120, when running automated test tool, by calling the Hook Function of predefined type to dynamic binding category Property tag field realization accordingly modified so that returning to corresponding UI member when reading dynamic binding attribute tag field Element mark.
Specifically, in specific program development process, other than writing code, it is also necessary to carry out defect (bug) and repair Change, defect modification is usually after testing is complete, to go to make an amendment for some problem, but cannot wait every time to be tested Carry out feedback problem, application developer is also required to carry out some surveys certainly, during the written in code of certain programming languages, create Corresponding automated test tool is provided for when building engineering, and application developer is facilitated to be completed according to the automated test tool It is corresponding to survey certainly.
Further, during carrying out user interface UI element from survey, usually first UI element is identified, It is clicked so that automated test tool can find the UI element, the operation such as judgement state.Wherein, it is carried out to UI element It, can be when running automated test tool, by calling the Hook Function of predefined type to dynamic binding during mark The realization of attribute tag field is accordingly modified, so that returning to corresponding UI when reading dynamic binding attribute tag field Component identification, i.e., by calling the Hook Function of predefined type accordingly to repair the realization of dynamic binding attribute tag field Change, UI element can be identified automatically, realize the automation of UI component identification, which not only improves UI component identifications Convenience, and the problems such as obscuring, bear the same name of UI component identification will not be caused, while according to the UI component identification of this kind of mode, Code position where can accurately knowing attribute.
The method provided by the embodiments of the present application that user interface UI element is identified, compared with prior art, pre- If increasing in root class and being embodied as empty dynamic binding attribute tag field, UI element when being follow-up operation automated test tool Automatic mark provides premise guarantee;When running automated test tool, by calling the Hook Function of predefined type to dynamic The realization of bind properties tag field is accordingly modified, so that by calling the Hook Function of predefined type to dynamic binding category The realization of property tag field is accordingly modified, and can be identified automatically to UI element, be realized the automatic of UI component identification Change, which not only improves the convenience of UI component identification, and effectively prevent the problems such as obscuring, bear the same name of UI component identification, Simultaneously according to the UI component identification of this kind of mode, code position where attribute can be accurately known.
The embodiment of the present application provides alternatively possible implementation, wherein and this method is applied to IOS operating system, Default root class includes NSObject, and automated test tool includes UITest.
Specifically, for the needs succession class to use, the class for showing content and in the class of input content Any one is wrapped by calling the Hook Function of predefined type accordingly to modify the realization of dynamic binding attribute tag field It includes: corresponding initialization function is hooked by Hook Function, and assign dynamic binding attribute tag field in initialization function Value is corresponding class name.
Further, when there is repeatability UI element in any sort, for each repeatability UI element, respectively corresponding In initialization function, dynamic binding attribute tag field is assigned a value of to the combination of corresponding class name and the predetermined mark of UI element.
Further, for for showing the class of content or for the class of input content, pass through the hook of calling predefined type Subfunction accordingly modifies the realization of dynamic binding attribute tag field, comprising:
Determine target set content;
Corresponding set content function is hooked by Hook Function, and by dynamic binding attribute mark in set content function Note field is assigned a value of the value of target set content.
Further, for the class for input content, by calling the Hook Function of predefined type to dynamic binding category The realization of property tag field is accordingly modified, comprising:
Scheduled setting placeholder function is hooked by Hook Function, and will dynamic in scheduled setting placeholder function Bind properties tag field is assigned a value of the value of placeholder.
It describes in detail by taking IOS operating system as an example to the above method below, certain this method is equally also adapted to In other operating systems, the operating process in other operating systems is similar with the operating process in IOS operating system, herein No longer elaborate.
Currently, needing in advance to be identified UI element, so as to automatic test when carrying out iOS UI automatic test Tool can accurately find the UI element clicked, the operation such as judgement state.Wherein, before being identified to UI element, Can in advance in the default root class (such as NSObject) one dynamic binding attribute tag field of addition (such as HtsAccessibilityIdentifier field), which is embodied as sky, i.e. the dynamic binding Attribute tag field is existing for empty real in the code of application program, namely to the dynamic binding attribute tag field setting value when Time does not allow it to do anything, namely returns to sky always when reading the dynamic binding attribute tag field.Moreover, transporting When row automated test tool (such as UITest), by calling the Hook Function of predefined type to mark the dynamic binding attribute The realization of field is accordingly modified, and can return to corresponding UI element mark when reading the dynamic binding attribute tag field Know, i.e., by the modification of the realization to the dynamic binding attribute tag field, realizes the automatic mark of UI element.
Specifically, the Hook Function of above-mentioned predefined type is specifically as follows runtime hook method, the i.e. dynamic binding Attribute tag field is to modify its realization using runtime hook method when running UITest, such as dynamically tie up to this Determining automatic assignment when attribute tag field setting value is system API (Application Programming Interface, application programming interface) accessibilityIdentifier (character string identification of UI element) Field, to return to accessibilityIdentifier field when reading the dynamic binding attribute tag field Value.
Further, the class used for needing to inherit, such as UIViewController (User Page view control Device), UITableViewCell (User Page Tab View cell), UICollectionViewCell (User Page set Inter-face views cell) etc., or for for showing the class of content, such as UILabel (User Page label), UIImageView (User Page image views) etc., or for the class for input content, such as UITextView (user Page text view), UITextField (User Page is text filed) etc., in the Hook Function pair by calling predefined type When the realization of dynamic binding attribute tag field is accordingly modified, corresponding initialization letter can be hooked by Hook Function Number, and dynamic binding attribute tag field is assigned a value of corresponding class name, such as hook initial method in initialization function, HtsAccessibilityIdentifier is assigned a value of corresponding class name by default in the initial method, such as will HtsAccessibilityIdentifier is assigned a value of UIViewController, in another example will HtsAccessibilityIdentifier is assigned a value of UITextView.
Further, when needs are inherited in the class to use, the class for showing content and the class for input content When any one has repeatability UI element, will dynamically it be tied up respectively in corresponding initialization function for each repeatability UI element Determine the combination that attribute tag field is assigned a value of corresponding class name and the predetermined mark of UI element, for example " class name-UI element is calibrated in advance Know " combining form, wherein predetermined mark can be indexpath (index path), i.e., can be with for repeated UI element Dynamic binding attribute tag field is assigned a value of corresponding class name-indexpath in initialization function.
Further, for for showing the class of content or for the class of input content, pass through the hook of calling predefined type Subfunction accordingly modifies the realization of dynamic binding attribute tag field, comprising: determines target set content, then passes through Hook Function hooks corresponding set content function, and is assigned a value of dynamic binding attribute tag field in set content function The value of target set content.For example, the method for hook set content, automatically by dynamic binding attribute mark when to its set content Note field htsAccessibilityIdentifier is assigned a value of the value of target set content, for example determines the target of setting official documents and correspondence When set content is " user name ", htsAccessibilityIdentifier can be assigned a value of " user name ".
Further, for the class for input content, by calling the Hook Function of predefined type to dynamic binding category The realization of property tag field is accordingly modified, comprising: hooks scheduled setting placeholder function by Hook Function, and pre- Dynamic binding attribute tag field is assigned a value of to the value of placeholder in fixed setting placeholder function.It is set for example, hook is scheduled Placeholder method is set, and when placeholder is arranged automatically by dynamic binding attribute tag field HtsAccessibilityIdentifier is assigned a value of the value of placeholder.
Further, for inheriting the class to use, the class for showing content and for the class of input content except needs Except other classes, can be realized in function accordingly manually, dynamic binding attribute tag field is assigned a value of corresponding " class The form of name-predetermined attribute name ".
For method provided by the embodiments of the present application, by calling the Hook Function of predefined type to dynamic binding attribute mark The realization of note field is accordingly modified, and the automatic mark of UI element can be realized, greatly improve the convenient of UI component identification Property, the problems such as obscuring, bear the same name of UI component identification is effectively prevented, while according to the UI component identification of this kind of mode, it can be accurate Code position where knowing attribute.
Embodiment two
Fig. 2 is the structural representation for the device that a kind of pair of user interface UI element provided by the embodiments of the present application is identified Figure, as shown in Fig. 2, the device 20 may include first processing module 21 and Second processing module 22, wherein
First processing module 21 is used to increase dynamic binding attribute tag field, dynamic binding attribute mark in default root class Note field is embodied as sky;
When Second processing module 22 is used to run automated test tool, by calling the Hook Function of predefined type to dynamic The realization of state bind properties tag field is accordingly modified, so that returning to phase when reading dynamic binding attribute tag field The UI component identification answered.
Specifically, for the needs succession class to use, the class for showing content and in the class of input content Any one, Second processing module 22 are specifically used for hooking corresponding initialization function by Hook Function, and in initialization function It is middle that dynamic binding attribute tag field is assigned a value of corresponding class name.
Further, Second processing module 22 also particularly useful for when in any sort exist repeatability UI element when, for each Dynamic binding attribute tag field is assigned a value of corresponding class name respectively in corresponding initialization function by repeated UI element With the combination of the predetermined mark of UI element.
Further, for for showing the class of content or for the class of input content, Second processing module is specifically used for Determine target set content;And specifically for hooking corresponding set content function by Hook Function, and in set content Dynamic binding attribute tag field is assigned a value of to the value of target set content in function.
Further, for the class for input content, Second processing module is specifically used for hooking by Hook Function pre- Fixed setting placeholder function, and dynamic binding attribute tag field is assigned a value of occupy-place in scheduled setting placeholder function The value of symbol.
Further, which is applied to IOS operating system, wherein default root class includes NSObject, automatic test Tool includes UITest.
Device provided by the embodiments of the present application increases in default root class compared with prior art and is embodied as empty dynamic Bind properties tag field, the automatic mark of UI element provides premise guarantee when for follow-up operation automated test tool;Fortune When row automated test tool, by calling the Hook Function of predefined type to carry out the realization of dynamic binding attribute tag field Corresponding modification, so that by calling the Hook Function of predefined type accordingly to repair the realization of dynamic binding attribute tag field Change, UI element can be identified automatically, realize the automation of UI component identification, which not only improves UI component identifications Convenience, and the problems such as obscuring, bear the same name of UI component identification is effectively prevented, while according to the UI element mark of this kind of mode Know, can accurately know code position where attribute.
Embodiment three
Below with reference to Fig. 3, it illustrates the electronic equipment (end of example as shown in figure 1 for being suitable for being used to realize the embodiment of the present disclosure End equipment or server) 800 structural schematic diagram.Terminal device in the embodiment of the present application can include but is not limited to such as move Mobile phone, laptop, digit broadcasting receiver, PDA (personal digital assistant), PAD (tablet computer), PMP are (portable more Media player), the mobile terminal and such as number TV, desktop computer of car-mounted terminal (such as vehicle mounted guidance terminal) etc. Etc. fixed terminal.Electronic equipment shown in Fig. 3 is only an example, should not function and use to the embodiment of the present application Range band carrys out any restrictions.
As shown in figure 3, electronic equipment 800 may include processing unit (such as central processing unit, graphics processor etc.) 801, random access can be loaded into according to the program being stored in read-only memory (ROM) 802 or from storage device 808 Program in memory (RAM) 803 and execute various movements appropriate and processing.In RAM 803, it is also stored with electronic equipment Various programs and data needed for 800 operations.Processing unit 801, ROM 802 and RAM 803 pass through the phase each other of bus 804 Even.Input/output (I/O) interface 805 is also connected to bus 804.
In general, following device can connect to I/O interface 805: including such as touch screen, touch tablet, keyboard, mouse, taking the photograph As the input unit 806 of head, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaker, vibration The output device 807 of dynamic device etc.;Storage device 808 including such as tape, hard disk etc.;And communication device 809.Communication device 809, which can permit electronic equipment 800, is wirelessly or non-wirelessly communicated with other equipment to exchange data.Although Fig. 3 shows tool There is the electronic equipment 800 of various devices, it should be understood that being not required for implementing or having all devices shown.It can be with Alternatively implement or have more or fewer devices.
Particularly, according to an embodiment of the present application, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiments herein includes a kind of computer program product comprising be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed from network by communication device 809, or from storage device 808 It is mounted, or is mounted from ROM 802.When the computer program is executed by processing unit 801, the embodiment of the present application is executed Method in the above-mentioned function that limits.
It should be noted that the above-mentioned computer-readable medium of the application can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In this application, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In application, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, In carry computer-readable program code.The data-signal of this propagation can take various forms, including but not limited to Electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer-readable and deposit Any computer-readable medium other than storage media, the computer-readable signal media can send, propagate or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: electric wire, optical cable, RF (radio frequency) etc. are above-mentioned Any appropriate combination.
Above-mentioned computer-readable medium can be included in above-mentioned electronic equipment;It is also possible to individualism, and not It is fitted into the electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when said one or multiple programs are by the electricity When sub- equipment executes, so that the electronic equipment: obtaining at least two internet protocol addresses;Send to Node evaluation equipment includes institute State the Node evaluation request of at least two internet protocol addresses, wherein the Node evaluation equipment is internet from described at least two In protocol address, chooses internet protocol address and return;Receive the internet protocol address that the Node evaluation equipment returns;Its In, the fringe node in acquired internet protocol address instruction content distributing network.
Alternatively, above-mentioned computer-readable medium carries one or more program, when said one or multiple programs When being executed by the electronic equipment, so that the electronic equipment: receiving the Node evaluation including at least two internet protocol addresses and request; From at least two internet protocol address, internet protocol address is chosen;Return to the internet protocol address selected;Wherein, The fringe node in internet protocol address instruction content distributing network received.
The calculating of the operation for executing the application can be write with one or more programming languages or combinations thereof Machine program code, above procedure design language include object oriented program language-such as Java, Smalltalk, C+ +, it further include conventional procedural programming language-such as " C " language or similar programming language.Program code can Fully to execute, partly execute on the user computer on the user computer, be executed as an independent software package, Part executes on the remote computer or executes on a remote computer or server completely on the user computer for part. In situations involving remote computers, remote computer can pass through the network of any kind --- including local area network (LAN) Or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as utilize Internet service Provider is connected by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the application, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in the embodiment of the present application can be realized by way of software, can also be by hard The mode of part is realized.Wherein, the title of unit does not constitute the restriction to the unit itself under certain conditions, for example, the One acquiring unit is also described as " obtaining the unit of at least two internet protocol addresses ".
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that the open scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from design disclosed above, it is carried out by above-mentioned technical characteristic or its equivalent feature Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed herein Can technical characteristic replaced mutually and the technical solution that is formed.

Claims (10)

1. the method that a kind of pair of user interface UI element is identified characterized by comprising
Increase dynamic binding attribute tag field in default root class, the dynamic binding attribute tag field is embodied as sky;
When running automated test tool, by calling the Hook Function of predefined type to the dynamic binding attribute tag field Realization accordingly modified so that returning to corresponding UI element mark when reading the dynamic binding attribute tag field Know.
2. the method according to claim 1, wherein for need inherit use class, for showing content Class and any one of the class for input content, by calling the Hook Function of predefined type to the dynamic binding attribute The realization of tag field is accordingly modified, comprising:
Corresponding initialization function is hooked by the Hook Function, and by the dynamic binding category in the initialization function Property tag field is assigned a value of corresponding class name.
3. according to the method described in claim 2, it is characterized in that, when in any sort exist repeatability UI element when, for each The dynamic binding attribute tag field is assigned a value of corresponding by repeated UI element respectively in corresponding initialization function The combination of class name and the predetermined mark of UI element.
4. the method according to claim 1, wherein for for showing the class of content or for input content Class, it is described by calling the Hook Function of predefined type accordingly to repair the realization of the dynamic binding attribute tag field Change, comprising:
Determine target set content;
Corresponding set content function is hooked by the Hook Function, and ties up the dynamic in the set content function Determine the value that attribute tag field is assigned a value of the target set content.
5. described pre- by calling the method according to claim 1, wherein for the class for input content The Hook Function for determining type accordingly modifies the realization of the dynamic binding attribute tag field, comprising:
Scheduled setting placeholder function is hooked by the Hook Function, and will in the scheduled setting placeholder function The dynamic binding attribute tag field is assigned a value of the value of placeholder.
6. the method according to claim 1, wherein the method is applied to IOS operating system, wherein described Default root class includes NSObject, and the automated test tool includes UITest.
7. the device that a kind of pair of user interface UI element is identified characterized by comprising
First processing module, for increasing dynamic binding attribute tag field, the dynamic binding attribute mark in default root class Note field is embodied as sky;
Second processing module, when for running automated test tool, by calling the Hook Function of predefined type to described dynamic The realization of state bind properties tag field is accordingly modified, so that returning when reading the dynamic binding attribute tag field Return corresponding UI component identification.
8. device according to claim 7, which is characterized in that for need inherit use class, for showing content Class and any one of the class for input content, the Second processing module is specifically used for hooking by the Hook Function Corresponding initialization function, and the dynamic binding attribute tag field is assigned a value of corresponding class in the initialization function Name.
9. a kind of electronic equipment including memory, processor and stores the calculating that can be run on a memory and on a processor Machine program, which is characterized in that the processor is realized of any of claims 1-6 to user when executing described program Interface UI element is identified method.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium Program, which realizes when being executed by processor of any of claims 1-6 marks user interface UI element Knowledge method.
CN201811291510.3A 2018-10-31 2018-10-31 The method, apparatus and electronic equipment be identified to user interface UI element Pending CN109446092A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811291510.3A CN109446092A (en) 2018-10-31 2018-10-31 The method, apparatus and electronic equipment be identified to user interface UI element

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811291510.3A CN109446092A (en) 2018-10-31 2018-10-31 The method, apparatus and electronic equipment be identified to user interface UI element

Publications (1)

Publication Number Publication Date
CN109446092A true CN109446092A (en) 2019-03-08

Family

ID=65549491

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811291510.3A Pending CN109446092A (en) 2018-10-31 2018-10-31 The method, apparatus and electronic equipment be identified to user interface UI element

Country Status (1)

Country Link
CN (1) CN109446092A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110058996A (en) * 2019-03-12 2019-07-26 天津五八到家科技有限公司 Program debugging method, device, equipment and storage medium
CN110427233A (en) * 2019-06-26 2019-11-08 北京三快在线科技有限公司 Back-end data binding method, device, electronic equipment and storage medium
CN111045941A (en) * 2019-12-09 2020-04-21 广州品唯软件有限公司 Positioning method and device of user interface control and storage medium
CN112559311A (en) * 2019-09-10 2021-03-26 北京京东振世信息技术有限公司 Interface adaptation method and device for automatic testing of mobile terminal
CN113366492A (en) * 2020-09-08 2021-09-07 尤帕斯公司 Dedicated graphical element detection

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521121A (en) * 2011-11-18 2012-06-27 华为技术有限公司 Page testing method and page testing device
CN107015903A (en) * 2016-01-27 2017-08-04 阿里巴巴集团控股有限公司 A kind of generation method, device and the electronic equipment of interface detection program
CN108170612A (en) * 2018-01-23 2018-06-15 百度在线网络技术(北京)有限公司 A kind of automated testing method, device and server
US10019344B1 (en) * 2015-08-31 2018-07-10 VCE IP Holding Company LLC Computer implemented system and method and computer program product for a test framework for orchestration workflows
CN108536589A (en) * 2018-03-26 2018-09-14 广州小鹏汽车科技有限公司 A kind of application program buries point methods and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521121A (en) * 2011-11-18 2012-06-27 华为技术有限公司 Page testing method and page testing device
US10019344B1 (en) * 2015-08-31 2018-07-10 VCE IP Holding Company LLC Computer implemented system and method and computer program product for a test framework for orchestration workflows
CN107015903A (en) * 2016-01-27 2017-08-04 阿里巴巴集团控股有限公司 A kind of generation method, device and the electronic equipment of interface detection program
CN108170612A (en) * 2018-01-23 2018-06-15 百度在线网络技术(北京)有限公司 A kind of automated testing method, device and server
CN108536589A (en) * 2018-03-26 2018-09-14 广州小鹏汽车科技有限公司 A kind of application program buries point methods and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杨萧玉: "UIAutomation添加自动化测试标签的探索", 《HTTP://YULINGTIANXIA.COM/BLOG/2016/03/28/ADD-UITEST-LABEL-FOR-UIAUTOMATION/》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110058996A (en) * 2019-03-12 2019-07-26 天津五八到家科技有限公司 Program debugging method, device, equipment and storage medium
CN110427233A (en) * 2019-06-26 2019-11-08 北京三快在线科技有限公司 Back-end data binding method, device, electronic equipment and storage medium
CN112559311A (en) * 2019-09-10 2021-03-26 北京京东振世信息技术有限公司 Interface adaptation method and device for automatic testing of mobile terminal
CN112559311B (en) * 2019-09-10 2023-08-04 北京京东振世信息技术有限公司 Interface adaptation method and device for mobile terminal automatic test
CN111045941A (en) * 2019-12-09 2020-04-21 广州品唯软件有限公司 Positioning method and device of user interface control and storage medium
CN111045941B (en) * 2019-12-09 2023-08-18 广州品唯软件有限公司 Positioning method and device for user interface control and storage medium
CN113366492A (en) * 2020-09-08 2021-09-07 尤帕斯公司 Dedicated graphical element detection
CN113366492B (en) * 2020-09-08 2024-03-01 尤帕斯公司 Dedicated graphic element detection

Similar Documents

Publication Publication Date Title
CN109446092A (en) The method, apparatus and electronic equipment be identified to user interface UI element
CN109062563B (en) Method and device for generating page
US11586772B2 (en) Method and device for displaying information
CN111221572B (en) Method, device, medium and equipment for automatically adapting to running environment
CN109656923A (en) A kind of data processing method, device, electronic equipment and storage medium
CN111209202A (en) Terminal application testing method and device
CN109857971A (en) Page rendering method and apparatus
CN110222775A (en) Image processing method, device, electronic equipment and computer readable storage medium
CN109271778B (en) Using installation source differentiating method, electronic equipment and computer storage medium
CN109684188A (en) Test method and device
CN109284198A (en) A kind of method and apparatus verifying data
CN112395188A (en) Test-oriented software project development method and device, electronic equipment and storage medium
CN112463729A (en) Data file storage method and device, electronic equipment and medium
CN109614327A (en) Method and apparatus for output information
CN108959642A (en) Method and apparatus for information to be written
CN110188782A (en) Image similarity determines method, apparatus, electronic equipment and readable storage medium storing program for executing
CN108733614A (en) Data transmission system, method and apparatus
CN107229565B (en) Test method and device
CN110389899A (en) Detect square law device, medium and the equipment of the API data type of JS program
CN110489326B (en) IDS-based HTTPAPI debugging method device, medium and equipment
CN109408387B (en) Page testing method and device
CN111506904A (en) Method and device for online vulnerability repair
CN109685472A (en) A kind of electronic signature method, device, electronic equipment and medium
CN109491687A (en) A kind of hot update method, device, terminal and the readable medium of application software
CN108415849A (en) Method and apparatus for test application

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