appium.options.android.UiAutomator2Options#

class UiAutomator2Options#
__init__() → None#

Methods

__init__()

as_w3c(capabilities)

Formats given capabilities to a valid W3C session request object

enable_mobile([android_package, ...])

Enables mobile browser use for browsers that support it.

get_capability(name)

Fetches capability value or None if the capability is not set

ignore_local_proxy_environment_variables()

Ignore HTTP_PROXY and HTTPS_PROXY environment variables.

load_capabilities(caps)

Sets multiple capabilities

set_capability(name, value)

Sets a capability.

to_capabilities()

Convert options into capabilities dictionary.

to_w3c()

Formats the instance to a valid W3C session request object

Attributes

W3C_CAPABILITY_NAMES

adb_exec_timeout

Maximum time to wait until single ADB command is executed.

adb_port

Number of the port where ADB is running.

allow_delay_adb

Whether to prevent the emulator to use -delay-adb feature.

allow_test_packages

Whether it is possible to use packages built with the test flag for the automated testing (literally adds -t flag to the adb install command).

android_install_timeout

Maximum amount of time to wait until the application under test is installed.

app

String representing app location.

app_activity

Name of the main app activity.

app_package

App package identifier.

app_wait_activity

Name of the app activity to wait for.

app_wait_duration

Identifier of the app package to wait for.

app_wait_for_launch

Whether to block until the app under test returns the control to the caller after its activity has been started by Activity Manager.

app_wait_package

Identifier of the app package to wait for.

auto_grant_permissions

Whether to grant all the requested application permissions automatically when a test starts.

auto_web_view

Whether the driver should try to automatically switch to a web view context after the session is started.

auto_webview_timeout

Set the maximum timeout to wait until a web view is available if autoWebview capability is set to true.

automation_name

String representing the name of the automation engine name.

avd

Name of Android emulator to run the test on.

avd_args

Emulator command line arguments.

avd_env

Mapping of emulator environment variables.

avd_launch_timeout

Timeout to wait until Android Emulator is started.

avd_ready_timeout

Timeout to wait until Android Emulator is fully booted and is ready for usage.

browser_name

The name of the browser to run the test on.

build_tools_version

Version of Android build tools to use.

capabilities

chrome_logging_prefs

Chrome logging preferences.

chrome_options

Chrome options.

chromedriver_args

Array of chromedriver CLI arguments.

chromedriver_chrome_mapping_file

Full path to the chromedrivers mapping file is located.

chromedriver_disable_build_check

Whether to disable the compatibility validation between the current chromedriver and the destination browser/web view.

chromedriver_executable

Path to the chromedriver executable on the server file system.

chromedriver_executable_dir

Full path to the folder where chromedriver executables are located.

chromedriver_port

Local port number to use for Chromedriver communication.

chromedriver_ports

Local port numbers to use for Chromedriver communication.

chromedriver_use_system_executable

Whether to use the system chromedriver.

clear_device_logs_on_start

Makes the driver to delete all the existing logs in the device buffer before starting a new test.

clear_system_files

Whether the driver should delete generated files at the end of a session.

default_capabilities

Return minimal capabilities necessary as a dictionary.

device_name

The name of the device.

disable_suppress_accessibility_service

Whether to suppress accessibility services.

disable_window_animation

Whether window animations when starting the instrumentation process are disabled.

enable_performance_logging

Whether to enable additional performance logging.

enforce_app_install

Whether the application under test is always reinstalled even if a newer version of it already exists on the device under test.

ensure_webviews_have_pages

Whether to ensure if web views have pages.

event_timings

Whether the driver should to report the timings for various Appium-internal events.

extract_chrome_android_package_from_context_name

Whether to use the android package identifier associated with the context name.

full_reset

Whether the driver should perform a full reset.

gps_enabled

State of the GPS service on emulator.

ignore_hidden_api_policy_error

Whether to ignore a failure while changing hidden API access policies.

intent_action

Intent action to be applied when starting the given appActivity by Activity Manager.

intent_category

Intent category to be applied when starting the given appActivity by Activity Manager.

intent_flags

Intent flags to be applied when starting the given appActivity by Activity Manager.

is_headless

Whether the driver should start emulator/simulator in headless mode.

key_alias

Keystore key alias.

key_password

Keystore key password.

keystore_password

Keystore password.

keystore_path

The path to keystore.

language

Language abbreviation to use in a test session.

locale

Locale abbreviation to use in a test session.

locale_script

Canonical name of the locale to be set for the app under test.

logcat_filter_specs

Logcat filter format.

logcat_format

Log print format.

mjpeg_screenshot_url

URL of a service that provides realtime device screenshots in MJPEG format.

mjpeg_server_port

Number of the port UiAutomator2 server starts the MJPEG server on.

mock_location_app

Identifier of the app, which is used as a system mock location provider.

native_web_screenshot

Whether to use native screenshots in web view context.

network_speed

Desired network speed limit for the emulator.

new_command_timeout

The allowed time before seeing a new server command.

no_reset

Whether the driver should not perform a reset.

no_sign

Whether to skip application signing.

optional_intent_arguments

Intent arguments to be applied when starting the given appActivity by Activity Manager.

orientation

The orientation of the device's screen.

other_apps

Locations of apps to install before running a test.

platform_version

The platform version of an emulator or a real device.

print_page_source_on_find_failure

Whether the driver should print the page source to the log if a find failure occurs.

recreate_chrome_driver_sessions

Whether chromedriver sessions should be killed and then recreated instead of just suspending it on context switch.

remote_adb_host

Address of the host where ADB is running.

remote_apps_cache_limit

Maximum amount of apps that could be cached on the remote device.

show_chromedriver_log

Whether to forward chromedriver output to the Appium server log.

skip_device_initialization

Whether initial device startup checks by the server are disabled.

skip_log_capture

Whether the driver should not record device logs.

skip_logcat_capture

Whether to delete all the existing logs in the device buffer before starting a new test.

skip_server_installation

Whether to skip the server components installation on the device under test and all the related checks.

skip_unlock

Whether to skip the check for lock screen presence.

suppress_kill_server

Prevents the driver from ever killing the ADB server explicitly.

system_port

The number of the port for the internal server to listen on.

udid

The unique identifier of the device under test.

uiautomator2_server_install_timeout

Maximum timeout to wait until UiAutomator2 server is installed on the device.

uiautomator2_server_launch_timeout

Maximum timeout to wait until UiAutomator2 server is listening on the device.

uiautomator2_server_read_timeout

Maximum timeout to wait for an HTTP response from UiAutomator2Server.

uninstall_other_packages

Identifiers of packages to be uninstalled from the device before a test starts.

unlock_key

Unlock key.

unlock_strategy

Unlock strategy name.

unlock_success_timeout

Timeout to wait until the device is unlocked.

unlock_type

Unlock type.

use_keystore

Whether to use custom keystore.

user_profile

Integer identifier of a user profile.

webview_devtools_port

Local port number to use for devtools communication.

browser_version

Gets and Sets the version of the browser.

platform_name

Gets and Sets name of the platform.

accept_insecure_certs

Gets and Set whether the session accepts insecure certificates.

strict_file_interactability

Gets and Sets whether session is about file interactability.

set_window_rect

Gets and Sets window size and position.

enable_bidi

Gets and Set whether the session has WebDriverBiDi enabled.

page_load_strategy

Gets and Sets page load strategy, the default is "normal".

unhandled_prompt_behavior

Gets and Sets unhandled prompt behavior, the default is "dismiss and notify".

timeouts

Gets and Sets implicit timeout, pageLoad timeout and script timeout if set (in milliseconds).

proxy

Sets and Gets Proxy.

enable_downloads

Gets and Sets whether session can download files.

web_socket_url

Gets and Sets WebSocket URL.