Skip to main content

GptDriver

Constructor

GptDriver(
    apiKey: String,
    deviceName: String,
    platformVersion: String,
    additionalUserContext: String = "",
    cachingMode: String = "NONE",
    testId: String = "",
    composeTestRule: ComposeTestRule? = null
)
ParameterTypeDescription
apiKeyStringYour MobileBoost API key
deviceNameStringDevice name for logging
platformVersionStringAndroid version
additionalUserContextStringContext to guide AI behavior across all steps
cachingModeString"NONE", "FULL_SCREEN", or "INTERACTION_REGION"
testIdStringIdentifier for the test (used for caching and logging)
composeTestRuleComposeTestRule?Required for Jetpack Compose apps

AI commands

execute

Execute a natural language instruction on the current screen.
sdkInstance.execute("Tap on the home button and verify it leads to the main screen")

assert

Verify a condition without taking action. Throws on failure.
sdkInstance.assert("The shopping cart shows 3 items")

extract

Extract information from the current screen.
val data = sdkInstance.extract("product name", "price", "quantity")