Back to Appium

Protocol Methods

packages/base-driver/docs/mjsonwp/protocol-methods.md

7.9.019.4 KB
Original Source

Currently supported endpoints

The following are endpoints that are currently supported by the Appium server. Particular drivers may or may not implement functionality depending on the underlying system.

WebDriver endpoints

See the WebDriver W3C and JSON Wire Protocol specifications.

HTTP MethodPathDetails
GETstatusRetrieve the server’s current status.
POSTsessionCreate a new session.
GETsessionsRetrieve a list of currently active sessions.
GETsession/{sessionId}Retrieve the capabilities of the specified session.
DELETEsession/{sessionId}Delete the session.
POSTsession/{sessionId}/timeoutsConfigure the amount of time that a particular type of operation can execute for before they are aborted and a
POSTsession/{sessionId}/timeouts/async_scriptSet the amount of time that asynchronous scripts executed by /session/{sessionId/execute_async are permitted to run before they are aborted.
POSTsession/{sessionId}/timeouts/implicit_waitSet the amount of time the driver should wait when searching for elements.
GETsession/{sessionId}/window_handleRetrieve the current window handle.
GETsession/{sessionId}/window_handlesRetrieve the list of all window handles available to the session.
GETsession/{sessionId}/urlRetrieve the URL of the current page.
POSTsession/{sessionId}/urlNavigate to a new URL.
POSTsession/{sessionId}/forwardNavigate forwards in the browser history, if possible.
POSTsession/{sessionId}/backNavigate backwards in the browser history, if possible.
POSTsession/{sessionId}/refreshRefresh the current page.
POSTsession/{sessionId}/executeInject a snippet of JavaScript into the page for execution in the current context.
POSTsession/{sessionId}/execute_asyncInject a snippet of JavaScript into the page for asynchronous execution in the context of the currently selected frame.
GETsession/{sessionId}/screenshotTake a screenshot of the current page.
GETsession/{sessionId}/ime/available_enginesList all available input engines on the machine.
GETsession/{sessionId}/ime/active_engineGet the name of the active IME engine.
GETsession/{sessionId}/ime/activatedIndicates whether IME input is active at the moment (not if it is available).
POSTsession/{sessionId}/ime/deactivateDe-activates the currently-active IME engine.
POSTsession/{sessionId}/ime/activateMake an engine that is available active.
POSTsession/{sessionId}/frameChange focus to another frame on the page.
POSTsession/{sessionId}/windowChange focus to another window.
GETsession/{sessionId}/window/{windowhandle}/sizeGet the size of the specified window.
POSTsession/{sessionId}/window/{windowhandle}/maximizeMaximize the specified window if not already maximized.
GETsession/{sessionId}/cookieRetrieve all cookies visible to the current page.
POSTsession/{sessionId}/cookieSet a cookie.
DELETEsession/{sessionId}/cookieDelete all cookies visible to the current page.
DELETEsession/{sessionId}/cookie/{name}Delete the cookie with the given name.
GETsession/{sessionId}/sourceGet the current page source.
GETsession/{sessionId}/titleGet the current page title.
POSTsession/{sessionId}/elementSearch for an element on the page, starting from the document root.
POSTsession/{sessionId}/elementsSearch for multiple elements on the page, starting from the document root.
POSTsession/{sessionId}/element/activeGet the element on the page that currently has focus.
POSTsession/{sessionId}/element/{elementId}/elementSearch for an element on the page, starting from the identified element.
POSTsession/{sessionId}/element/{elementId}/elementsSearch for multiple elements on the page, starting from the identified element.
POSTsession/{sessionId}/element/{elementId}/clickClick on an element.
POSTsession/{sessionId}/element/{elementId}/submitSubmit a form element.
GETsession/{sessionId}/element/{elementId}/textReturns the visible text for the element.
POSTsession/{sessionId}/element/{elementId}/valueSend a sequence of key strokes to an element.
POSTsession/{sessionId}/keysSend a sequence of key strokes to the active element.
GETsession/{sessionId}/element/{elementId}/nameQuery for an element's tag name.
POSTsession/{sessionId}/element/{elementId}/clearClear a text element's value.
GETsession/{sessionId}/element/{elementId}/selectedDetermine if an element is currently selected.
GETsession/{sessionId}/element/{elementId}/enabledDetermine if an element is currently enabled.
GETsession/{sessionId}/element/{elementId}/attribute/{name}Get the value of an element's attribute.
GETsession/{sessionId}/element/{elementId}/equals/{otherId}Test if two element IDs refer to the same element.
GETsession/{sessionId}/element/{elementId}/displayedDetermine if an element is currently displayed.
GETsession/{sessionId}/element/{elementId}/locationDetermine an element's location on the page.
GETsession/{sessionId}/element/{elementId}/location_in_viewDetermine an element's location on the screen once it has been scrolled into view.
GETsession/{sessionId}/element/{elementId}/sizeDetermine an element's size in pixels.
GETsession/{sessionId}/element/{elementId}/css/{propertyName}Query the value of an element's computed CSS property.
GETsession/{sessionId}/orientationGet the current device orientation.
POSTsession/{sessionId}/orientationSet the device orientation
GETsession/{sessionId}/alert_textGets the text of the currently displayed dialog
POSTsession/{sessionId}/alert_textSends keystrokes to the currently displayed dialog
POSTsession/{sessionId}/accept_alertAccepts the currently displayed alert dialog.
POSTsession/{sessionId}/dismiss_alertDismisses the currently displayed alert dialog.
POSTsession/{sessionId}/movetoMove the pointer by an offset of the specified element.
POSTsession/{sessionId}/clickClick on the current pointer position.
POSTsession/{sessionId}/touch/clickSingle tap on the touch enabled device.
POSTsession/{sessionId}/touch/downFinger down on the screen.
POSTsession/{sessionId}/touch/upFinger up on the screen.
POSTsession/{sessionId}/touch/moveFinger move on the screen.
POSTsession/{sessionId}/touch/longclickLong press on the touch screen using finger motion events.
POSTsession/{sessionId}/touch/flickFlick on the touch screen using finger motion events.
GETsession/{sessionId}/locationGet the current geo location.
POSTsession/{sessionId}/locationSet the current geo location.
POSTsession/{sessionId}/logGet the log for a given log type.
GETsession/{sessionId}/log/typesGet available log types.

Mobile JSON Wire Protocol endpoints

See https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md

HTTP MethodPathDetails
GETsession/{sessionId}/contextRetrieves the current context.
POSTsession/{sessionId}/contextSwitches to the given context.
GETsession/{sessionId}/contextsRetrieves an array of strings representing available contexts.
GETsession/{sessionId}/element/{elementId}/pageIndex
GETsession/{sessionId}/network_connectionRetrieves the current network connection type.
POSTsession/{sessionId}/network_connectionSets the network connection to the given type.
POSTsession/{sessionId}/touch/performPerform the given touch action sequence.
POSTsession/{sessionId}/touch/multi/performPerform the given multi-touch action sequence.
POSTsession/{sessionId}/receive_async_responseCallback url for asynchronous execution of JavaScript.

Appium extension endpoints

See https://w3c.github.io/webdriver/webdriver-spec.html#protocol-extensions

HTTP MethodPathDetails
POSTsession/{sessionId}/appium/device/shakePerform a shake action on the device.
POSTsession/{sessionId}/appium/device/lockLock the device.
POSTsession/{sessionId}/appium/device/unlockUnlock the device.
POSTsession/{sessionId}/appium/device/is_lockedCheck whether the device is locked or not.
POSTsession/{sessionId}/appium/start_recording_screenstart recording the screen.
POSTsession/{sessionId}/appium/stop_recording_screenstop recording the screen.
POSTsession/{sessionId}/appium/performanceData/typesreturns the information types of the system state which is supported to read as like cpu, memory, network traffic, and battery.
POSTsession/{sessionId}/appium/getPerformanceDatareturns the information of the system state which is supported to read as like cpu, memory, network traffic, and battery.
POSTsession/{sessionId}/appium/device/press_keycodePress a particular key code on the device.
POSTsession/{sessionId}/appium/device/long_press_keycodePress and hold a particular key code on the device.
POSTsession/{sessionId}/appium/device/keyeventSend a key code to the device.
GETsession/{sessionId}/appium/device/current_activityRetrieve the current activity running on the device.
GETsession/{sessionId}/appium/device/current_packageRetrieve the current package running on the device.
POSTsession/{sessionId}/appium/device/install_appInstall the given app onto the device.
POSTsession/{sessionId}/appium/device/remove_appRemove an app from the device.
POSTsession/{sessionId}/appium/device/app_installedCheck whether the specified app is installed on the device.
POSTsession/{sessionId}/appium/device/hide_keyboardHide the soft keyboard.
GETsession/{sessionId}/appium/device/is_keyboard_shownWhether or not the soft keyboard is shown.
POSTsession/{sessionId}/appium/device/push_filePlace a file onto the device in a particular place.
POSTsession/{sessionId}/appium/device/pull_fileRetrieve a file from the device's file system.
POSTsession/{sessionId}/appium/device/pull_folderRetrieve a folder from the device's file system.
POSTsession/{sessionId}/appium/device/toggle_airplane_modeSwitch the state of airplane mode.
POSTsession/{sessionId}/appium/device/toggle_dataSwitch the state of data service.
POSTsession/{sessionId}/appium/device/toggle_wifiSwitch the state of the wifi service.
POSTsession/{sessionId}/appium/device/toggle_location_servicesSwitch the state of the location service.
POSTsession/{sessionId}/appium/device/open_notificationsOpen the notifications pane on the device.
POSTsession/{sessionId}/appium/device/start_activityStart the specified activity on the device.
GETsession/{sessionId}/appium/device/system_barsRetrieve visibility and bounds information of the status and navigation bars.
GETsession/{sessionId}/appium/device/display_densityRetrieve the display density of the device.
POSTsession/{sessionId}/appium/simulator/toggle_touch_id_enrollmentToggle enrollment of touch id on the simulator.
POSTsession/{sessionId}/appium/simulator/touch_idSimulate a successful or failed touch id event on the simulator.
POSTsession/{sessionId}/appium/app/launchLaunch the given application on the device.
POSTsession/{sessionId}/appium/app/closeClose the given application.
POSTsession/{sessionId}/appium/app/resetReset the device.
POSTsession/{sessionId}/appium/app/backgroundSend the current application to the background.
POSTsession/{sessionId}/appium/app/end_test_coverageEnd test coverage on the device.
POSTsession/{sessionId}/appium/app/stringsRetrieve the application's strings file.
POSTsession/{sessionId}/appium/element/{elementId}/valueRetrieve the value from the given element.
POSTsession/{sessionId}/appium/element/{elementId}/replace_valueReplace the value of the given element.
GETsession/{sessionId}/appium/settingsRetrieve a JSON hash of all the currently specified settings.
POSTsession/{sessionId}/appium/settingsUpdate the current setting on the device.
POSTsession/{sessionId}/appium/receive_async_responseCallback url for asynchronous execution of JavaScript.

Not implemented

The following routes are not implemented by any Appium driver, and will throw an error.

HTTP MethodPathDetails
POSTsession/{sessionId}/frame/parentChange focus to the parent frame.
POSTsession/{sessionId}/window/{windowhandle}/sizeChange the size of the specified window.
GETsession/{sessionId}/window/{windowhandle}/positionGet the position of the specified window.
POSTsession/{sessionId}/window/{windowhandle}/positionChange the position of the specified window.
GETsession/{sessionId}/element/{elementId}Describe the identified element.
POSTsession/{sessionId}/buttondownClick and hold the left mouse button (at the coordinates set by the last moveto command).
POSTsession/{sessionId}/buttonupReleases the mouse button previously held (where the mouse is currently at).
POSTsession/{sessionId}/doubleclickDouble-clicks at the current mouse coordinates (set by moveto).
POSTsession/{sessionId}/touch/scrollScroll on the touch screen using finger based motion events.
POSTsession/{sessionId}/touch/doubleclickDouble tap on the touch screen using finger motion events.
GETsession/{sessionId}/local_storageGet all keys of the storage.
POSTsession/{sessionId}/local_storageSet the storage item for the given key.
DELETEsession/{sessionId}/local_storageClear the storage.
GETsession/{sessionId}/local_storage/key/{key}Get the storage item for the given key.
DELETEsession/{sessionId}/local_storage/key/{key}Remove the storage item for the given key.
GETsession/{sessionId}/local_storage/sizeGet the number of items in the storage.
GETsession/{sessionId}/session_storageGet all keys of the storage.
POSTsession/{sessionId}/session_storageSet the storage item for the given key.
DELETEsession/{sessionId}/session_storageClear the storage.
GETsession/{sessionId}/session_storage/key/{key}Get the storage item for the given key.
DELETEsession/{sessionId}/session_storage/key/{key}Remove the storage item for the given key.
GETsession/{sessionId}/session_storage/sizeGet the number of items in the storage.
GETsession/{sessionId}/application_cache/statusGet the status of the html5 application cache.