Table of Contents

Class ElementEngine

Namespace
Ranorex.Core
Assembly
Ranorex.Core.dll

The ElementEngine is a singleton which controls element tree construction, element lifecycle, and manages all flavors and capabilities registered by the plugins.

public sealed class ElementEngine : MarshalByRefObject
Inheritance
ElementEngine
Inherited Members

Properties

AdapterTypes

All adapater types registered by plugins, retrievable by the Name of their corresponding Capability.

public IDictionary<string, Type> AdapterTypes { get; }

Property Value

IDictionary<string, Type>

Capabilities

All capabilities registered by plugins including all standard roles, retrievable by their Name.

public IDictionary<string, Capability> Capabilities { get; }

Property Value

IDictionary<string, Capability>

CapabilityLookup

A lookup table that provides a mapping from a capability's Name, DisplayName, ShortName, and ShortDisplayName to the corresponding capability.

public IDictionary<string, Capability> CapabilityLookup { get; }

Property Value

IDictionary<string, Capability>

Flavors

All flavors registered by plugins, retrievable by their Name.

public IDictionary<string, Flavor> Flavors { get; }

Property Value

IDictionary<string, Flavor>

GlueRules

The complete list of tree construction rules registered by the plugins.

public IList<LineageGlueRule> GlueRules { get; }

Property Value

IList<LineageGlueRule>

Instance

Retrieves the instance of the element engine.

public static ElementEngine Instance { get; }

Property Value

ElementEngine

IsLicensed

Gets a value indicating whether a valid Ranorex license has already been acquired for this process.

public static bool IsLicensed { get; }

Property Value

bool

true if a valid Ranorex license has already been acquired; otherwise, false.

Remarks

This method will return false if no node-locked license is installed and no floating license was yet acquired by this process, even if the trial period is not yet over.

RootElement

The root element of the element tree.

public Element RootElement { get; }

Property Value

Element

TimeoutEpsilon

Gets or sets the time used for internal sleep operations in between find operations using a timeout.

public Duration TimeoutEpsilon { get; set; }

Property Value

Duration

The timeout epsilon; the default value is 50 milliseconds.

Methods

FetchCurrentUtcTime()

fetching Current UTC time

public static DateTime FetchCurrentUtcTime()

Returns

DateTime

GetProductFeatures()

Gets the features supported by the currently used license.

public static ProductFeatures<ElementEngine> GetProductFeatures()

Returns

ProductFeatures<ElementEngine>

The features supported by the currently used license.

GetSubscriptionLicenseExpiryDate()

fetching ExpiryDate

public static string GetSubscriptionLicenseExpiryDate()

Returns

string

GetSubscriptionLicenseLicensedTo()

fetching Subscription LicensedTo

public static string GetSubscriptionLicenseLicensedTo()

Returns

string

Register(Capability)

Registers a capability with the element engine.

public void Register(Capability capability)

Parameters

capability Capability

The capability to register.

Remarks

Note that the capability names must be unique. This should only be used by the PluginManager.

Exceptions

RanorexCoreException

If registering fails.

Register(Flavor)

Registers a new flavor with the element engine.

public void Register(Flavor flavor)

Parameters

flavor Flavor

The flavor to register.

Remarks

Note that the flavor names must be unique. This should only be used by the PluginManager.

Exceptions

RanorexCoreException

If registering fails.

Register(LineageGlueRule)

Registers a tree construction rule with the element engine.

public void Register(LineageGlueRule rule)

Parameters

rule LineageGlueRule

The name of the rule.

Remarks

Note that the rule names must be unique. This should only be used by the PluginManager.

Exceptions

RanorexCoreException

If registering fails.

Register(string, Type)

Registers an adapter type for a given capability name with the element engine.

public void Register(string capabilityName, Type adapterType)

Parameters

capabilityName string

The name of the capability for which the adapter is registered.

adapterType Type

The type of the adapter to be registered.

Exceptions

RanorexCoreException

If registering fails.

WaitForValidLicense()

Waits for valid license to become available.

public static void WaitForValidLicense()

Remarks

This method works both with floating and node-locked licenses being configured on the local machine. If no license is configured, this method will instantly return whether the evaluation period is still valid (the evaluation dialog will be displayed, when the Instance property is first accessed).

No dialogs or error messages will be shown by this method.

WaitForValidLicense(Duration, Duration)

Waits for valid license to become available.

public static bool WaitForValidLicense(Duration timeout, Duration checkInterval)

Parameters

timeout Duration

The maximum time the method should wait for a license to become available.

checkInterval Duration

The interval between individual checks for a valid license to become available.

Returns

bool

true if a valid license becomes available within the timeout; false otherwise.

Remarks

This method works both with floating and node-locked licenses being configured on the local machine. If no license is configured, this method will instantly return whether the evaluation period is still valid (the evaluation dialog will be displayed, when the Instance property is first accessed).

No dialogs or error messages will be shown by this method.

Exceptions

ArgumentOutOfRangeException

If timeout is or checkInterval is negative.