> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobileboost.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Reference

> API reference for the MobileBoost Java Appium SDK

## Driver classes

The SDK provides drop-in replacements for Appium driver classes:

| MobileBoost class  | Extends         | Platform       |
| ------------------ | --------------- | -------------- |
| `GptDriverAndroid` | `AndroidDriver` | Android        |
| `GptDriverIOS`     | `IOSDriver`     | iOS            |
| `GptDriverAppium`  | `AppiumDriver`  | Cross-platform |

## Constructor options

| Parameter               | Type         | Description                                            |
| ----------------------- | ------------ | ------------------------------------------------------ |
| `url`                   | URL          | Appium server URL                                      |
| `options`               | Capabilities | Appium capabilities (must include `gptdriver:apiKey`)  |
| `additionalUserContext` | String       | Optional context to guide AI behavior across all steps |
| `enableSelfHealing`     | Boolean      | Enable/disable self healing globally (default: `true`) |

## Self healing

By default, all `findElement` and `findElements` calls are wrapped with self-healing. When a `NoSuchElement` exception is thrown, the SDK attempts to resolve it automatically.

```java theme={null}
// Self healing enabled (default)
WebElement el = driver.findElement(By.id("login-button"));

// Self healing disabled for this call
WebElement el = driver.findElement(By.id("successMessage"), false);
```

See [self healing](/engineer-tooling/self-healing) for details.

## AI commands

### aiExecute

Execute a natural language instruction on the current screen.

```java theme={null}
driver.aiExecute("Tap the login button and wait for the home screen");
```

### aiAssert

Verify a condition without taking any action. Throws an error if the assertion fails.

```java theme={null}
driver.aiAssert("The home screen is displayed with a welcome message");
```

### aiAssertBulk

Check multiple conditions in one call. Throws an error if any assertion fails.

```java theme={null}
driver.aiAssertBulk(
    "The username is displayed",
    "The profile picture is visible",
    "The settings icon is in the top right"
);
```

### aiCheckBulk

Check multiple conditions in one call. Returns an object with `true`/`false` for each condition instead of throwing.

```java theme={null}
Map<String, Boolean> results = driver.aiCheckBulk(
    "The username is displayed",
    "The notification badge is visible"
);
```

### aiExtract

Extract information from the current screen. Returns an object with the extracted values.

```java theme={null}
Map<String, String> data = driver.aiExtract(
    "username",
    "email address",
    "account balance"
);
```

## Caching

The SDK supports caching to reduce AI calls for repetitive executions:

| Mode                 | Description                                                                          |
| -------------------- | ------------------------------------------------------------------------------------ |
| `NONE`               | No caching                                                                           |
| `FULL_SCREEN`        | Cache hit only if the full screen matches a previous successful execution            |
| `INTERACTION_REGION` | Cache hit if the interaction region matches (e.g., the area around a tapped element) |

Set caching globally in the constructor or override per step.
