# FormFileChooserHandle

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

```java
interface FormFileChooserHandle extends FormComponentHandle
```

Handle for the "File chooser" form component. The principal Swing widget is the
`JTextField` holding the path, paired with a Browse button that opens a
`JFileChooser` dialog.

Not to be confused with `com.install4j.api.test.ui.FileChooserHandle`, which
wraps the modal `JFileChooser` dialog shown by the Browse button.

Reach this handle via [`ScreenHandle.formFileChooser`](../ui/ScreenHandle.md#formfilechooser).

## Inherited from

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

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getFile()`](#getfile) | `File` | The currently selected file. |
| [`setFile(File)`](#setfile-file) | `FormFileChooserHandle` | Set the selected file. |
| [`browse()`](#browse) | `FormFileChooserHandle` | Click the Browse button. |
| [`assertFile(File)`](#assertfile-file) | `FormFileChooserHandle` | Assert the currently selected file equals the expected value. |
| [`assertEnabled()`](#assertenabled) | `FormFileChooserHandle` |  |
| [`assertDisabled()`](#assertdisabled) | `FormFileChooserHandle` |  |
| [`assertVisible()`](#assertvisible) | `FormFileChooserHandle` |  |
| [`assertInvisible()`](#assertinvisible) | `FormFileChooserHandle` |  |

### getFile()

```java
File getFile()
```

The currently selected file.

### setFile(File)

```java
FormFileChooserHandle setFile(File file)
```

Set the selected file.

### browse()

```java
FormFileChooserHandle browse()
```

Click the Browse button. The resulting `JFileChooser` dialog can be reached via
`session.fileChooser`.

### assertFile(File)

```java
FormFileChooserHandle assertFile(File expected)
```

Assert the currently selected file equals the expected value.

### assertEnabled()

```java
FormFileChooserHandle assertEnabled()
```

### assertDisabled()

```java
FormFileChooserHandle assertDisabled()
```

### assertVisible()

```java
FormFileChooserHandle assertVisible()
```

### assertInvisible()

```java
FormFileChooserHandle assertInvisible()
```

