Table of Contents

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

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

DropDownVisible

True if the dropdown part of the combobox is currently visible

public virtual bool DropDownVisible { get; set; }

Property Value

bool

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

IList<ListItem>

The list items.

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 null if no item is currently selected.

SelectedItemIndex

The index of the currently selected item.

public virtual int SelectedItemIndex { get; set; }

Property Value

int

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

string

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

string

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

element Element

The element to convert.

Returns

ComboBox

The ComboBox.

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 ComboBox FromPath(string path)

Parameters

path string

The search path.

Returns

ComboBox

The ComboBox.

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.

Operators

implicit operator ComboBox(Element)

Implicitly converts an Element to an instance of this class.

public static implicit operator ComboBox(Element element)

Parameters

element Element

The element to convert.

Returns

ComboBox

The ComboBox.

Exceptions

ArgumentNullException

If element is null.

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

path string

The search path.

Returns

ComboBox

The ComboBox.

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.