GptDriver class. Import the default export and construct it with your WebdriverIO browser:
Constructor options
| Option | Type | Description |
|---|---|---|
apiKey | string | Required. Your GPT Driver API key. |
driver | WebDriver | Browser | An existing WebdriverIO / Appium session. The SDK runs on this session. |
serverConfig.url | URL | string | The Appium server URL. Required whenever you pass a driver. |
serverConfig.device | object | { platform, deviceName, platformVersion }. Required only when you do not pass a driver and want the SDK to start its own session. |
cachingMode | CachingMode | Default caching for AI steps. One of "NONE", "FULL_SCREEN", "INTERACTION_REGION". Defaults to "NONE". |
testId | string | A label for this run, shown on the dashboard. |
appId | string | App identifier (appPackage on Android / bundleId on iOS). Auto-read from the session capabilities when omitted; set it to override. |
additionalUserContext | string | Free-text guidance passed to the AI on every AI step. |
maxWaitForStableScreenSecs | number | How long to wait for the screen to settle before an AI step. |
organisationId | string | Organisation identifier used for cache scoping. |
AI commands
aiExecute
Execute a natural-language instruction on the current screen. Optionally pass anappiumHandler to run native Appium code first and only fall back to AI if it throws (see Deterministic execution).
assert
Verify a condition without taking any action. Resolves if the condition holds, throws otherwise.assertBulk
Check multiple conditions in one call. Throws if any condition fails.checkBulk
Check multiple conditions in one call. Returns an object with atrue / false result per condition instead of throwing.
extract
Extract information from the current screen. Returns an object keyed by the values you asked for.openDeepLinkUrl
Open a deep link in the app under test.Session lifecycle
The session starts automatically on the first AI command. Report the outcome at the end of a test so it is recorded on the dashboard.Caching
Caching reduces AI calls for repetitive executions. Set a default in the constructor, or override per call.| Mode | Description |
|---|---|
NONE | No caching (default). |
FULL_SCREEN | Cache hit only if the full screen matches a previous successful execution. |
INTERACTION_REGION | Cache hit if the interaction region matches (for example, the area around a tapped element). Recommended. |

