Skip to main content

Settings DSL

Appium settings let you adjust driver behavior at runtime — unlike capabilities, they can be changed multiple times during a test.

In the test body

Use settings { } directly inside the test block to apply settings before any screen interaction:

androidTest(app = MyAndroidApp) {
settings {
ignoreUnimportantViews = true
}
on(::ProductsScreen) {
// ...
}
}

In a screen chain

settings { } is also available on ScreenScope, returning the same scope for fluent chaining:

on(::ProductsScreen) {
// ...
}.settings {
ignoreUnimportantViews = true
}.on(::ProductDetailsScreen) {
// ...
}

At server startup (via capabilities)

Settings can also be forwarded to the Appium server at startup as the appium:settings capability, using the settings { } block inside capabilities { }:

object MyAndroidApp : AndroidApp(
appPackage = "com.example.app",
appActivity = ".MainActivity",
service = appiumService {
port = 4723
capabilities {
settings {
ignoreUnimportantViews = true
}
}
},
)

Note: Settings applied via capabilities { settings { } } influence server-side behavior at startup and are not the same as the runtime settings { } DSL available in the test body or screen chain.

Available settings

All settings map directly to the UiAutomator2 driver settings. Only set what you need — unset properties are omitted from the request.

PropertyTypeDefaultDescription
actionAcknowledgmentTimeoutLong3000 msWait for acknowledgment of UiAutomator actions (click, setText, etc.)
allowInvisibleElementsBooleanfalseInclude invisible elements in the XML source tree
ignoreUnimportantViewsBooleanfalseEnable layout hierarchy compression
elementResponseAttributesStringComma-separated attribute names to include in findElement response
enableMultiWindowsBooleanfalseInclude all interactive windows in the page source
enableTopmostWindowFromActivePackageBooleanfalseLimit interactions to the topmost window of the active package
enableNotificationListenerBooleantrueListen for new toast notifications
keyInjectionDelayLong0 msDelay between key presses during text injection
scrollAcknowledgmentTimeoutLong200 msWait for acknowledgment of scroll swipe actions
shouldUseCompactResponsesBooleantrueUsed with elementResponseAttributes
waitForIdleTimeoutLong10000 msWait for the UI to become idle
waitForSelectorTimeoutLong10000 msWait for a widget to become visible (UIAutomator strategy only)
normalizeTagNamesBooleanfalseNormalize element class names in page source XML tag names
shutdownOnPowerDisconnectBooleantrueShut down the server if the device is disconnected from power
simpleBoundsCalculationBooleanfalseUse absolute element bounds without occlusion checking
trackScrollEventsBooleantrueApply scroll event tracking
wakeLockTimeoutLong24 hUiAutomator2 server wake lock timeout
serverPortInt6790Port for the UiAutomator2 server on the device
mjpegServerPortInt7810Port for the MJPEG screenshot broadcaster
mjpegServerFramerateInt10Max screenshots per second for MJPEG broadcaster
mjpegScalingFactorInt50Downscaling percentage for MJPEG screenshots
mjpegServerScreenshotQualityInt50JPEG compression quality for MJPEG screenshots
mjpegBilinearFilteringBooleanfalseUse bilinear filtering for MJPEG resize
useResourcesForOrientationDetectionBooleanfalseStrategy for detecting device orientation
enforceXPath1BooleanfalseUse XPath 1 instead of XPath 2
limitXPathContextScopeBooleantrueLimit context-based XPath searches to the parent element
disableIdLocatorAutocompletionBooleanfalseDisable resource ID locator autocompletion
alwaysTraversableViewClassesStringClasses to traverse even when invisible
includeExtrasInPageSourceBooleanInclude extras attribute in XML page source
includeA11yActionsInPageSourceBooleanInclude actions attribute in XML page source
snapshotMaxDepthInt70Maximum depth for the source tree snapshot
currentDisplayIdInt0Display ID for element finding and screenshots