Interface IAdapter
The interface for all role and capability adapters.
public interface IAdapter
Properties
Children
Gets the immediate children of this adapter.
IList<Unknown> Children { get; }
Property Value
Element
The element associated with this adapter.
Element Element { get; }
Property Value
Exceptions
- CapabilityNotSupportedException
If setting the value of this property and the element does not support the capabilities required by this adapter.
Parent
Gets the parent of this adapter.
Unknown Parent { get; }
Property Value
ScreenRectangle
The bounding rectangle of the element in screen coordinates.
Rectangle ScreenRectangle { get; }
Property Value
Visible
True if the element is visible.
bool Visible { get; }
Property Value
Methods
As<T>()
Returns an adapter of the specified type for the underlying element of the current adapter.
T As<T>() where T : Adapter
Returns
- T
The specified adapter or
nullif the underlying element does not provide the capabilites required for the adapter.
Type Parameters
TThe adapter type. The supplied type must inherit from Adapter, but most not be the Adapter type itself.
Filter<T>(IList<Element>)
Filters the given element list by the specified adapter type. The returned adapter list correspond to the elements that could be converted to the specified adapter type.
IList<T> Filter<T>(IList<Element> elements) where T : Adapter
Parameters
Returns
- IList<T>
A list of adapter instances corresponding to the elements that could be converted to the specified adapter.
Type Parameters
TThe type of adapter to filter by. The supplied type must inherit from Adapter, but most not be the Adapter type itself.
Find(RxPath)
Applies a Ranorex Path to the adapter, returning all elements which match the path.
IList<Element> Find(RxPath path)
Parameters
Returns
Find(RxPath, Duration)
Applies a Ranorex Path to the adapter, returning instances of a specific adapter type (e.g. Role or Capability).
IList<Element> Find(RxPath path, Duration timeout)
Parameters
pathRxPathThe RxPath to apply.
timeoutDurationThe time to keep looking for at least one element matching the path.
Returns
FindChild<T>()
Finds an immediate child element of the given capability adapter type.
T FindChild<T>() where T : Adapter
Returns
- T
The matching element adapter.
Type Parameters
TThe adapter type to use. The supplied type must inherit from Adapter, but most not be the Adapter type itself.
Exceptions
- ElementNotFoundException
If no element is found.
FindChildren<T>()
Finds immediate child elements of the given capability adapter type.
IList<T> FindChildren<T>() where T : Adapter
Returns
- IList<T>
A list of matching element adapters.
Type Parameters
TThe adapter type to use. The supplied type must inherit from Adapter, but most not be the Adapter type itself.
FindDescendant<T>()
Finds a descendant of the given capability adapter type.
T FindDescendant<T>() where T : Adapter
Returns
- T
The matching element adapter.
Type Parameters
TThe adapter type to use. The supplied type must inherit from Adapter, but most not be the Adapter type itself.
Exceptions
- ElementNotFoundException
If no element is found.
FindDescendants<T>()
Finds all descendants of the given capability adapter type.
IList<T> FindDescendants<T>() where T : Adapter
Returns
- IList<T>
A list of matching element adapters.
Type Parameters
TThe adapter type to use. The supplied type must inherit from Adapter, but most not be the Adapter type itself.
FindSingle(RxPath)
Applies a Ranorex Path to the adapter, returning an Element.
Element FindSingle(RxPath path)
Parameters
Returns
- Element
The first element found.
Exceptions
- ElementNotFoundException
If no element is found.
FindSingle(RxPath, Duration)
Applies a Ranorex Path to the adapter, returning an Element.
Element FindSingle(RxPath path, Duration timeout)
Parameters
Returns
- Element
The first element found.
Exceptions
- ElementNotFoundException
If no element is found within the timeout.
FindSingle<T>(RxPath)
Applies a Ranorex Path to the adapter, returning a specific adapter type (e.g. Role or Capability).
T FindSingle<T>(RxPath path) where T : Adapter
Parameters
Returns
- T
The first element found converted to the specified adapter type.
Type Parameters
TThe expected adapter type. The supplied type must inherit from Adapter, but most not be the Adapter type itself.
Exceptions
- ElementNotFoundException
If no element is found.
- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
FindSingle<T>(RxPath, Duration)
Applies a Ranorex Path to the adapter, returning a specific adapter type (e.g. Role or Capability).
T FindSingle<T>(RxPath path, Duration timeout) where T : Adapter
Parameters
Returns
- T
The first element found converted to the specified adapter type.
Type Parameters
TThe expected adapter type. The supplied type must inherit from Adapter, but most not be the Adapter type itself.
Exceptions
- ElementNotFoundException
If no element is found within the timeout.
- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
Find<T>(RxPath)
Applies a Ranorex Path to the adapter, returning instances of a specific adapter type (e.g. Role or Capability).
IList<T> Find<T>(RxPath path) where T : Adapter
Parameters
Returns
- IList<T>
The result list of the path.
Type Parameters
TThe expected adapter type. The supplied type must inherit from Adapter, but most not be the Adapter type itself.
Find<T>(RxPath, Duration)
Applies a Ranorex Path to the adapter, returning instances of a specific adapter type (e.g. Role or Capability).
IList<T> Find<T>(RxPath path, Duration timeout) where T : Adapter
Parameters
pathRxPathThe RxPath to apply.
timeoutDurationThe time to keep looking for at least one element matching the path.
Returns
- IList<T>
The result list of the path.
Type Parameters
TThe expected adapter type. The supplied type must inherit from Adapter, but most not be the Adapter type itself.
TryFindSingle(RxPath, out Element)
Tries to apply a Ranorex Path to the adapter, returning an Element.
bool TryFindSingle(RxPath path, out Element foundElement)
Parameters
pathRxPathThe RxPath to apply.
foundElementElementThe first element found or
nullif no element is found.
Returns
- bool
Trueif an element is found for the specifiedpath, otherwisefalse.
TryFindSingle(RxPath, Duration, out Element)
Tries to apply a Ranorex Path to the adapter, returning an Element.
bool TryFindSingle(RxPath path, Duration timeout, out Element foundElement)
Parameters
pathRxPathThe RxPath to apply.
timeoutDurationThe time to keep looking for the element.
foundElementElementThe first element found or
nullif no element is found within the timeout.
Returns
- bool
Trueif an element is found for the specifiedpathwithin the specified timeout, otherwisefalse.
TryFindSingle<T>(RxPath, Duration, out T)
Tries to apply a Ranorex Path to the adapter, returning a specific adapter type (e.g. Role or Capability).
bool TryFindSingle<T>(RxPath path, Duration timeout, out T foundAdapter) where T : Adapter
Parameters
pathRxPathThe RxPath to apply.
timeoutDurationThe time to keep looking for the element.
foundAdapterTThe first element found converted to the specified adapter type or
nullif no element is found within the timeout or the element does not support the capabilities to create the specified adapter type.
Returns
- bool
Trueif an element is found for the specifiedpathwithin the specifiedtimeoutand the specified adapter type could be created, otherwisefalse.
Type Parameters
TThe expected adapter type. The supplied type must inherit from Adapter, but most not be the Adapter type itself.
TryFindSingle<T>(RxPath, out T)
Tries to apply a Ranorex Path to the adapter, returning a specific adapter type (e.g. Role or Capability).
bool TryFindSingle<T>(RxPath path, out T foundAdapter) where T : Adapter
Parameters
pathRxPathThe RxPath to apply.
foundAdapterTThe first element found converted to the specified adapter type or
nullif no element is found or the element does not support the capabilities to create the specified adapter type.
Returns
- bool
Trueif an element is found for the specifiedpathand the specified adapter type could be created, otherwisefalse.