Table of Contents

Class JavaElement

Namespace
Ranorex
Assembly
Ranorex.Plugin.Java.dll

The element is a part of a Java application.

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

Constructors

JavaElement()

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

protected JavaElement()

JavaElement(Element)

Creates a new JavaElement adapter instance.

public JavaElement(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

AccessibleDescription

The accessibility description of the Java component.

public virtual string AccessibleDescription { get; }

Property Value

string

AccessibleName

The accessibility name of the Java component.

public virtual string AccessibleName { get; }

Property Value

string

BaseType

The full type name of the base Java component in the JRE.

public virtual string BaseType { get; }

Property Value

string

FullType

The full type name of the Java component.

public virtual string FullType { get; }

Property Value

string

Name

The name of the Java component.

public virtual string Name { get; }

Property Value

string

RanorexLibVersion

The version of the Ranorex Java automation library.

public virtual string RanorexLibVersion { get; }

Property Value

string

RequiredCapabilities

Capabilities required by the adapter implementation.

protected override string[] RequiredCapabilities { get; }

Property Value

string[]

StyleClass

Zero or more FX style classes assigned to the Java FX Node.

public virtual string StyleClass { get; }

Property Value

string

Type

The class name of the Java component.

public virtual string Type { get; }

Property Value

string

Methods

FromElement(Element)

Converts an Element to an instance of this class.

public static JavaElement FromElement(Element element)

Parameters

element Element

The element to convert.

Returns

JavaElement

The JavaElement.

Exceptions

ArgumentNullException

If element is null.

CapabilityNotSupportedException

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

FromPath(string)

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

public static JavaElement FromPath(string path)

Parameters

path string

The search path.

Returns

JavaElement

The JavaElement.

Remarks

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.

GetPropertyValue(string)

Gets the property value of the specified Java object.

public virtual object GetPropertyValue(string name)

Parameters

name string

The name of the property.

Returns

object

The value of the property.

Exceptions

ActionFailedException

Thrown if invoking the action failed.

InvokeMethod(string)

Invokes a method with no arguments on the specified Java object.

public virtual void InvokeMethod(string name)

Parameters

name string

The name of the method.

Exceptions

ActionFailedException

Thrown if invoking the action failed.

InvokeMethod(string, params object[])

Invokes a public method on the remote Java object represented by this Element.

public object InvokeMethod(string methodName, params object[] args)

Parameters

methodName string

The name of method to invoke.

args object[]

A list of method arguments. (Supports string,int,long,bool,null).

Returns

object

The value returned by the method or null if method has "void" return type.

SetPropertyValue(string, object)

Sets the property value of the specified Java object.

public virtual void SetPropertyValue(string name, object value)

Parameters

name string

The name of the property.

value object

The value of the property to set.

Exceptions

ActionFailedException

Thrown if invoking the action failed.

Operators

implicit operator JavaElement(Element)

Implicitly converts an Element to an instance of this class.

public static implicit operator JavaElement(Element element)

Parameters

element Element

The element to convert.

Returns

JavaElement

The JavaElement.

Exceptions

ArgumentNullException

If element is null.

CapabilityNotSupportedException

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

implicit operator JavaElement(string)

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

public static implicit operator JavaElement(string path)

Parameters

path string

The search path.

Returns

JavaElement

The JavaElement.

Remarks

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.