| Package | mx.automation |
| Class | public class AutomationID |
| Inheritance | AutomationID Object |
property_1_name{property_1_value property_1_type}property_2_name{property_2_value property_2_type}|property_1_name{property_1_value property_1_type}property_2_name{property_2_value property_2_type}
Consider a Flex application with following hierarchy:
Application -- > Accordion -- > HBox -- > Button
The AutomationID of the button would consist of four AutomationIDParts, one for application, one for Accordion, one for HBox, and one for the Button. AutomationIDPart is a table of property names and their values. The property-value pairs are different for different object types. These property-value pairs should be usable to identify the object uniquely.
AutomationID is created by walking the parent hierarchy of the leaf child object and creating
the AutomationIDPart for each object encountered. Parents that have
showInAutomationHierarchy set to false are skipped. Children of such
parents are considered the children of the next higher
parent whose showInAuto flag is set to true. During recording,
this AutomationID is passed to QTP and QTP parses this information and updates its OR.
During playback when QTP provides AutomationID for finding an object, the Display object
hierarchy is walked from the top Application object downwards. At each level, a child that
matches the AutomationIDPart closest is picked up from the list of all the children. If
multiple children match the criteria, an error is thrown. Users are responsible to resolve
such conflicts by providing a unique automationName or identifying new properties on
objects which make them unique.
QTP makes AutomationIDs persistent by saving them in the OR. Other agents should
save the object information if they desire persistence. AutomationID provides
toString() and parse() methods to convert the object to a
string representation and back.
You can use the IAutomationManager.createAutomationID() and
IAutomationManager.resolveAutomationID() methods
to create and resolve AutomationID objects, respectively.
You can use the IAutomationObjectHelper.helpCreateIDPart()
and IAutomationObjectHelper.helpResolveIDPart() methods
to identify a child with in a parent which matches the AutomationIDPart.
| Property | Defined by | ||
|---|---|---|---|
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance.
| Object | |
| length : int
[read-only]
The number of parts in this id.
| AutomationID | ||
![]() | prototype : Object
[static]
A reference to the prototype object of a class or function object.
| Object | |
| Method | Defined by | ||
|---|---|---|---|
|
Constructor.
| AutomationID | ||
|
addFirst(p:AutomationIDPart):void
Adds a parts to the front of the id.
| AutomationID | ||
|
addLast(p:AutomationIDPart):void
Adds a parts to the end of the id.
| AutomationID | ||
|
Concatenates another id to this id.
| AutomationID | ||
|
Compares this object with the given AutomationID.
| AutomationID | ||
|
Indicates if there are more parts of the id.
| AutomationID | ||
|
[static]
Parses the string and returns an id.
| AutomationID | ||
|
Returns the first object in the id
| AutomationID | ||
|
Returns the last object in the id
| AutomationID | ||
|
Removes the first object from this id.
| AutomationID | ||
|
Removes the last object from this id.
| AutomationID | ||
![]() |
Sets the availability of a dynamic property for loop operations.
| Object | |
|
Serializes the id to a string.
| AutomationID | ||
![]() |
Returns the primitive value of the specified object.
| Object | |
| length | property |
length:int [read-only]The number of parts in this id.
Implementation public function get length():int
| AutomationID | () | constructor |
public function AutomationID()Constructor.
| addFirst | () | method |
public function addFirst(p:AutomationIDPart):voidAdds a parts to the front of the id.
Parametersp:AutomationIDPart — Map of properties.
|
| addLast | () | method |
public function addLast(p:AutomationIDPart):voidAdds a parts to the end of the id.
Parametersp:AutomationIDPart — Map of properties.
|
| concat | () | method |
public function concat(other:AutomationID):AutomationIDConcatenates another id to this id. Returns a new id, and does not mutate this instance.
Parametersother:AutomationID — id to concatenate.
|
AutomationID —
This id concatenated with the other id.
|
| equals | () | method |
public function equals(other:AutomationID):BooleanCompares this object with the given AutomationID.
Parametersother:AutomationID — AutomationID object which needs to be compared.
|
Boolean —
true if they are equal, false otherwise.
|
| isEmpty | () | method |
public function isEmpty():BooleanIndicates if there are more parts of the id.
ReturnsBoolean —
true if there are no more parts of the id,
false otherwise.
|
| parse | () | method |
public static function parse(s:String):AutomationIDParses the string and returns an id.
Parameterss:String — Serialized form of the id as provided by the toString() method.
|
AutomationID —
Parsed id.
|
| peekFirst | () | method |
public function peekFirst():AutomationIDPartReturns the first object in the id
ReturnsAutomationIDPart —
First object in the id.
|
| peekLast | () | method |
public function peekLast():AutomationIDPartReturns the last object in the id
ReturnsAutomationIDPart —
Last object in the id.
|
| removeFirst | () | method |
public function removeFirst():AutomationIDPartRemoves the first object from this id.
ReturnsAutomationIDPart —
First object in this id.
|
| removeLast | () | method |
public function removeLast():AutomationIDPartRemoves the last object from this id.
ReturnsAutomationIDPart —
Last object in this id.
|
| toString | () | method |
public function toString():StringSerializes the id to a string.
ReturnsString —
The serialized id.
|