Click or drag to resize
Ranorex

Element Class

Represents an UI item in the global UI tree. Instances of this class dynamically implement a Role and optional Capabilities, as well as numerous standard properties.
Inheritance Hierarchy
SystemObject
  SystemMarshalByRefObject
    Ranorex.CoreElement

Namespace:  Ranorex.Core
Assembly:  Ranorex.Core (in Ranorex.Core.dll) Version: 12.7.4-git.38314c06
Syntax
[SerializableAttribute]
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
public class Element : MarshalByRefObject, IElement, 
	ISerializable

The Element type exposes the following members.

Constructors
  NameDescription
Protected methodElement
For Ranorex internal use only. Initializes a new instance of the Element class.
Top
Properties
  NameDescription
Public propertyActions
A list of actions the element supports. This list is aggregated from the role and the capabilities.
Public propertyAttributes
A list of attributes the element supports. This list is aggregated from the role and the capabilities.
Public propertyCapabilities
The list of the capabilities the element has.
Public propertyChildIndex
The index of this element in the parent's child list. Is '-1' if the index is unknown.
Public propertyChildren
The list of children the element has.
Public propertyClientRectangle
The bounding rectangle of the element, relative to the parent.
Public propertyDynamicCapability
Gets a capability providing dynamic attributes and actions that the element supports.
Public propertyEnabled
True if the element is enabled.
Public propertyFlavorElement
The flavor element associated with the element. This can be null, for example when using static snapshots.
Public propertyFlavorName
The name of the flavor this element belongs to.
Public propertyHasFocus
True if the element has the focus.
Public propertyIsRemote
Gets a value indicating whether the element resides on a remote device.
Public propertyIsSnapshot
Gets a value indicating whether this instance is a snapshot.
Public propertyItem
Indexer for attribute access.
Public propertyLimitations
Gets a list of technology specify limitations that are associated with this element.
Public propertyLocation
The location of the element, relative to its parent.
Public propertyParent
The parent of the element.
Public propertyPreferredCapability
The preferred capability of the element.
Public propertyRole
The role of the element (= main capability).
Public propertyScreenLocation
The location of the element in screen coordinates.
Public propertyScreenRectangle
The bounding rectangle of the element in screen coordinates.
Public propertySize
The (x,y) size of element.
Public propertyTopLevelAncestor
The top-level ancestor of the element.
Public propertyValid
Returns true if the element is believed to be valid.
Public propertyVisible
True if the element is visible.
Top
Methods
  NameDescription
Public methodAsT
Returns an adapter of the specified type for the element.
Public methodCaptureCompressedImage
Captures a PNG image of the element.
Public methodCreateObjRef
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Inherited from MarshalByRefObject.)
Public methodEnsureVisible
Tries to make the element visible to the user. This is usually accomplished by bringing the element or one of its ancestors to foreground.
Public methodEquals(Object)
Compares the element to an object.
(Overrides ObjectEquals(Object).)
Public methodStatic memberEquals(Element, Element)
Returns true if the two instances are considered equal.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFind(RxPath)
Applies a Ranorex Path to the element.
Public methodFind(RxPath, Duration)
Applies a Ranorex Path to the element.
Public methodFindFromPoint(Point)
Find an element by screen location. The found element is a descendant of this instance or this instance itself.
Public methodFindFromPoint(Point, RxPath)
Find an element by screen location and build its RxPath. The found element is a descendant of this instance or this instance itself.
Public methodFindFromUid
Finds a descendant element by its unique identifier attribute (defined by the owner flavor UidAttribute name).
Public methodFindSingle(RxPath)
Applies a Ranorex Path to the element.
Public methodFindSingle(RxPath, Duration)
Applies a Ranorex Path to the element.
Public methodFocus
Tries to set the focus on the element.
Public methodStatic memberFromPath
Converts a string to an element instance by searching the root.
Public methodGetAttributeValue
Returns the value of an attribute.
Public methodGetAttributeValueText(String)
Returns the value of an attribute converted to its string representation.
Public methodGetAttributeValueText(String, Regex)
Returns the value of an attribute converted to its string representation. If a regex is provided, only the part of the string representation matching the regular expression is returned.
Public methodGetHashCode
Default implementation override.
(Overrides ObjectGetHashCode.)
Public methodGetLifetimeService
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Public methodGetObjectData
For Ranorex internal use only. Populates a SerializationInfo with the data needed to serialize the target object.
Public methodGetPath(PathBuildMode)
Builds an absolute RxPath to the element.
Public methodGetPath(PathBuildMode, Element)
Builds an RxPath to the element, relative to another element.
Public methodGetRobustPath
Builds an absolute RxPath to the element.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHasCapability
Tests if the element possesses a certain capability (or role), by name.
Public methodInitializeLifetimeService
Obtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Public methodInvokeAction
Invokes an action on the element.
Public methodInvokeActionWithText
Invokes an action on the element.
Public methodIsAncestor
Determines whether the current element is an ancestor of the specified child element.
Public methodIsEqual
Compares two elements by comparing their flavor elements or their screen rectangles if no flavor comparison is possible.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodMemberwiseClone(Boolean)
Creates a shallow copy of the current MarshalByRefObject object.
(Inherited from MarshalByRefObject.)
Public methodSetAttributeValue(String, Object)
Sets the value of an attribute.
Public methodSetAttributeValue(String, String)
Sets the value of an attribute.
Public methodToString
Returns a String that represents the current Object.
(Overrides ObjectToString.)
Public methodTryFindSingle(RxPath, Element)
Tries to apply a Ranorex Path to the element.
Public methodTryFindSingle(RxPath, Duration, Element)
Tries to apply a Ranorex Path to the element.
Top
Operators
  NameDescription
Public operatorStatic member(String to Element)
Implicitly converts a string to an element instance by searching the root.
Top
See Also