Class Link
- Namespace
- Ranorex
- Assembly
- Ranorex.Core.dll
Represents a hyperlink.
public class Link : Adapter, IAdapter
- Inheritance
-
Link
- Implements
- Inherited Members
Constructors
Link()
Creates a new Link adapter instance. This constructor is used internally by the Ranorex Core Framework for performance issues!
protected Link()
Link(Element)
Creates a new Link adapter instance.
public Link(Element element)
Parameters
elementElementThe element to create the adapter for.
Exceptions
- NullReferenceException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
Properties
RequiredCapabilities
Capabilities required by the adapter implementation.
protected override string[] RequiredCapabilities { get; }
Property Value
- string[]
Text
The text displayed for the link.
public virtual string Text { get; }
Property Value
Url
The target URL the link points to.
public virtual string Url { get; }
Property Value
Methods
FromElement(Element)
Converts an Element to an instance of this class.
public static Link FromElement(Element element)
Parameters
elementElementThe element to convert.
Returns
- Link
The Link.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
FromPath(string)
Converts a string to an instance of this class by searching the root.
public static Link FromPath(string path)
Parameters
pathstringThe search path.
Returns
- Link
The Link.
Remarks
The DefaultSearchTimeout is used to search for the specified path.
Exceptions
- ArgumentNullException
If
pathisnull.- RxPathException
If the specified
pathis not valid.- ElementNotFoundException
If no element is found.
- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
Open()
Follows the hyperlink.
public virtual void Open()
Exceptions
- ActionFailedException
Thrown if invoking the action failed.
Operators
implicit operator Link(Element)
Implicitly converts an Element to an instance of this class.
public static implicit operator Link(Element element)
Parameters
elementElementThe element to convert.
Returns
- Link
The Link.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
implicit operator Link(string)
Implicitly converts a string to an instance of this class by searching the root.
public static implicit operator Link(string path)
Parameters
pathstringThe search path.
Returns
- Link
The Link.
Remarks
The DefaultSearchTimeout is used to search for the specified path.
Exceptions
- ArgumentNullException
If
pathisnull.- RxPathException
If the specified
pathis not valid.- ElementNotFoundException
If no element is found.
- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.