# PasswordFieldHandle

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

```java
interface PasswordFieldHandle extends FormComponentHandle
```

Handle for the "Password field" form component. The Swing widget is a `JPasswordField`.

Reach this handle via [`ScreenHandle.passwordField`](../ui/ScreenHandle.md#passwordfield).

## Inherited from

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

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getText()`](#gettext) | `String` | The current password text. |
| [`setText(String)`](#settext-string) | `PasswordFieldHandle` | Set the password text. |
| [`clear()`](#clear) | `PasswordFieldHandle` | Clear the field. |
| [`assertText(String)`](#asserttext-string) | `PasswordFieldHandle` | Assert the current password text equals the expected value. |
| [`assertEnabled()`](#assertenabled) | `PasswordFieldHandle` |  |
| [`assertDisabled()`](#assertdisabled) | `PasswordFieldHandle` |  |
| [`assertVisible()`](#assertvisible) | `PasswordFieldHandle` |  |
| [`assertInvisible()`](#assertinvisible) | `PasswordFieldHandle` |  |

### getText()

```java
String getText()
```

The current password text.

### setText(String)

```java
PasswordFieldHandle setText(String text)
```

Set the password text.

### clear()

```java
PasswordFieldHandle clear()
```

Clear the field.

### assertText(String)

```java
PasswordFieldHandle assertText(String expected)
```

Assert the current password text equals the expected value.

### assertEnabled()

```java
PasswordFieldHandle assertEnabled()
```

### assertDisabled()

```java
PasswordFieldHandle assertDisabled()
```

### assertVisible()

```java
PasswordFieldHandle assertVisible()
```

### assertInvisible()

```java
PasswordFieldHandle assertInvisible()
```

