# ComboBoxHandle

Import: `import com.install4j.api.test.formcomponents.ComboBoxHandle;`

```java
interface ComboBoxHandle extends FormComponentHandle
```

Handle for the "Combo box" form component. The Swing widget is a `JComboBox`.

Reach this handle via [`ScreenHandle.comboBox`](../ui/ScreenHandle.md#combobox).

## Inherited from

- [FormComponentHandle](FormComponentHandle.md) — 7 methods

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getItems()`](#getitems) | `List<String>` | The items currently in the drop-down. |
| [`getSelectedItem()`](#getselecteditem) | `String` | The currently selected or typed value. |
| [`selectItem(String)`](#selectitem-string) | `ComboBoxHandle` | Select the first item whose `toString` equals the given value. |
| [`selectIndex(int)`](#selectindex-int) | `ComboBoxHandle` | Select the item at the given index. |
| [`enterText(String)`](#entertext-string) | `ComboBoxHandle` | Type free text into the editor. |
| [`assertSelectedItem(String)`](#assertselecteditem-string) | `ComboBoxHandle` | Assert that the currently selected item equals the expected value. |
| [`assertEnabled()`](#assertenabled) | `ComboBoxHandle` |  |
| [`assertDisabled()`](#assertdisabled) | `ComboBoxHandle` |  |
| [`assertVisible()`](#assertvisible) | `ComboBoxHandle` |  |
| [`assertInvisible()`](#assertinvisible) | `ComboBoxHandle` |  |

### getItems()

```java
List<String> getItems()
```

The items currently in the drop-down.

### getSelectedItem()

```java
String getSelectedItem()
```

The currently selected or typed value. For editable combos this returns the edit-field text.

### selectItem(String)

```java
ComboBoxHandle selectItem(String item)
```

Select the first item whose `toString` equals the given value.

### selectIndex(int)

```java
ComboBoxHandle selectIndex(int index)
```

Select the item at the given index.

### enterText(String)

```java
ComboBoxHandle enterText(String text)
```

Type free text into the editor. Requires an editable combo.

### assertSelectedItem(String)

```java
ComboBoxHandle assertSelectedItem(String expected)
```

Assert that the currently selected item equals the expected value.

### assertEnabled()

```java
ComboBoxHandle assertEnabled()
```

### assertDisabled()

```java
ComboBoxHandle assertDisabled()
```

### assertVisible()

```java
ComboBoxHandle assertVisible()
```

### assertInvisible()

```java
ComboBoxHandle assertInvisible()
```

