Class CheckBox
- Namespace
- Ranorex
- Assembly
- Ranorex.Core.dll
Represents a check box that allows the user to select a true or false condition.
public class CheckBox : Adapter, IAdapter
- Inheritance
-
CheckBox
- Implements
- Inherited Members
Constructors
CheckBox()
Creates a new CheckBox adapter instance. This constructor is used internally by the Ranorex Core Framework for performance issues!
protected CheckBox()
CheckBox(Element)
Creates a new CheckBox adapter instance.
public CheckBox(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
CheckState
The state of the checkbox.
public virtual CheckState CheckState { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
Checked
True if the checkbox is checked or indeterminate.
public virtual bool Checked { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
RequiredCapabilities
Capabilities required by the adapter implementation.
protected override string[] RequiredCapabilities { get; }
Property Value
- string[]
Text
The text associated with the checkbox.
public virtual string Text { get; }
Property Value
Methods
Check()
Set the checkbox state to true.
public virtual void Check()
Exceptions
- ActionFailedException
Thrown if invoking the action failed.
FromElement(Element)
Converts an Element to an instance of this class.
public static CheckBox FromElement(Element element)
Parameters
elementElementThe element to convert.
Returns
- CheckBox
The CheckBox.
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 CheckBox FromPath(string path)
Parameters
pathstringThe search path.
Returns
- CheckBox
The CheckBox.
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.
Uncheck()
Set the checkbox state to false.
public virtual void Uncheck()
Exceptions
- ActionFailedException
Thrown if invoking the action failed.
Operators
implicit operator CheckBox(Element)
Implicitly converts an Element to an instance of this class.
public static implicit operator CheckBox(Element element)
Parameters
elementElementThe element to convert.
Returns
- CheckBox
The CheckBox.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
implicit operator CheckBox(string)
Implicitly converts a string to an instance of this class by searching the root.
public static implicit operator CheckBox(string path)
Parameters
pathstringThe search path.
Returns
- CheckBox
The CheckBox.
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.