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
elementElementThe element to create the adapter for.
Exceptions
- NullReferenceException
If
elementisnull.- 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
AccessibleName
The accessibility name of the Java component.
public virtual string AccessibleName { get; }
Property Value
BaseType
The full type name of the base Java component in the JRE.
public virtual string BaseType { get; }
Property Value
FullType
The full type name of the Java component.
public virtual string FullType { get; }
Property Value
Name
The name of the Java component.
public virtual string Name { get; }
Property Value
RanorexLibVersion
The version of the Ranorex Java automation library.
public virtual string RanorexLibVersion { get; }
Property Value
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
Type
The class name of the Java component.
public virtual string Type { get; }
Property Value
Methods
FromElement(Element)
Converts an Element to an instance of this class.
public static JavaElement FromElement(Element element)
Parameters
elementElementThe element to convert.
Returns
- JavaElement
The JavaElement.
Exceptions
- ArgumentNullException
If
elementisnull.- 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
pathstringThe search path.
Returns
- JavaElement
The JavaElement.
Remarks
The DefaultSearchTimeout is used to search for the specified path.
Exceptions
- ArgumentNullException
If
pathisnull.- RxPathException
If the specified
pathis 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
namestringThe 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
namestringThe 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
methodNamestringThe name of method to invoke.
argsobject[]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
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
elementElementThe element to convert.
Returns
- JavaElement
The JavaElement.
Exceptions
- ArgumentNullException
If
elementisnull.- 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
pathstringThe search path.
Returns
- JavaElement
The JavaElement.
Remarks
The DefaultSearchTimeout is used to search for the specified path.
Exceptions
- ArgumentNullException
If
pathisnull.- RxPathException
If the specified
pathis not valid.- ElementNotFoundException
If no element is found.
- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.