Class ElementEngine
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
Capabilities
All capabilities registered by plugins including all standard roles, retrievable by their Name.
public IDictionary<string, Capability> Capabilities { get; }
Property Value
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
Flavors
All flavors registered by plugins, retrievable by their Name.
public IDictionary<string, Flavor> Flavors { get; }
Property Value
GlueRules
The complete list of tree construction rules registered by the plugins.
public IList<LineageGlueRule> GlueRules { get; }
Property Value
Instance
Retrieves the instance of the element engine.
public static ElementEngine Instance { get; }
Property Value
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
trueif 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
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
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
GetSubscriptionLicenseLicensedTo()
fetching Subscription LicensedTo
public static string GetSubscriptionLicenseLicensedTo()
Returns
Register(Capability)
Registers a capability with the element engine.
public void Register(Capability capability)
Parameters
capabilityCapabilityThe 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
flavorFlavorThe 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
ruleLineageGlueRuleThe 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
capabilityNamestringThe name of the capability for which the adapter is registered.
adapterTypeTypeThe 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
timeoutDurationThe maximum time the method should wait for a license to become available.
checkIntervalDurationThe interval between individual checks for a valid license to become available.
Returns
- bool
trueif a valid license becomes available within the timeout;falseotherwise.
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
timeoutis orcheckIntervalis negative.