Appium-Python-Client 5.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- appium/__init__.py +17 -0
- appium/common/__init__.py +17 -0
- appium/common/exceptions.py +26 -0
- appium/common/helper.py +42 -0
- appium/common/logger.py +28 -0
- appium/options/__init__.py +0 -0
- appium/options/android/__init__.py +2 -0
- appium/options/android/common/__init__.py +0 -0
- appium/options/android/common/adb/__init__.py +0 -0
- appium/options/android/common/adb/adb_exec_timeout_option.py +41 -0
- appium/options/android/common/adb/adb_port_option.py +38 -0
- appium/options/android/common/adb/allow_delay_adb_option.py +39 -0
- appium/options/android/common/adb/build_tools_version_option.py +42 -0
- appium/options/android/common/adb/clear_device_logs_on_start_option.py +40 -0
- appium/options/android/common/adb/ignore_hidden_api_policy_error_option.py +40 -0
- appium/options/android/common/adb/logcat_filter_specs_option.py +42 -0
- appium/options/android/common/adb/logcat_format_option.py +39 -0
- appium/options/android/common/adb/mock_location_app_option.py +42 -0
- appium/options/android/common/adb/remote_adb_host_option.py +39 -0
- appium/options/android/common/adb/skip_logcat_capture_option.py +40 -0
- appium/options/android/common/adb/suppress_kill_server_option.py +39 -0
- appium/options/android/common/app/__init__.py +0 -0
- appium/options/android/common/app/allow_test_packages_option.py +40 -0
- appium/options/android/common/app/android_install_timeout_option.py +43 -0
- appium/options/android/common/app/app_activity_option.py +39 -0
- appium/options/android/common/app/app_package_option.py +39 -0
- appium/options/android/common/app/app_wait_activity_option.py +40 -0
- appium/options/android/common/app/app_wait_duration_option.py +41 -0
- appium/options/android/common/app/app_wait_for_launch_option.py +41 -0
- appium/options/android/common/app/app_wait_package_option.py +40 -0
- appium/options/android/common/app/auto_grant_premissions_option.py +40 -0
- appium/options/android/common/app/enforce_app_install_option.py +40 -0
- appium/options/android/common/app/intent_action_option.py +40 -0
- appium/options/android/common/app/intent_category_option.py +40 -0
- appium/options/android/common/app/intent_flags_option.py +40 -0
- appium/options/android/common/app/optional_intent_arguments_option.py +40 -0
- appium/options/android/common/app/remote_apps_cache_limit_option.py +42 -0
- appium/options/android/common/app/uninstall_other_packages_option.py +39 -0
- appium/options/android/common/avd/__init__.py +0 -0
- appium/options/android/common/avd/avd_args_option.py +38 -0
- appium/options/android/common/avd/avd_env_option.py +38 -0
- appium/options/android/common/avd/avd_launch_timeout_option.py +41 -0
- appium/options/android/common/avd/avd_option.py +41 -0
- appium/options/android/common/avd/avd_ready_timeout_option.py +41 -0
- appium/options/android/common/avd/gps_enabled_option.py +39 -0
- appium/options/android/common/avd/network_speed_option.py +41 -0
- appium/options/android/common/context/__init__.py +0 -0
- appium/options/android/common/context/auto_webview_timeout_option.py +41 -0
- appium/options/android/common/context/chrome_logging_prefs_option.py +41 -0
- appium/options/android/common/context/chrome_options_option.py +40 -0
- appium/options/android/common/context/chromedriver_args_option.py +41 -0
- appium/options/android/common/context/chromedriver_chrome_mapping_file_option.py +43 -0
- appium/options/android/common/context/chromedriver_disable_build_check_option.py +41 -0
- appium/options/android/common/context/chromedriver_executable_dir_option.py +43 -0
- appium/options/android/common/context/chromedriver_executable_option.py +38 -0
- appium/options/android/common/context/chromedriver_port_option.py +39 -0
- appium/options/android/common/context/chromedriver_ports_option.py +39 -0
- appium/options/android/common/context/chromedriver_use_system_executable_option.py +40 -0
- appium/options/android/common/context/ensure_webviews_have_pages_option.py +40 -0
- appium/options/android/common/context/extract_chrome_android_package_from_context_name_option.py +40 -0
- appium/options/android/common/context/native_web_screenshot_option.py +40 -0
- appium/options/android/common/context/recreate_chrome_driver_sessions_option.py +41 -0
- appium/options/android/common/context/show_chromedriver_log_option.py +39 -0
- appium/options/android/common/context/webview_devtools_port_option.py +40 -0
- appium/options/android/common/localization/__init__.py +0 -0
- appium/options/android/common/localization/locale_script_option.py +40 -0
- appium/options/android/common/locking/__init__.py +0 -0
- appium/options/android/common/locking/skip_unlock_option.py +42 -0
- appium/options/android/common/locking/unlock_key_option.py +40 -0
- appium/options/android/common/locking/unlock_strategy_option.py +40 -0
- appium/options/android/common/locking/unlock_success_timeout_option.py +43 -0
- appium/options/android/common/locking/unlock_type_option.py +40 -0
- appium/options/android/common/mjpeg/__init__.py +0 -0
- appium/options/android/common/mjpeg/mjpeg_screenshot_url_option.py +40 -0
- appium/options/android/common/other/__init__.py +0 -0
- appium/options/android/common/other/disable_suppress_accessibility_service_option.py +40 -0
- appium/options/android/common/other/user_profile_option.py +42 -0
- appium/options/android/common/signing/__init__.py +0 -0
- appium/options/android/common/signing/key_alias_option.py +40 -0
- appium/options/android/common/signing/key_password_option.py +40 -0
- appium/options/android/common/signing/keystore_password_option.py +40 -0
- appium/options/android/common/signing/keystore_path_option.py +40 -0
- appium/options/android/common/signing/no_sign_option.py +42 -0
- appium/options/android/common/signing/use_keystore_option.py +42 -0
- appium/options/android/espresso/__init__.py +0 -0
- appium/options/android/espresso/activity_options_option.py +41 -0
- appium/options/android/espresso/app_locale_option.py +44 -0
- appium/options/android/espresso/base.py +221 -0
- appium/options/android/espresso/espresso_build_config_option.py +46 -0
- appium/options/android/espresso/espresso_server_launch_timeout_option.py +43 -0
- appium/options/android/espresso/force_espresso_rebuild_option.py +41 -0
- appium/options/android/espresso/intent_options_option.py +41 -0
- appium/options/android/espresso/show_gradle_log_option.py +39 -0
- appium/options/android/uiautomator2/__init__.py +0 -0
- appium/options/android/uiautomator2/base.py +221 -0
- appium/options/android/uiautomator2/disable_window_animation_option.py +40 -0
- appium/options/android/uiautomator2/mjpeg_server_port_option.py +41 -0
- appium/options/android/uiautomator2/skip_device_initialization_option.py +40 -0
- appium/options/android/uiautomator2/skip_server_installation_option.py +44 -0
- appium/options/android/uiautomator2/uiautomator2_server_install_timeout_option.py +44 -0
- appium/options/android/uiautomator2/uiautomator2_server_launch_timeout_option.py +44 -0
- appium/options/android/uiautomator2/uiautomator2_server_read_timeout_option.py +46 -0
- appium/options/common/__init__.py +1 -0
- appium/options/common/app_option.py +41 -0
- appium/options/common/auto_web_view_option.py +40 -0
- appium/options/common/automation_name_option.py +38 -0
- appium/options/common/base.py +125 -0
- appium/options/common/browser_name_option.py +38 -0
- appium/options/common/bundle_id_option.py +38 -0
- appium/options/common/clear_system_files_option.py +38 -0
- appium/options/common/device_name_option.py +38 -0
- appium/options/common/enable_performance_logging_option.py +38 -0
- appium/options/common/event_timings_option.py +40 -0
- appium/options/common/full_reset_option.py +38 -0
- appium/options/common/is_headless_option.py +39 -0
- appium/options/common/language_option.py +38 -0
- appium/options/common/locale_option.py +38 -0
- appium/options/common/new_command_timeout_option.py +41 -0
- appium/options/common/no_reset_option.py +38 -0
- appium/options/common/orientation_option.py +40 -0
- appium/options/common/other_apps_option.py +39 -0
- appium/options/common/platform_version_option.py +40 -0
- appium/options/common/postrun_option.py +39 -0
- appium/options/common/prerun_option.py +40 -0
- appium/options/common/print_page_source_on_find_failure_option.py +40 -0
- appium/options/common/skip_log_capture_option.py +38 -0
- appium/options/common/supports_capabilities.py +26 -0
- appium/options/common/system_host_option.py +38 -0
- appium/options/common/system_port_option.py +38 -0
- appium/options/common/udid_option.py +38 -0
- appium/options/flutter_integration/__init__.py +15 -0
- appium/options/flutter_integration/base.py +39 -0
- appium/options/flutter_integration/flutter_element_wait_timeout_option.py +50 -0
- appium/options/flutter_integration/flutter_enable_mock_camera_option.py +44 -0
- appium/options/flutter_integration/flutter_server_launch_timeout_option.py +51 -0
- appium/options/flutter_integration/flutter_system_port_option.py +45 -0
- appium/options/gecko/__init__.py +1 -0
- appium/options/gecko/android_storage_option.py +39 -0
- appium/options/gecko/base.py +51 -0
- appium/options/gecko/firefox_options_option.py +38 -0
- appium/options/gecko/marionette_port_option.py +43 -0
- appium/options/gecko/verbosity_option.py +40 -0
- appium/options/ios/__init__.py +2 -0
- appium/options/ios/safari/__init__.py +0 -0
- appium/options/ios/safari/automatic_inspection_option.py +41 -0
- appium/options/ios/safari/automatic_profiling_option.py +41 -0
- appium/options/ios/safari/base.py +51 -0
- appium/options/ios/safari/device_name_option.py +43 -0
- appium/options/ios/safari/device_type_option.py +41 -0
- appium/options/ios/safari/device_udid_option.py +43 -0
- appium/options/ios/safari/platform_build_version_option.py +41 -0
- appium/options/ios/safari/platform_version_option.py +41 -0
- appium/options/ios/safari/use_simulator_option.py +41 -0
- appium/options/ios/safari/webkit_webrtc_option.py +52 -0
- appium/options/ios/xcuitest/__init__.py +0 -0
- appium/options/ios/xcuitest/app/__init__.py +0 -0
- appium/options/ios/xcuitest/app/app_install_strategy_option.py +46 -0
- appium/options/ios/xcuitest/app/app_push_timeout_option.py +42 -0
- appium/options/ios/xcuitest/app/localizable_strings_dir_option.py +39 -0
- appium/options/ios/xcuitest/base.py +223 -0
- appium/options/ios/xcuitest/general/__init__.py +0 -0
- appium/options/ios/xcuitest/general/include_device_caps_to_session_info_option.py +41 -0
- appium/options/ios/xcuitest/general/reset_location_service_option.py +39 -0
- appium/options/ios/xcuitest/other/__init__.py +0 -0
- appium/options/ios/xcuitest/other/command_timeouts_option.py +57 -0
- appium/options/ios/xcuitest/other/launch_with_idb_option.py +42 -0
- appium/options/ios/xcuitest/other/show_ios_log_option.py +39 -0
- appium/options/ios/xcuitest/other/use_json_source_option.py +39 -0
- appium/options/ios/xcuitest/simulator/__init__.py +0 -0
- appium/options/ios/xcuitest/simulator/calendar_access_authorized_option.py +41 -0
- appium/options/ios/xcuitest/simulator/calendar_format_option.py +38 -0
- appium/options/ios/xcuitest/simulator/connect_hardware_keyboard_option.py +43 -0
- appium/options/ios/xcuitest/simulator/custom_ssl_cert_option.py +39 -0
- appium/options/ios/xcuitest/simulator/enforce_fresh_simulator_creation_option.py +39 -0
- appium/options/ios/xcuitest/simulator/force_simulator_software_keyboard_presence_option.py +45 -0
- appium/options/ios/xcuitest/simulator/ios_simulator_logs_predicate_option.py +38 -0
- appium/options/ios/xcuitest/simulator/keep_key_chains_option.py +39 -0
- appium/options/ios/xcuitest/simulator/keychains_exclude_patterns_option.py +44 -0
- appium/options/ios/xcuitest/simulator/permissions_option.py +50 -0
- appium/options/ios/xcuitest/simulator/reduce_motion_option.py +40 -0
- appium/options/ios/xcuitest/simulator/reset_on_session_start_only_option.py +41 -0
- appium/options/ios/xcuitest/simulator/scale_factor_option.py +44 -0
- appium/options/ios/xcuitest/simulator/shutdown_other_simulators_option.py +44 -0
- appium/options/ios/xcuitest/simulator/simulator_devices_set_path_option.py +41 -0
- appium/options/ios/xcuitest/simulator/simulator_pasteboard_automatic_sync_option.py +42 -0
- appium/options/ios/xcuitest/simulator/simulator_startup_timeout_option.py +46 -0
- appium/options/ios/xcuitest/simulator/simulator_trace_pointer_option.py +41 -0
- appium/options/ios/xcuitest/simulator/simulator_window_center_option.py +41 -0
- appium/options/ios/xcuitest/wda/__init__.py +0 -0
- appium/options/ios/xcuitest/wda/allow_provisioning_device_regitration_option.py +40 -0
- appium/options/ios/xcuitest/wda/auto_accept_alerts_option.py +39 -0
- appium/options/ios/xcuitest/wda/auto_disimiss_alerts_option.py +39 -0
- appium/options/ios/xcuitest/wda/derived_data_path_option.py +41 -0
- appium/options/ios/xcuitest/wda/disable_automatic_screenshots_option.py +40 -0
- appium/options/ios/xcuitest/wda/force_app_launch_option.py +42 -0
- appium/options/ios/xcuitest/wda/keychain_password_option.py +39 -0
- appium/options/ios/xcuitest/wda/keychain_path_option.py +39 -0
- appium/options/ios/xcuitest/wda/max_typing_frequency_option.py +40 -0
- appium/options/ios/xcuitest/wda/mjpeg_server_port_option.py +42 -0
- appium/options/ios/xcuitest/wda/process_arguments_option.py +42 -0
- appium/options/ios/xcuitest/wda/result_bundle_path_option.py +42 -0
- appium/options/ios/xcuitest/wda/screenshot_quality_option.py +42 -0
- appium/options/ios/xcuitest/wda/should_terminate_app_option.py +42 -0
- appium/options/ios/xcuitest/wda/should_use_singleton_test_manager_option.py +39 -0
- appium/options/ios/xcuitest/wda/show_xcode_log_option.py +40 -0
- appium/options/ios/xcuitest/wda/simple_is_visible_check_option.py +42 -0
- appium/options/ios/xcuitest/wda/updated_wda_bundle_id_option.py +39 -0
- appium/options/ios/xcuitest/wda/use_native_caching_strategy_option.py +41 -0
- appium/options/ios/xcuitest/wda/use_new_wda_option.py +51 -0
- appium/options/ios/xcuitest/wda/use_prebuilt_wda_option.py +39 -0
- appium/options/ios/xcuitest/wda/use_simple_build_test_option.py +40 -0
- appium/options/ios/xcuitest/wda/use_xctestrun_file_option.py +49 -0
- appium/options/ios/xcuitest/wda/wait_for_idle_timeout_option.py +45 -0
- appium/options/ios/xcuitest/wda/wait_for_quiescence_option.py +42 -0
- appium/options/ios/xcuitest/wda/wda_base_url_option.py +41 -0
- appium/options/ios/xcuitest/wda/wda_connection_timeout_option.py +43 -0
- appium/options/ios/xcuitest/wda/wda_eventloop_idle_delay_option.py +46 -0
- appium/options/ios/xcuitest/wda/wda_launch_timeout_option.py +41 -0
- appium/options/ios/xcuitest/wda/wda_local_port_option.py +41 -0
- appium/options/ios/xcuitest/wda/wda_startup_retries_option.py +39 -0
- appium/options/ios/xcuitest/wda/wda_startup_retry_interval_option.py +43 -0
- appium/options/ios/xcuitest/wda/web_driver_agent_url_option.py +39 -0
- appium/options/ios/xcuitest/wda/xcode_org_id_option.py +39 -0
- appium/options/ios/xcuitest/wda/xcode_signing_id_option.py +39 -0
- appium/options/ios/xcuitest/webview/__init__.py +0 -0
- appium/options/ios/xcuitest/webview/absolute_web_locations_option.py +42 -0
- appium/options/ios/xcuitest/webview/additional_webview_bundle_ids_option.py +40 -0
- appium/options/ios/xcuitest/webview/enable_async_execute_from_https_option.py +39 -0
- appium/options/ios/xcuitest/webview/full_context_list_option.py +42 -0
- appium/options/ios/xcuitest/webview/include_safari_in_webviews_option.py +41 -0
- appium/options/ios/xcuitest/webview/native_web_tap_option.py +40 -0
- appium/options/ios/xcuitest/webview/safari_garbage_collect_option.py +39 -0
- appium/options/ios/xcuitest/webview/safari_ignore_fraud_warning_option.py +39 -0
- appium/options/ios/xcuitest/webview/safari_ignore_web_hostnames_option.py +42 -0
- appium/options/ios/xcuitest/webview/safari_initial_url_option.py +38 -0
- appium/options/ios/xcuitest/webview/safari_log_all_communication_hex_dump_option.py +43 -0
- appium/options/ios/xcuitest/webview/safari_log_all_communication_option.py +40 -0
- appium/options/ios/xcuitest/webview/safari_open_links_in_background_option.py +39 -0
- appium/options/ios/xcuitest/webview/safari_socket_chunk_size_option.py +41 -0
- appium/options/ios/xcuitest/webview/safari_web_inspector_max_frame_length_option.py +41 -0
- appium/options/ios/xcuitest/webview/webkit_response_timeout_option.py +43 -0
- appium/options/ios/xcuitest/webview/webview_connect_retries_option.py +40 -0
- appium/options/ios/xcuitest/webview/webview_connect_timeout_option.py +43 -0
- appium/options/mac/__init__.py +1 -0
- appium/options/mac/mac2/__init__.py +0 -0
- appium/options/mac/mac2/app_path_option.py +39 -0
- appium/options/mac/mac2/arguments_option.py +39 -0
- appium/options/mac/mac2/base.py +113 -0
- appium/options/mac/mac2/bootstrap_root_option.py +41 -0
- appium/options/mac/mac2/environment_option.py +41 -0
- appium/options/mac/mac2/server_startup_timeout_option.py +44 -0
- appium/options/mac/mac2/show_server_logs_option.py +39 -0
- appium/options/mac/mac2/skip_app_kill_option.py +40 -0
- appium/options/mac/mac2/web_driver_agent_mac_url_option.py +39 -0
- appium/options/windows/__init__.py +1 -0
- appium/options/windows/windows/__init__.py +0 -0
- appium/options/windows/windows/app_arguments_option.py +40 -0
- appium/options/windows/windows/app_top_level_window_option.py +40 -0
- appium/options/windows/windows/app_working_dir_option.py +40 -0
- appium/options/windows/windows/base.py +97 -0
- appium/options/windows/windows/create_session_timeout_option.py +45 -0
- appium/options/windows/windows/expreimental_web_driver_option.py +39 -0
- appium/options/windows/windows/wait_for_app_launch_option.py +43 -0
- appium/protocols/__init__.py +13 -0
- appium/protocols/webdriver/__init__.py +13 -0
- appium/protocols/webdriver/can_execute_commands.py +23 -0
- appium/protocols/webdriver/can_execute_scripts.py +27 -0
- appium/protocols/webdriver/can_find_elements.py +32 -0
- appium/protocols/webdriver/can_remember_extension_presence.py +23 -0
- appium/py.typed +0 -0
- appium/version.py +22 -0
- appium/webdriver/__init__.py +20 -0
- appium/webdriver/appium_connection.py +65 -0
- appium/webdriver/appium_service.py +330 -0
- appium/webdriver/applicationstate.py +21 -0
- appium/webdriver/client_config.py +38 -0
- appium/webdriver/clipboard_content_type.py +19 -0
- appium/webdriver/command_method.py +27 -0
- appium/webdriver/common/__init__.py +17 -0
- appium/webdriver/common/appiumby.py +54 -0
- appium/webdriver/connectiontype.py +42 -0
- appium/webdriver/errorhandler.py +125 -0
- appium/webdriver/extensions/__init__.py +13 -0
- appium/webdriver/extensions/action_helpers.py +188 -0
- appium/webdriver/extensions/android/__init__.py +0 -0
- appium/webdriver/extensions/android/activities.py +65 -0
- appium/webdriver/extensions/android/common.py +59 -0
- appium/webdriver/extensions/android/display.py +48 -0
- appium/webdriver/extensions/android/gsm.py +147 -0
- appium/webdriver/extensions/android/nativekey.py +1119 -0
- appium/webdriver/extensions/android/network.py +175 -0
- appium/webdriver/extensions/android/performance.py +85 -0
- appium/webdriver/extensions/android/power.py +80 -0
- appium/webdriver/extensions/android/sms.py +50 -0
- appium/webdriver/extensions/android/system_bars.py +58 -0
- appium/webdriver/extensions/applications.py +274 -0
- appium/webdriver/extensions/clipboard.py +107 -0
- appium/webdriver/extensions/context.py +63 -0
- appium/webdriver/extensions/device_time.py +75 -0
- appium/webdriver/extensions/execute_driver.py +60 -0
- appium/webdriver/extensions/execute_mobile_command.py +62 -0
- appium/webdriver/extensions/flutter_integration/__init__.py +13 -0
- appium/webdriver/extensions/flutter_integration/flutter_commands.py +296 -0
- appium/webdriver/extensions/flutter_integration/flutter_finder.py +55 -0
- appium/webdriver/extensions/flutter_integration/scroll_directions.py +6 -0
- appium/webdriver/extensions/hw_actions.py +149 -0
- appium/webdriver/extensions/images_comparison.py +132 -0
- appium/webdriver/extensions/keyboard.py +168 -0
- appium/webdriver/extensions/location.py +98 -0
- appium/webdriver/extensions/log_event.py +68 -0
- appium/webdriver/extensions/logs.py +53 -0
- appium/webdriver/extensions/remote_fs.py +110 -0
- appium/webdriver/extensions/screen_record.py +207 -0
- appium/webdriver/extensions/session.py +41 -0
- appium/webdriver/extensions/settings.py +49 -0
- appium/webdriver/locator_converter.py +29 -0
- appium/webdriver/mobilecommand.py +104 -0
- appium/webdriver/switch_to.py +35 -0
- appium/webdriver/webdriver.py +495 -0
- appium/webdriver/webelement.py +130 -0
- appium_python_client-5.2.0.dist-info/METADATA +573 -0
- appium_python_client-5.2.0.dist-info/RECORD +324 -0
- appium_python_client-5.2.0.dist-info/WHEEL +4 -0
- appium_python_client-5.2.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,573 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: Appium-Python-Client
|
|
3
|
+
Version: 5.2.0
|
|
4
|
+
Summary: Python client for Appium
|
|
5
|
+
Project-URL: Homepage, http://appium.io/
|
|
6
|
+
Project-URL: Repository, https://github.com/appium/python-client
|
|
7
|
+
Project-URL: Issues, https://github.com/appium/python-client/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/appium/python-client/blob/master/CHANGELOG.rst
|
|
9
|
+
Author-email: Isaac Murchie <isaac@saucelabs.com>
|
|
10
|
+
Maintainer: Kazuaki Matsuo, Mykola Mokhnach, Mori Atsushi
|
|
11
|
+
License-Expression: Apache-2.0
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: appium,mobile automation,python client,selenium
|
|
14
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Software Development :: Testing
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Requires-Dist: selenium<5.0,>=4.26
|
|
24
|
+
Requires-Dist: typing-extensions~=4.13
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# Appium Python Client
|
|
28
|
+
|
|
29
|
+
[](https://badge.fury.io/py/Appium-Python-Client)
|
|
30
|
+
[](https://pepy.tech/project/appium-python-client)
|
|
31
|
+
|
|
32
|
+
[](https://github.com/appium/python-client/actions/workflows/functional-test.yml)
|
|
33
|
+
|
|
34
|
+
An extension library for adding [WebDriver Protocol](https://www.w3.org/TR/webdriver/) and Appium commands to the Selenium Python language binding for use with the mobile testing framework [Appium](https://appium.io).
|
|
35
|
+
|
|
36
|
+
## Getting the Appium Python client
|
|
37
|
+
|
|
38
|
+
There are three ways to install and use the Appium Python client.
|
|
39
|
+
|
|
40
|
+
1. Install from [PyPi](https://pypi.org), as
|
|
41
|
+
['Appium-Python-Client'](https://pypi.org/project/Appium-Python-Client/).
|
|
42
|
+
|
|
43
|
+
```shell
|
|
44
|
+
pip install Appium-Python-Client
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
You can see the history from [here](https://pypi.org/project/Appium-Python-Client/#history)
|
|
48
|
+
|
|
49
|
+
2. Install from source, via [PyPi](https://pypi.org). From ['Appium-Python-Client'](https://pypi.org/project/Appium-Python-Client/),
|
|
50
|
+
download and unarchive the source tarball (Appium-Python-Client-X.X.tar.gz).
|
|
51
|
+
|
|
52
|
+
```shell
|
|
53
|
+
tar -xvf Appium-Python-Client-X.X.tar.gz
|
|
54
|
+
cd Appium-Python-Client-X.X
|
|
55
|
+
python setup.py install
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
3. Install from source via [GitHub](https://github.com/appium/python-client).
|
|
59
|
+
|
|
60
|
+
```shell
|
|
61
|
+
git clone git@github.com:appium/python-client.git
|
|
62
|
+
cd python-client
|
|
63
|
+
python setup.py install
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Compatibility Matrix
|
|
67
|
+
|
|
68
|
+
|Appium Python Client| Selenium binding| Python version |
|
|
69
|
+
|----|----|----|
|
|
70
|
+
|`5.1.1`+|`4.26.0`+ | 3.9+ |
|
|
71
|
+
|`4.5.0` - `5.1.0`|`4.26.0` - `4.31.0` | 3.9+ |
|
|
72
|
+
|`4.3.0` - `4.4.0`|`4.26.0` - `4.31.0` | 3.8+ |
|
|
73
|
+
|`3.0.0` - `4.2.1` |`4.12.0` - `4.25.0` | 3.8+ |
|
|
74
|
+
|`2.10.0` - `2.11.1` |`4.1.0` - `4.11.2` | 3.7+ |
|
|
75
|
+
|`2.2.0` - `2.9.0` |`4.1.0` - `4.9.0` | 3.7+ |
|
|
76
|
+
|`2.0.0` - `2.1.4` |`4.0.0` | 3.7+ |
|
|
77
|
+
|`1.0.0` - `1.3.0` |`3.x`| 3.7+ |
|
|
78
|
+
|`0.52` and below|`3.x`| 2.7, 3.4 - 3.7 |
|
|
79
|
+
|
|
80
|
+
The Appium Python Client depends on [Selenium Python binding](https://pypi.org/project/selenium/), thus
|
|
81
|
+
the Selenium Python binding update might affect the Appium Python Client behavior.
|
|
82
|
+
For example, some changes in the Selenium binding could break the Appium client.
|
|
83
|
+
|
|
84
|
+
> **Note**
|
|
85
|
+
> We strongly recommend you manage dependencies with version management tools such as
|
|
86
|
+
> [uv](https://docs.astral.sh/uv/) to keep compatible version combinations.
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### Quick migration guide from v4 to v5
|
|
90
|
+
- This change affects only for users who specify `keep_alive`, `direct_connection` and `strict_ssl` arguments for `webdriver.Remote`:
|
|
91
|
+
- Please use `AppiumClientConfig` as `client_config` argument similar to how it is specified below:
|
|
92
|
+
```python
|
|
93
|
+
SERVER_URL_BASE = 'http://127.0.0.1:4723'
|
|
94
|
+
# before
|
|
95
|
+
driver = webdriver.Remote(
|
|
96
|
+
SERVER_URL_BASE,
|
|
97
|
+
options=UiAutomator2Options().load_capabilities(desired_caps),
|
|
98
|
+
direct_connection=True,
|
|
99
|
+
keep_alive=False,
|
|
100
|
+
strict_ssl=False
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
# after
|
|
104
|
+
from appium.webdriver.client_config import AppiumClientConfig
|
|
105
|
+
client_config = AppiumClientConfig(
|
|
106
|
+
remote_server_addr=SERVER_URL_BASE,
|
|
107
|
+
direct_connection=True,
|
|
108
|
+
keep_alive=False,
|
|
109
|
+
ignore_certificates=True,
|
|
110
|
+
)
|
|
111
|
+
driver = webdriver.Remote(
|
|
112
|
+
options=UiAutomator2Options().load_capabilities(desired_caps),
|
|
113
|
+
client_config=client_config
|
|
114
|
+
)
|
|
115
|
+
```
|
|
116
|
+
- Note that you can keep using `webdriver.Remote(url, options=options, client_config=client_config)` format as well.
|
|
117
|
+
In such case the `remote_server_addr` argument of `AppiumClientConfig` constructor would have priority over the `url` argument of `webdriver.Remote` constructor.
|
|
118
|
+
- Use `http://127.0.0.1:4723` as the default server url instead of `http://127.0.0.1:4444/wd/hub`
|
|
119
|
+
|
|
120
|
+
### Quick migration guide from v3 to v4
|
|
121
|
+
- Removal
|
|
122
|
+
- `MultiAction` and `TouchAction` are removed. Please use W3C WebDriver actions or `mobile:` extensions
|
|
123
|
+
- [appium/webdriver/extensions/action_helpers.py](appium/webdriver/extensions/action_helpers.py)
|
|
124
|
+
- https://www.selenium.dev/documentation/webdriver/actions_api/
|
|
125
|
+
- https://www.youtube.com/watch?v=oAJ7jwMNFVU
|
|
126
|
+
- https://appiumpro.com/editions/30-ios-specific-touch-action-methods
|
|
127
|
+
- https://appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api
|
|
128
|
+
- Deprecated `AppiumBy.WINDOWS_UI_AUTOMATION`, which has no usage right now.
|
|
129
|
+
|
|
130
|
+
### Quick migration guide from v2 to v3
|
|
131
|
+
- `options` keyword argument in the `webdriver.Remote` constructor such as `XCUITestOptions` instead of `desired_capabilities`
|
|
132
|
+
- Available options are https://github.com/appium/python-client/tree/master/appium/options
|
|
133
|
+
- Please check the [Usage](#usage) below as an example.
|
|
134
|
+
- Not a "new" change, but the `desired_capabilities` argument has been removed since v3.
|
|
135
|
+
- Replacement
|
|
136
|
+
- `start_activity` method: Please use [`mobile: startActivity`](https://github.com/appium/appium-uiautomator2-driver?tab=readme-ov-file#mobile-startactivity)
|
|
137
|
+
- `launch_app`, `close_app` and `reset` methods: Please refer to https://github.com/appium/appium/issues/15807
|
|
138
|
+
- `available_ime_engines`, `is_ime_active`, `activate_ime_engine`, `deactivate_ime_engine` and `active_ime_engine` methods: Please use [`mobile: shell`](https://github.com/appium/appium-uiautomator2-driver?tab=readme-ov-file#mobile-shell)
|
|
139
|
+
- `set_value` and `set_text` methods: Please use `element.send_keys` or `send_keys` by W3C Actions
|
|
140
|
+
- Removal
|
|
141
|
+
- `end_test_coverage` method is no longer available
|
|
142
|
+
- `session` property is no longer available
|
|
143
|
+
- `all_sessions` property is no longer available
|
|
144
|
+
|
|
145
|
+
### Quick migration guide from v1 to v2
|
|
146
|
+
- Enhancement
|
|
147
|
+
- Updated base Selenium Python binding version to v4
|
|
148
|
+
- Removed `forceMjsonwp` since Selenium v4 and Appium Python client v2 expect only W3C WebDriver protocol
|
|
149
|
+
- Methods `ActionHelpers#scroll`, `ActionHelpers#drag_and_drop`, `ActionHelpers#tap`, `ActionHelpers#swipe` and `ActionHelpers#flick` now call W3C actions as its backend
|
|
150
|
+
- Please check each behavior. Their behaviors could slightly differ.
|
|
151
|
+
- Added `strict_ssl` to relax SSL errors such as self-signed ones
|
|
152
|
+
- Deprecated
|
|
153
|
+
- `MultiAction` and `TouchAction` are deprecated. Please use W3C WebDriver actions or `mobile:` extensions
|
|
154
|
+
- `launch_app`, `close_app`, and `reset` are deprecated. Please read [issues#15807](https://github.com/appium/appium/issues/15807) for more details
|
|
155
|
+
|
|
156
|
+
#### MultiAction/TouchAction to W3C actions
|
|
157
|
+
|
|
158
|
+
Some elements can be handled with `touch` pointer action instead of the default `mouse` pointer action in the Selenium Python client.
|
|
159
|
+
For example, the below action builder is to replace the default one with the `touch` pointer action.
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
from selenium.webdriver import ActionChains
|
|
163
|
+
from selenium.webdriver.common.actions import interaction
|
|
164
|
+
from selenium.webdriver.common.actions.action_builder import ActionBuilder
|
|
165
|
+
from selenium.webdriver.common.actions.pointer_input import PointerInput
|
|
166
|
+
|
|
167
|
+
actions = ActionChains(driver)
|
|
168
|
+
# override as 'touch' pointer action
|
|
169
|
+
actions.w3c_actions = ActionBuilder(driver, mouse=PointerInput(interaction.POINTER_TOUCH, "touch"))
|
|
170
|
+
actions.w3c_actions.pointer_action.move_to_location(start_x, start_y)
|
|
171
|
+
actions.w3c_actions.pointer_action.pointer_down()
|
|
172
|
+
actions.w3c_actions.pointer_action.pause(2)
|
|
173
|
+
actions.w3c_actions.pointer_action.move_to_location(end_x, end_y)
|
|
174
|
+
actions.w3c_actions.pointer_action.release()
|
|
175
|
+
actions.perform()
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
- [appium/webdriver/extensions/action_helpers.py](appium/webdriver/extensions/action_helpers.py)
|
|
179
|
+
- https://www.selenium.dev/documentation/webdriver/actions_api/
|
|
180
|
+
|
|
181
|
+
## Usage
|
|
182
|
+
|
|
183
|
+
The Appium Python Client is fully compliant with the WebDriver Protocol
|
|
184
|
+
including several helpers to make mobile testing in Python easier.
|
|
185
|
+
|
|
186
|
+
To use the new functionality now, and to use the superset of functions, instead of
|
|
187
|
+
including the Selenium `webdriver` module in your test code, use that from
|
|
188
|
+
Appium instead.
|
|
189
|
+
|
|
190
|
+
```python
|
|
191
|
+
from appium import webdriver
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
From there much of your test code will work with no change.
|
|
195
|
+
|
|
196
|
+
As a base for the following code examples, the following set up the [UnitTest](https://docs.python.org/3/library/unittest.html)
|
|
197
|
+
environment:
|
|
198
|
+
|
|
199
|
+
```python
|
|
200
|
+
# Python/Pytest
|
|
201
|
+
import pytest
|
|
202
|
+
|
|
203
|
+
from appium import webdriver
|
|
204
|
+
# Options are only available since client version 2.3.0
|
|
205
|
+
# If you use an older client then switch to desired_capabilities
|
|
206
|
+
# instead: https://github.com/appium/python-client/pull/720
|
|
207
|
+
from appium.options.android import UiAutomator2Options
|
|
208
|
+
from appium.options.ios import XCUITestOptions
|
|
209
|
+
from appium.webdriver.appium_service import AppiumService
|
|
210
|
+
from appium.webdriver.common.appiumby import AppiumBy
|
|
211
|
+
|
|
212
|
+
APPIUM_PORT = 4723
|
|
213
|
+
APPIUM_HOST = '127.0.0.1'
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
# HINT: fixtures below could be extracted into conftest.py
|
|
217
|
+
# HINT: and shared across all tests in the suite
|
|
218
|
+
@pytest.fixture(scope='session')
|
|
219
|
+
def appium_service():
|
|
220
|
+
service = AppiumService()
|
|
221
|
+
service.start(
|
|
222
|
+
# Check the output of `appium server --help` for the complete list of
|
|
223
|
+
# server command line arguments
|
|
224
|
+
args=['--address', APPIUM_HOST, '-p', str(APPIUM_PORT)],
|
|
225
|
+
timeout_ms=20000,
|
|
226
|
+
)
|
|
227
|
+
yield service
|
|
228
|
+
service.stop()
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
def create_ios_driver(custom_opts = None):
|
|
232
|
+
options = XCUITestOptions()
|
|
233
|
+
options.platformVersion = '13.4'
|
|
234
|
+
options.udid = '123456789ABC'
|
|
235
|
+
if custom_opts is not None:
|
|
236
|
+
options.load_capabilities(custom_opts)
|
|
237
|
+
# Appium1 points to http://127.0.0.1:4723/wd/hub by default
|
|
238
|
+
return webdriver.Remote(f'http://{APPIUM_HOST}:{APPIUM_PORT}', options=options)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def create_android_driver(custom_opts = None):
|
|
242
|
+
options = UiAutomator2Options()
|
|
243
|
+
options.platformVersion = '10'
|
|
244
|
+
options.udid = '123456789ABC'
|
|
245
|
+
if custom_opts is not None:
|
|
246
|
+
options.load_capabilities(custom_opts)
|
|
247
|
+
# Appium1 points to http://127.0.0.1:4723/wd/hub by default
|
|
248
|
+
return webdriver.Remote(f'http://{APPIUM_HOST}:{APPIUM_PORT}', options=options)
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
@pytest.fixture
|
|
252
|
+
def ios_driver_factory():
|
|
253
|
+
return create_ios_driver
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
@pytest.fixture
|
|
257
|
+
def ios_driver():
|
|
258
|
+
# prefer this fixture if there is no need to customize driver options in tests
|
|
259
|
+
driver = create_ios_driver()
|
|
260
|
+
yield driver
|
|
261
|
+
driver.quit()
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
@pytest.fixture
|
|
265
|
+
def android_driver_factory():
|
|
266
|
+
return create_android_driver
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
@pytest.fixture
|
|
270
|
+
def android_driver():
|
|
271
|
+
# prefer this fixture if there is no need to customize driver options in tests
|
|
272
|
+
driver = create_android_driver()
|
|
273
|
+
yield driver
|
|
274
|
+
driver.quit()
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
def test_ios_click(appium_service, ios_driver_factory):
|
|
278
|
+
# Usage of the context manager ensures the driver session is closed properly
|
|
279
|
+
# after the test completes. Otherwise, make sure to call `driver.quit()` on teardown.
|
|
280
|
+
with ios_driver_factory({
|
|
281
|
+
'appium:app': '/path/to/app/UICatalog.app.zip'
|
|
282
|
+
}) as driver:
|
|
283
|
+
el = driver.find_element(by=AppiumBy.ACCESSIBILITY_ID, value='item')
|
|
284
|
+
el.click()
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
def test_android_click(appium_service, android_driver_factory):
|
|
288
|
+
# Usage of the context manager ensures the driver session is closed properly
|
|
289
|
+
# after the test completes. Otherwise, make sure to call `driver.quit()` on teardown.
|
|
290
|
+
with android_driver_factory({
|
|
291
|
+
'appium:app': '/path/to/app/test-app.apk',
|
|
292
|
+
'appium:udid': '567890',
|
|
293
|
+
}) as driver:
|
|
294
|
+
el = driver.find_element(by=AppiumBy.ACCESSIBILITY_ID, value='item')
|
|
295
|
+
el.click()
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Available `options`
|
|
299
|
+
|
|
300
|
+
Appium Python Client has a common options class named `AppiumOptions` but the available commands are minimal.
|
|
301
|
+
It does not have driver/automationName specific commands unless adding commands with `add_command` method.
|
|
302
|
+
|
|
303
|
+
Available options for each automation name below will help to check what options are already defined.
|
|
304
|
+
Please use proper options for your automaiton usage.
|
|
305
|
+
|
|
306
|
+
`automationName` | Package path
|
|
307
|
+
|:---|:-----|
|
|
308
|
+
any | `appium.options.common.base.AppiumOptions`
|
|
309
|
+
`uiautomator2` | `appium.options.android.Uiautomator2Options`
|
|
310
|
+
`espresso` | `appium.options.android.EspressoOptions`
|
|
311
|
+
`xcuitest` | `appium.options.ios.XCUITestOptions`
|
|
312
|
+
`safari` | `appium.options.ios.SafariOptions`
|
|
313
|
+
`mac2` | `appium.options.mac.Mac2Options`
|
|
314
|
+
`windows` | `appium.options.WindowsOptions`
|
|
315
|
+
`gecko` | `appium.options.GeckoOptions`
|
|
316
|
+
`flutterintegration` | `appium.options.flutter_integration.FlutterOptions`
|
|
317
|
+
|
|
318
|
+
## Direct Connect URLs
|
|
319
|
+
|
|
320
|
+
If your Selenium/Appium server decorates the new session capabilities response with the following keys:
|
|
321
|
+
|
|
322
|
+
- `directConnectProtocol`
|
|
323
|
+
- `directConnectHost`
|
|
324
|
+
- `directConnectPort`
|
|
325
|
+
- `directConnectPath`
|
|
326
|
+
|
|
327
|
+
Then python client will switch its endpoint to the one specified by the values of those keys.
|
|
328
|
+
|
|
329
|
+
```python
|
|
330
|
+
from appium import webdriver
|
|
331
|
+
# Options are only available since client version 2.3.0
|
|
332
|
+
# If you use an older client then switch to desired_capabilities
|
|
333
|
+
# instead: https://github.com/appium/python-client/pull/720
|
|
334
|
+
from appium.options.ios import XCUITestOptions
|
|
335
|
+
from appium.webdriver.client_config import AppiumClientConfig
|
|
336
|
+
|
|
337
|
+
# load_capabilities API could be used to
|
|
338
|
+
# load options mapping stored in a dictionary
|
|
339
|
+
options = XCUITestOptions().load_capabilities({
|
|
340
|
+
'platformVersion': '13.4',
|
|
341
|
+
'deviceName': 'iPhone Simulator',
|
|
342
|
+
'app': '/full/path/to/app/UICatalog.app.zip',
|
|
343
|
+
})
|
|
344
|
+
|
|
345
|
+
client_config = AppiumClientConfig(
|
|
346
|
+
remote_server_addr='http://127.0.0.1:4723',
|
|
347
|
+
direct_connection=True
|
|
348
|
+
)
|
|
349
|
+
|
|
350
|
+
driver = webdriver.Remote(
|
|
351
|
+
# Appium1 points to http://127.0.0.1:4723/wd/hub by default
|
|
352
|
+
'http://127.0.0.1:4723',
|
|
353
|
+
options=options,
|
|
354
|
+
client_config=client_config
|
|
355
|
+
)
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
## Relax SSL validation
|
|
359
|
+
|
|
360
|
+
`strict_ssl` option allows you to send commands to an invalid certificate host like a self-signed one.
|
|
361
|
+
|
|
362
|
+
```python
|
|
363
|
+
from appium import webdriver
|
|
364
|
+
# Options are only available since client version 2.3.0
|
|
365
|
+
# If you use an older client then switch to desired_capabilities
|
|
366
|
+
# instead: https://github.com/appium/python-client/pull/720
|
|
367
|
+
from appium.options.common import AppiumOptions
|
|
368
|
+
|
|
369
|
+
options = AppiumOptions()
|
|
370
|
+
options.platform_name = 'mac'
|
|
371
|
+
options.automation_name = 'safari'
|
|
372
|
+
# set_capability API allows to provide any custom option
|
|
373
|
+
# calls to it could be chained
|
|
374
|
+
options.set_capability('browser_name', 'safari')
|
|
375
|
+
|
|
376
|
+
# Appium1 points to http://127.0.0.1:4723/wd/hub by default
|
|
377
|
+
driver = webdriver.Remote('http://127.0.0.1:4723', options=options, strict_ssl=False)
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
Since Appium Python client v4.3.0, we recommend using `selenium.webdriver.remote.client_config.ClientConfig`
|
|
381
|
+
instead of giving `strict_ssl` as an argument of `webdriver.Remote` below to configure the validation.
|
|
382
|
+
|
|
383
|
+
```python
|
|
384
|
+
from appium import webdriver
|
|
385
|
+
|
|
386
|
+
from selenium.webdriver.remote.client_config import ClientConfig
|
|
387
|
+
|
|
388
|
+
client_config = ClientConfig(
|
|
389
|
+
remote_server_addr='http://127.0.0.1:4723',
|
|
390
|
+
ignore_certificates=True
|
|
391
|
+
)
|
|
392
|
+
driver = webdriver.Remote(client_config.remote_server_addr, options=options, client_config=client_config)
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
## Set custom `AppiumConnection`
|
|
396
|
+
|
|
397
|
+
The first argument of `webdriver.Remote` can set an arbitrary command executor for you.
|
|
398
|
+
|
|
399
|
+
1. Set init arguments for the pool manager Appium Python client uses to manage HTTP requests.
|
|
400
|
+
|
|
401
|
+
```python
|
|
402
|
+
from appium import webdriver
|
|
403
|
+
from appium.options.ios import XCUITestOptions
|
|
404
|
+
|
|
405
|
+
import urllib3
|
|
406
|
+
from appium.webdriver.appium_connection import AppiumConnection
|
|
407
|
+
|
|
408
|
+
# Retry connection error up to 3 times.
|
|
409
|
+
init_args_for_pool_manage = {
|
|
410
|
+
'retries': urllib3.util.retry.Retry(total=3, connect=3, read=False)
|
|
411
|
+
}
|
|
412
|
+
appium_executor = AppiumConnection(
|
|
413
|
+
remote_server_addr='http://127.0.0.1:4723',
|
|
414
|
+
init_args_for_pool_manage=init_args_for_pool_manage
|
|
415
|
+
)
|
|
416
|
+
|
|
417
|
+
options = XCUITestOptions()
|
|
418
|
+
options.platformVersion = '13.4'
|
|
419
|
+
options.udid = '123456789ABC'
|
|
420
|
+
options.app = '/full/path/to/app/UICatalog.app.zip'
|
|
421
|
+
driver = webdriver.Remote(appium_executor, options=options)
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
2. Define a subclass of `AppiumConnection`
|
|
426
|
+
|
|
427
|
+
```python
|
|
428
|
+
from appium import webdriver
|
|
429
|
+
from appium.options.ios import XCUITestOptions
|
|
430
|
+
|
|
431
|
+
from appium.webdriver.appium_connection import AppiumConnection
|
|
432
|
+
|
|
433
|
+
class CustomAppiumConnection(AppiumConnection):
|
|
434
|
+
# Can add your own methods for the custom class
|
|
435
|
+
pass
|
|
436
|
+
|
|
437
|
+
custom_executor = CustomAppiumConnection(remote_server_addr='http://127.0.0.1:4723')
|
|
438
|
+
|
|
439
|
+
options = XCUITestOptions().load_capabilities({
|
|
440
|
+
'platformVersion': '13.4',
|
|
441
|
+
'deviceName': 'iPhone Simulator',
|
|
442
|
+
'app': '/full/path/to/app/UICatalog.app.zip',
|
|
443
|
+
})
|
|
444
|
+
driver = webdriver.Remote(custom_executor, options=options)
|
|
445
|
+
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
The `AppiumConnection` can set `selenium.webdriver.remote.client_config.ClientConfig` as well.
|
|
449
|
+
|
|
450
|
+
## Relaxing HTTP request read timeout
|
|
451
|
+
|
|
452
|
+
Appium Python Client has `120` seconds read timeout on each HTTP request since the version v4.3.0 because of
|
|
453
|
+
the corresponding selenium binding version.
|
|
454
|
+
You have two methods to extend the read timeout.
|
|
455
|
+
|
|
456
|
+
1. **Recommend** Configure timeout via `appium.webdriver.client_config.AppiumClientConfig` or `selenium.webdriver.remote.client_config.ClientConfig`
|
|
457
|
+
- `timeout` argument, or
|
|
458
|
+
- `init_args_for_pool_manager` argument for `urllib3.PoolManager`
|
|
459
|
+
2. Set `GLOBAL_DEFAULT_TIMEOUT` environment variable
|
|
460
|
+
- This env var will be removed from the selenium binding ([issue](https://github.com/SeleniumHQ/selenium/issues/15604))
|
|
461
|
+
|
|
462
|
+
## Documentation
|
|
463
|
+
|
|
464
|
+
- https://appium.github.io/python-client-sphinx/ is detailed documentation
|
|
465
|
+
- [functional tests](test/functional) also may help to see concrete examples.
|
|
466
|
+
|
|
467
|
+
## Development
|
|
468
|
+
|
|
469
|
+
- Code Style: [PEP-0008](https://www.python.org/dev/peps/pep-0008/)
|
|
470
|
+
- Apply `ruff` as pre commit hook
|
|
471
|
+
- Run `make` command for development. See `make help` output for details
|
|
472
|
+
- Docstring style: [Google Style](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)
|
|
473
|
+
- `gitchangelog` generates `CHANGELOG.rst`
|
|
474
|
+
|
|
475
|
+
### Setup
|
|
476
|
+
|
|
477
|
+
```bash
|
|
478
|
+
make install-uv
|
|
479
|
+
exec $SHELL
|
|
480
|
+
make sync-dev
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
Running above commands should automatically setup the virtual environment for the project
|
|
484
|
+
using the default system Python version and put it into the `.venv` folder under the project root.
|
|
485
|
+
If you'd like to customize the Python version then run the following command before `make sync-dev`:
|
|
486
|
+
|
|
487
|
+
```bash
|
|
488
|
+
uv venv --python <V>
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
where `<V>` is the actual Python version, for example `3.12`.
|
|
492
|
+
|
|
493
|
+
If you want to customize the folder where uv stores the virtual environment by default
|
|
494
|
+
(e.g. `.venv`) then add an argument containing the destination folder path to the above command:
|
|
495
|
+
|
|
496
|
+
```bash
|
|
497
|
+
uv venv /venv/root/folder
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
In order to activate the newly created virtual environment you may either source it:
|
|
501
|
+
|
|
502
|
+
```bash
|
|
503
|
+
source /venv/root/folder/bin/activate
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
or add it to PATH:
|
|
507
|
+
|
|
508
|
+
```bash
|
|
509
|
+
export "PATH=/venv/root/folder/bin:$PATH"
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
### Linting And Formatting
|
|
513
|
+
|
|
514
|
+
Run linter and format checks
|
|
515
|
+
|
|
516
|
+
```bash
|
|
517
|
+
make check
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
Address autofixable linter and formatting issues
|
|
521
|
+
|
|
522
|
+
```bash
|
|
523
|
+
make fix
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
### Testing
|
|
527
|
+
|
|
528
|
+
#### Unit
|
|
529
|
+
|
|
530
|
+
```bash
|
|
531
|
+
make unittest
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
Run in parallel (2 threads)
|
|
535
|
+
|
|
536
|
+
```bash
|
|
537
|
+
make unittest ARGS="-n 2"
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
#### Functional
|
|
541
|
+
|
|
542
|
+
```bash
|
|
543
|
+
uv run pytest test/functional/ios/search_context/find_by_ios_class_chain_tests.py
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
#### In parallel for iOS
|
|
547
|
+
|
|
548
|
+
1. Create simulators named 'iPhone X - 8100' and 'iPhone X - 8101'
|
|
549
|
+
1. Run tests
|
|
550
|
+
|
|
551
|
+
```bash
|
|
552
|
+
uv run pytest -n 2 test/functional/ios/search_context/find_by_ios_class_chain_tests.py
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
## Release
|
|
556
|
+
|
|
557
|
+
Follow the below steps.
|
|
558
|
+
|
|
559
|
+
```bash
|
|
560
|
+
uv pip install setuptools
|
|
561
|
+
uv pip install twine
|
|
562
|
+
uv pip install gitchangelog
|
|
563
|
+
# Type the new version number and 'yes' if you can publish it
|
|
564
|
+
# You can test the command with DRY_RUN
|
|
565
|
+
DRY_RUN=1 ./release.sh
|
|
566
|
+
./release.sh # release
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
If the `pypi` was not able to publish with user name and password, please try out `-u` and `-p` option by yourself with `twine` such as `twine upload -u <name> -p <pass> dist/Appium-Python-Client-4.1.0.tar.gz`.
|
|
570
|
+
|
|
571
|
+
## License
|
|
572
|
+
|
|
573
|
+
Apache License v2
|