Table of Contents

Class RepoItemInfo

Namespace
Ranorex.Core.Repository
Assembly
Ranorex.Core.dll

Contains information about a RepositoryItem.

public class RepoItemInfo : IReportMetadata
Inheritance
RepoItemInfo
Implements
Inherited Members

Constructors

RepoItemInfo(RepoGenBaseFolder, string, RxPath, RxPath, Duration, bool?, string)

Creates a new instance.

public RepoItemInfo(RepoGenBaseFolder parentFolder, string name, RxPath path, RxPath robustPath, Duration searchTimeout, bool? useEnsureVisible, string itemId)

Parameters

parentFolder RepoGenBaseFolder

The parent folder of the associated repository item.

name string

The name of the associated repository item.

path RxPath

The path of the associated repository item.

robustPath RxPath

The robust path of the associated repository item.

searchTimeout Duration

The search timeout of the associated repository item.

useEnsureVisible bool?

The value set to UseEnsureVisible of the adapter created for the associated repository item.

itemId string

The id of the associated repository item.

RepoItemInfo(RepoGenBaseFolder, string, RxPath, Duration, bool?)

Creates a new instance.

public RepoItemInfo(RepoGenBaseFolder parentFolder, string name, RxPath path, Duration searchTimeout, bool? useEnsureVisible)

Parameters

parentFolder RepoGenBaseFolder

The parent folder of the associated repository item.

name string

The name of the associated repository item.

path RxPath

The path of the associated repository item.

searchTimeout Duration

The search timeout of the associated repository item.

useEnsureVisible bool?

The value set to UseEnsureVisible of the adapter created for the associated repository item.

RepoItemInfo(RepoGenBaseFolder, string, RxPath, Duration, bool?, string)

Creates a new instance.

public RepoItemInfo(RepoGenBaseFolder parentFolder, string name, RxPath path, Duration searchTimeout, bool? useEnsureVisible, string itemId)

Parameters

parentFolder RepoGenBaseFolder

The parent folder of the associated repository item.

name string

The name of the associated repository item.

path RxPath

The path of the associated repository item.

searchTimeout Duration

The search timeout of the associated repository item.

useEnsureVisible bool?

The value set to UseEnsureVisible of the adapter created for the associated repository item.

itemId string

The id of the associated repository item.

Properties

AbsolutePath

Gets the absolute path of the associated repository item.

public RxPath AbsolutePath { get; }

Property Value

RxPath

Children

Gets the children of this repository item.

public IList<RepoItemInfo> Children { get; }

Property Value

IList<RepoItemInfo>

A a read-only list containing the children of the repository item.

Remarks

You can use this property to traverse the repository at runtime.

FullName

Gets the name of the associated repository item preceded by the names of all folders that are parents of this item in a namespace-like representation, i.e. "AppFolder.RootedFolder.Folder.Item".

public string FullName { get; }

Property Value

string

Name

Gets the name of the associated repository item.

public string Name { get; }

Property Value

string

ParentFolder

Gets the parent folder of the associated repository item.

public RepoGenBaseFolder ParentFolder { get; }

Property Value

RepoGenBaseFolder

Path

Gets the path of the associated repository item (relative to its parent folder).

public RxPath Path { get; set; }

Property Value

RxPath

RobustPath

Gets the robust path of the associated repository item (relative to its parent folder).

public RxPath RobustPath { get; set; }

Property Value

RxPath

SearchTimeout

Gets the search timeout of the associated repository item (relative to its parent folder).

public Duration SearchTimeout { get; set; }

Property Value

Duration

Exceptions

ArgumentOutOfRangeException

If value is negative.

UseEnsureVisible

Gets the value set to UseEnsureVisible of the adapter created for the associated repository item.

public bool? UseEnsureVisible { get; set; }

Property Value

bool?

Methods

CreateAdapter<T>(bool)

Creates an adapter instance for the associated repository item.

public T CreateAdapter<T>(bool throwException) where T : Adapter

Parameters

throwException bool

A value indicating whether to throw an exception if creating an adapter failed.

Returns

T

An adapter for the associated repository item or null if creating an adapter failed and throwException is false.

Type Parameters

T

The type of adapter to create. The supplied type must inherit from Adapter, but most not be the Adapter type itself.

CreateAdapter<T>(bool, Duration)

Creates an adapter instance for the associated repository item.

public T CreateAdapter<T>(bool throwException, Duration waitTimeout) where T : Adapter

Parameters

throwException bool

A value indicating whether to throw an exception if creating an adapter failed.

waitTimeout Duration

The timeout used to search/wait for the element. The value overrides the Effective Timeout for the repository item (for that call only).

Returns

T

An adapter for the associated repository item or null if creating an adapter failed and throwException is false.

Type Parameters

T

The type of adapter to create. The supplied type must inherit from Adapter, but most not be the Adapter type itself.

CreateAdapters<T>()

Creates adapter instances for all elements found for the associated repository item's path.

public IList<T> CreateAdapters<T>() where T : Adapter

Returns

IList<T>

A list of adapters for all elements found for the associated repository item's path.

Type Parameters

T

The type of adapters to create. The supplied type must inherit from Adapter, but most not be the Adapter type itself.

Remarks

The results of this method may depend on whether folders in the hierarchy use caching.

CreateAdapters<T>(Duration)

Creates adapter instances for all elements found for the associated repository item's path.

public IList<T> CreateAdapters<T>(Duration waitTimeout) where T : Adapter

Parameters

waitTimeout Duration

The timeout used to search/wait for the elements. The value overrides the Effective Timeout for the repository item (for that call only).

Returns

IList<T>

A list of adapters for all elements found for the associated repository item's path.

Type Parameters

T

The type of adapters to create. The supplied type must inherit from Adapter, but most not be the Adapter type itself.

Remarks

The results of this method may depend on whether folders in the hierarchy use caching.

Exists()

Returns a value specifying whether the element for the associated repository item exists.

public bool Exists()

Returns

bool

True if the element for the associated repository item exists.

Exists(Duration)

Returns a value specifying whether the element for the associated repository item exists within the specified timeout.

public bool Exists(Duration waitTimeout)

Parameters

waitTimeout Duration

The timeout used to search/wait for the element. The value overrides the Effective Timeout for the repository item (for that call only).

Returns

bool

True if the element for the associated repository item exists.

Exists<T>(Duration, out T)

Returns a value specifying whether the specified adapter for the associated repository item exists within the specified timeout.

public bool Exists<T>(Duration waitTimeout, out T adapter) where T : Adapter

Parameters

waitTimeout Duration

The timeout used to search/wait for the element. The value overrides the Effective Timeout for the repository item (for that call only).

adapter T

When this method returns, the adapter instance for the associated repository item, if it could be created; otherwise a null reference.

Returns

bool

True if the specified adapter for the associated repository item exists.

Type Parameters

T

The type of adapter to create. The supplied type must inherit from Adapter, but most not be the Adapter type itself.

Exists<T>(out T)

Returns a value specifying whether the specified adapter for the associated repository item exists.

public bool Exists<T>(out T adapter) where T : Adapter

Parameters

adapter T

When this method returns, the adapter instance for the associated repository item, if it could be created; otherwise a null reference.

Returns

bool

True if the specified adapter for the associated repository item exists.

Type Parameters

T

The type of adapter to create. The supplied type must inherit from Adapter, but most not be the Adapter type itself.

FindAdapter<T>()

Finds and creates an adapter instance for the associated repository item.

public T FindAdapter<T>() where T : Adapter

Returns

T

An adapter for the associated repository item

Type Parameters

T

The type of adapter to create. The supplied type must inherit from Adapter, but most not be the Adapter type itself.

Exceptions

ElementNotFoundException

Throws exception if the element is not found.

GetImage(string)

Gets an image by ID.

protected CompressedImage GetImage(string id)

Parameters

id string

The ID of an image to get.

Returns

CompressedImage

The image.

GetImage(string, Rectangle)

Crops the given image by the specified ID and rectangle.

protected CompressedImage GetImage(string id, Rectangle cropRect)

Parameters

id string

The ID of an image to get.

cropRect Rectangle

The bounds of the sub-image inside the image to return.

Returns

CompressedImage

The cropped image.

GetMetaInfos()

Returns a (non read-only!) dictionary of string key-value pairs specifying meta data for a report.

public IDictionary<string, string> GetMetaInfos()

Returns

IDictionary<string, string>

A (non read-only!) dictionary of strings.

ToString()

Returns a string representation, i.e. the FullName, of this instance.

public override string ToString()

Returns

string

The FullName of this instance.

WaitForAttributeContains(Duration, string, object)

Waits until an element attribute of the associated repository item contains a specified value.

public void WaitForAttributeContains(Duration waitTimeout, string name, object value)

Parameters

waitTimeout Duration

The time in ms to wait for the attribute to contain the specified value.

name string

The name of the attribute to be validated.

value object

The value that the attribute should contain.

Exceptions

RanorexException

If the associated item stops existing or if the timeout is reached.

WaitForAttributeEqual(Duration, string, object)

Waits until an element attribute of the associated repository item equals a specified value.

public void WaitForAttributeEqual(Duration waitTimeout, string name, object value)

Parameters

waitTimeout Duration

The time in ms to wait for the attribute to equal the specified value.

name string

The name of the attribute to be validated.

value object

The value that the attribute should equal.

Exceptions

RanorexException

If the associated item stops existing or if the timeout is reached.

WaitForAttributeNotContains(Duration, string, object)

Waits until an element attribute of the associated repository item does not contain a specified value.

public void WaitForAttributeNotContains(Duration waitTimeout, string name, object value)

Parameters

waitTimeout Duration

The time in ms to wait for the attribute to not contain the specified value.

name string

The name of the attribute to be validated.

value object

The value that the attribute should not contain.

Exceptions

RanorexException

If the associated item stops existing or if the timeout is reached.

WaitForAttributeNotEqual(Duration, string, object)

Waits until an element attribute of the associated repository item does not equal a specified value.

public void WaitForAttributeNotEqual(Duration waitTimeout, string name, object value)

Parameters

waitTimeout Duration

The time in ms to wait for the attribute to not equal the specified value.

name string

The name of the attribute to be validated.

value object

The value that the attribute should not equal.

Exceptions

RanorexException

If the associated item stops existing or if the timeout is reached.

WaitForExists(Duration)

Waits until the element for the associated repository item exists.

public void WaitForExists(Duration waitTimeout)

Parameters

waitTimeout Duration

The time to wait for the element to exist.

Exceptions

RanorexException

If the timeout is reached while validating the attribute of the element or if the element does not exist.

WaitForNotExists(Duration)

Waits until the element for the associated repository item ceases to exist.

public void WaitForNotExists(Duration waitTimeout)

Parameters

waitTimeout Duration

The time to wait for the element to cease to exist.

Exceptions

RanorexException

If the waitTimeout is reached while waiting for the item to cease to exist.