Skip to main content

Driver classes

The SDK provides drop-in replacements for Appium driver classes:
MobileBoost classExtendsPlatform
GptDriverAndroidAndroidDriverAndroid
GptDriverIOSIOSDriveriOS
GptDriverAppiumAppiumDriverCross-platform

Constructor options

ParameterTypeDescription
urlURLAppium server URL
optionsCapabilitiesAppium capabilities (must include gptdriver:apiKey)
additionalUserContextStringOptional context to guide AI behavior across all steps
enableSelfHealingBooleanEnable/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.
// 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);

AI commands

aiExecute

Execute a natural language instruction on the current screen.
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.
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.
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.
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.
Map<String, String> data = driver.aiExtract(
    "username",
    "email address",
    "account balance"
);

Caching

The SDK supports caching to reduce AI calls for repetitive executions:
ModeDescription
NONENo caching
FULL_SCREENCache hit only if the full screen matches a previous successful execution
INTERACTION_REGIONCache hit if the interaction region matches (e.g., the area around a tapped element)
Set caching globally in the constructor or override per step.