# UserSelectorHandle

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

```java
interface UserSelectorHandle extends FormComponentHandle
```

Handle for the "Windows user selector" form component. The principal Swing widget is a
non-editable `JTextField` showing the currently selected Windows users, paired with a
Browse button and an optional Create User button that open native Windows pickers.

**Platform note:** The Browse and Create User pickers are Windows-only. On Linux and
macOS the native picker code returns immediately without making a selection, leaving the
form's selected SIDs unchanged. Tests on non-Windows platforms can verify that the form
component renders, read the displayed account names, and inspect which buttons are present,
but cannot drive an actual user pick.

Reach this handle via [`ScreenHandle.userSelector`](../ui/ScreenHandle.md#userselector).

## Inherited from

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

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getDisplayedText()`](#getdisplayedtext) | `String` | The text currently shown in the read-only text field, typically a semicolon-separated list of account names, or the empty string when nothing has been selected. |
| [`getSelectedSids()`](#getselectedsids) | `String[]` | The SIDs currently selected on this form, or an empty array if nothing has been picked. |
| [`isCreateButtonShown()`](#iscreatebuttonshown) | `boolean` | Whether the Create User button is rendered on this form. |
| [`clickBrowse()`](#clickbrowse) | `UserSelectorHandle` | Click the Browse button. |
| [`clickCreateUser()`](#clickcreateuser) | `UserSelectorHandle` | Click the Create User button. |
| [`assertEnabled()`](#assertenabled) | `UserSelectorHandle` |  |
| [`assertDisabled()`](#assertdisabled) | `UserSelectorHandle` |  |
| [`assertVisible()`](#assertvisible) | `UserSelectorHandle` |  |
| [`assertInvisible()`](#assertinvisible) | `UserSelectorHandle` |  |

### getDisplayedText()

```java
String getDisplayedText()
```

The text currently shown in the read-only text field, typically a semicolon-separated
list of account names, or the empty string when nothing has been selected.

### getSelectedSids()

```java
String[] getSelectedSids()
```

The SIDs currently selected on this form, or an empty array if nothing has been picked.
Returns a defensive copy.

### isCreateButtonShown()

```java
boolean isCreateButtonShown()
```

Whether the Create User button is rendered on this form.

### clickBrowse()

```java
UserSelectorHandle clickBrowse()
```

Click the Browse button. On Windows this opens the `ObjectPicker` native dialog.
On Linux and macOS it returns immediately without picking, so the selection is unchanged.

### clickCreateUser()

```java
UserSelectorHandle clickCreateUser()
```

Click the Create User button. On Windows this opens the `CreateUserDialog`, which
the test reaches via `session.createUserDialog`. Throws
[`ComponentNotFoundException`](../exceptions/ComponentNotFoundException.md) if the form does not render the Create button. On
non-Windows platforms the click is a no-op at the form component level.

### assertEnabled()

```java
UserSelectorHandle assertEnabled()
```

### assertDisabled()

```java
UserSelectorHandle assertDisabled()
```

### assertVisible()

```java
UserSelectorHandle assertVisible()
```

### assertInvisible()

```java
UserSelectorHandle assertInvisible()
```

