Class ComboBox
- Namespace
- Ranorex
- Assembly
- Ranorex.Core.dll
Represents a combo box control.
public class ComboBox : Adapter, IAdapter
- Inheritance
-
ComboBox
- Implements
- Inherited Members
Constructors
ComboBox()
Creates a new ComboBox adapter instance. This constructor is used internally by the Ranorex Core Framework for performance issues!
protected ComboBox()
ComboBox(Element)
Creates a new ComboBox adapter instance.
public ComboBox(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
DropDownVisible
True if the dropdown part of the combobox is currently visible
public virtual bool DropDownVisible { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
Items
Gets the list items contained in the combobox list.
public IList<ListItem> Items { get; }
Property Value
RequiredCapabilities
Capabilities required by the adapter implementation.
protected override string[] RequiredCapabilities { get; }
Property Value
- string[]
SelectedItem
Gets the currently selected list item.
public ListItem SelectedItem { get; }
Property Value
- ListItem
The currently selected list item or
nullif no item is currently selected.
SelectedItemIndex
The index of the currently selected item.
public virtual int SelectedItemIndex { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
SelectedItemText
The text of the currently selected item.
public virtual string SelectedItemText { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
Text
The text contained in the textbox part of the combobox.
public virtual string Text { get; set; }
Property Value
Exceptions
- SetAttributeFailedException
Thrown if setting the attribute value failed.
Methods
FromElement(Element)
Converts an Element to an instance of this class.
public static ComboBox FromElement(Element element)
Parameters
elementElementThe element to convert.
Returns
- ComboBox
The ComboBox.
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 ComboBox FromPath(string path)
Parameters
pathstringThe search path.
Returns
- ComboBox
The ComboBox.
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.
Operators
implicit operator ComboBox(Element)
Implicitly converts an Element to an instance of this class.
public static implicit operator ComboBox(Element element)
Parameters
elementElementThe element to convert.
Returns
- ComboBox
The ComboBox.
Exceptions
- ArgumentNullException
If
elementisnull.- CapabilityNotSupportedException
If the element does not support the capabilities required by this adapter.
implicit operator ComboBox(string)
Implicitly converts a string to an instance of this class by searching the root.
public static implicit operator ComboBox(string path)
Parameters
pathstringThe search path.
Returns
- ComboBox
The ComboBox.
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.