Table of Contents

Class ElementInfo

Namespace
Ranorex.Core
Assembly
Ranorex.Core.dll

Represents a container for a single captured element and some additional information.

public class ElementInfo
Inheritance
ElementInfo
Inherited Members

Constructors

ElementInfo(Element, RxPath, RxPath, Image, string, Guid)

Initializes a new instance of the ElementInfo class.

public ElementInfo(Element capturedElement, RxPath path, RxPath robustPath, Image screenshot, string sourceName, Guid id)

Parameters

capturedElement Element

A snapshot of an element.

path RxPath

The path of the element.

robustPath RxPath

The robust path of the element.

screenshot Image

An screenshot of the element's UI representation (can be null).

sourceName string

A logical name of the source which created the element info.

id Guid

A unique id for identifying the element info.

ElementInfo(Element, RxPath, Image, string, Guid)

Initializes a new instance of the ElementInfo class.

public ElementInfo(Element capturedElement, RxPath path, Image screenshot, string sourceName, Guid id)

Parameters

capturedElement Element

A snapshot of an element.

path RxPath

The path of the element.

screenshot Image

An screenshot of the element's UI representation (can be null).

sourceName string

A logical name of the source which created the element info.

id Guid

A unique id for identifying the element info.

Properties

Element

The snapshot of the element contained in the element info.

public Element Element { get; set; }

Property Value

Element

An element snapshot.

Id

Gets or sets the unique identifier for the element info.

public Guid Id { get; set; }

Property Value

Guid

The Guid.

LiveElementOrSnapshot

The live reference element if available, otherwhise the clone of the element contained in the element info.

public Element LiveElementOrSnapshot { get; }

Property Value

Element

The element.

LiveReferenceElement

The instance of the live element this element info was created from.

public Element LiveReferenceElement { get; set; }

Property Value

Element

The live reference element.

Remarks

This is not persisted, and is allowed to be null.

Parent

Gets or sets the parent of this instance.

public ElementInfo Parent { get; }

Property Value

ElementInfo

The parent of this instance.

Path

The path of the element contained in the element info.

public RxPath Path { get; set; }

Property Value

RxPath

The path.

PathElementMap

Gets the path element map.

public IDictionary<RxPath, ElementInfo> PathElementMap { get; }

Property Value

IDictionary<RxPath, ElementInfo>

The path element map.

ReferenceImage

A bitmap for reference information (not for image-based, but for reference screenshots)

public Bitmap ReferenceImage { get; set; }

Property Value

Bitmap

ReferencePath

The full-length reference path if the path was built with StepCostReduce, null otherwise

public string ReferencePath { get; set; }

Property Value

string

RelativePath

The relative path of the element contained in the element info, if a root element was specified when creating the ElementInfo.

public RxPath RelativePath { get; }

Property Value

RxPath

The relative path.

RobustPath

The robust path of the element contained in the element info.

public RxPath RobustPath { get; set; }

Property Value

RxPath

The robust path.

ScreenShot

Gets or sets the screen shot of the element.

public CompressedImage ScreenShot { get; set; }

Property Value

CompressedImage

The screen shot.

SourceName

The logical name of the source which created this element info.

public string SourceName { get; set; }

Property Value

string

The name of the source.

Methods

Clone()

Creates a deep clone of the ElementInfo instance.

public ElementInfo Clone()

Returns

ElementInfo

The cloned instance.

Create(Element, Element, RxPath, string, bool, bool, string, bool)

Creates a new element info given an element and a path.

public static ElementInfo Create(Element target, Element rootElement, RxPath path, string refPath, bool captureImage, bool captureLineage, string sourceName, bool includeDynamicAttributeValues)

Parameters

target Element

The target element to create the info from.

rootElement Element

The root element to create an additonal relative path to the target.

path RxPath

The already constructed element path.

refPath string

The reference path for the element. Can be null.

captureImage bool

Specifies whether to capture a screenshot for the element.

captureLineage bool

if set to true also capture all parents.

sourceName string

An arbitrary source name.

includeDynamicAttributeValues bool

Specifies whether to include values from dynamic attributes in the Element snapshot.

Returns

ElementInfo

The created ElementInfo.

Create(Element, RxPath, string, bool, bool, string)

Creates a new element info given an element and a path.

public static ElementInfo Create(Element target, RxPath path, string refPath, bool captureImage, bool captureLineage, string sourceName)

Parameters

target Element

The target element to create the info from.

path RxPath

The already constructed element path.

refPath string

The reference path for the element. Can be null.

captureImage bool

Specifies whether to capture a screenshot for the element.

captureLineage bool

if set to true also capture all parents.

sourceName string

An arbitrary source name.

Returns

ElementInfo

The created ElementInfo.

Create(Element, RxPath, string, bool, bool, string, bool)

Creates a new element info given an element and a path.

public static ElementInfo Create(Element target, RxPath path, string refPath, bool captureImage, bool captureLineage, string sourceName, bool includeDynamicAttributeValues)

Parameters

target Element

The target element to create the info from.

path RxPath

The already constructed element path.

refPath string

The reference path for the element. Can be null.

captureImage bool

Specifies whether to capture a screenshot for the element.

captureLineage bool

if set to true also capture all parents.

sourceName string

An arbitrary source name.

includeDynamicAttributeValues bool

Specifies whether to include values from dynamic attributes in the Element snapshot.

Returns

ElementInfo

The created ElementInfo.

Create(Element, bool, bool, string)

Creates a new element info from a given element.

public static ElementInfo Create(Element target, bool captureImage, bool captureLineage, string sourceName)

Parameters

target Element

The target element to create the info from.

captureImage bool

Set to true if an image should be captured.

captureLineage bool

if set to true also capture all parents.

sourceName string

An arbitrary source name.

Returns

ElementInfo

The created ElementInfo.