Table of Contents

Class Link

Namespace
Ranorex
Assembly
Ranorex.Core.dll

Represents a hyperlink.

public class Link : Adapter, IAdapter
Inheritance
Link
Implements
Inherited Members

Constructors

Creates a new Link adapter instance. This constructor is used internally by the Ranorex Core Framework for performance issues!

protected Link()

Creates a new Link adapter instance.

public Link(Element element)

Parameters

element Element

The element to create the adapter for.

Exceptions

NullReferenceException

If element is null.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.

Properties

Capabilities required by the adapter implementation.

protected override string[] RequiredCapabilities { get; }

Property Value

string[]

The text displayed for the link.

public virtual string Text { get; }

Property Value

string

The target URL the link points to.

public virtual string Url { get; }

Property Value

string

Methods

Converts an Element to an instance of this class.

public static Link FromElement(Element element)

Parameters

element Element

The element to convert.

Returns

Link

The Link.

Exceptions

ArgumentNullException

If element is null.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.

Converts a string to an instance of this class by searching the root.

public static Link FromPath(string path)

Parameters

path string

The search path.

Returns

Link

The Link.

The DefaultSearchTimeout is used to search for the specified path.

Exceptions

ArgumentNullException

If path is null.

RxPathException

If the specified path is not valid.

ElementNotFoundException

If no element is found.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.

Follows the hyperlink.

public virtual void Open()

Exceptions

ActionFailedException

Thrown if invoking the action failed.

Operators

Implicitly converts an Element to an instance of this class.

public static implicit operator Link(Element element)

Parameters

element Element

The element to convert.

Returns

Link

The Link.

Exceptions

ArgumentNullException

If element is null.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.

Implicitly converts a string to an instance of this class by searching the root.

public static implicit operator Link(string path)

Parameters

path string

The search path.

Returns

Link

The Link.

The DefaultSearchTimeout is used to search for the specified path.

Exceptions

ArgumentNullException

If path is null.

RxPathException

If the specified path is not valid.

ElementNotFoundException

If no element is found.

CapabilityNotSupportedException

If the element does not support the capabilities required by this adapter.