TA的每日心情 | 奋斗 2021-8-16 14:04 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]测试小兵
|
3#
楼主 |
发表于 2018-3-12 14:34:07
|
只看该作者
| pinch(self, element=None, percent=200, steps=50)
| Pinch on an element a certain amount
|
| :Args:
| - element - the element to pinch
| - percent - (optional) amount to pinch. Defaults to 200%
| - steps - (optional) number of steps in the pinch action
|
| :Usage:
| driver.pinch(element)
|
| press_keycode(self, keycode, metastate=None)
| Sends a keycode to the device. Android only. Possible keycodes can be
| found in http://developer.android.com/ref ... view/KeyEvent.html.
|
| :Args:
| - keycode - the keycode to be sent to the device
| - metastate - meta information about the keycode being sent
|
| pull_file(self, path)
| Retrieves the file at `path`. Returns the file's content encoded as
| Base64.
|
| :Args:
| - path - the path to the file on the device
|
| pull_folder(self, path)
| Retrieves a folder at `path`. Returns the folder's contents zipped
| and encoded as Base64.
|
| :Args:
| - path - the path to the folder on the device
|
| push_file(self, path, base64data)
| Puts the data, encoded as Base64, in the file specified as `path`.
|
| :Args:
| - path - the path on the device
| - base64data - data, encoded as Base64, to be written to the file
|
| remove_app(self, app_id)
| Remove the specified application from the device.
|
| :Args:
| - app_id - the application id to be removed
|
| reset(self)
| Resets the current application on the device.
|
| scroll(self, origin_el, destination_el)
| Scrolls from one element to another
|
| :Args:
| - originalEl - the element from which to being scrolling
| - destinationEl - the element to scroll to
|
| :Usage:
| driver.scroll(el1, el2)
|
| set_location(self, latitude, longitude, altitude)
| Set the location of the device
|
| :Args:
| - latitude - String or numeric value between -90.0 and 90.00
| - longitude - String or numeric value between -180.0 and 180.0
| - altitude - String or numeric value
|
| set_network_connection(self, connectionType)
| Sets the network connection type. Android only.
| Possible values:
| Value (Alias) | Data | Wifi | Airplane Mode
| -------------------------------------------------
| 0 (None) | 0 | 0 | 0
| 1 (Airplane Mode) | 0 | 0 | 1
| 2 (Wifi only) | 0 | 1 | 0
| 4 (Data only) | 1 | 0 | 0
| 6 (All network on) | 1 | 1 | 0
| These are available through the enumeration `appium.webdriver.ConnectionType`
|
| :Args:
| - connectionType - a member of the enum appium.webdriver.ConnectionType
|
| set_value(self, element, value)
| Set the value on an element in the application.
|
| :Args:
| - element - the element whose value will be set
| - Value - the value to set on the element
|
| shake(self)
| Shake the device.
|
| start_activity(self, app_package, app_activity, **opts)
| Opens an arbitrary activity during a test. If the activity belongs to
| another application, that application is started and the activity is opened.
|
| This is an Android-only method.
|
| :Args:
| - app_package - The package containing the activity to start.
| - app_activity - The activity to start.
| - app_wait_package - Begin automation after this package starts (optional).
| - app_wait_activity - Begin automation after this activity starts (optional).
| - intent_action - Intent to start (optional).
| - intent_category - Intent category to start (optional).
| - intent_flags - Flags to send to the intent (optional).
| - optional_intent_arguments - Optional arguments to the intent (optional).
| - dont_stop_app_on_reset - Should the app be stopped on reset (optional)?
|
| swipe(self, start_x, start_y, end_x, end_y, duration=None)
| Swipe from one point to another point, for an optional duration.
|
| :Args:
| - start_x - x-coordinate at which to start
| - start_y - y-coordinate at which to start
| - end_x - x-coordinate at which to stop
| - end_y - y-coordinate at which to stop
| - duration - (optional) time to take the swipe, in ms.
|
| :Usage:
| driver.swipe(100, 100, 100, 400)
|
| tap(self, positions, duration=None)
| Taps on an particular place with up to five fingers, holding for a
| certain time
|
| :Args:
| - positions - an array of tuples representing the x/y coordinates of
| the fingers to tap. Length can be up to five.
| - duration - (optional) length of time to tap, in ms
|
| :Usage:
| driver.tap([(100, 20), (100, 60), (100, 100)], 500)
|
| toggle_location_services(self)
| Toggle the location services on the device. Android only.
|
| toggle_touch_id_enrollment(self)
| Toggle enroll touchId on iOS Simulator
|
| touch_id(self, match)
| Simulate touchId on iOS Simulator
|
| update_settings(self, settings)
| Set settings for the current session.
| For more on settings, see: https://github.com/appium/appium ... oncepts/settings.md
|
| :Args:
| - settings - dictionary of settings to apply to the current test session
|
| wait_activity(self, activity, timeout, interval=1)
| Wait for an activity: block until target activity presents
| or time out.
|
| This is an Android-only method.
|
| :Agrs:
| - activity - target activity
| - timeout - max wait time, in seconds
| - interval - sleep interval between retries, in seconds
|
| zoom(self, element=None, percent=200, steps=50)
| Zooms in on an element a certain amount
|
| :Args:
| - element - the element to zoom
| - percent - (optional) amount to zoom. Defaults to 200%
| - steps - (optional) number of steps in the zoom action
|
| :Usage:
| driver.zoom(element)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| active_ime_engine
| Returns the activity and package of the currently active IME engine (e.g.,
| 'com.android.inputmethod.latin/.LatinIME').
| Android only.
|
| available_ime_engines
| Get the available input methods for an Android device. Package and
| activity are returned (e.g., ['com.android.inputmethod.latin/.LatinIME'])
| Android only.
|
| context
| Returns the current context of the current session.
|
| :Usage:
| driver.context
|
| contexts
| Returns the contexts within the current session.
|
| :Usage:
| driver.contexts
|
| current_activity
| Retrieves the current activity running on the device.
|
| current_context
| Returns the current context of the current session.
|
| :Usage:
| driver.current_context
|
| current_package
| Retrieves the current package running on the device.
|
| device_time
| Returns the date and time from the device
|
| network_connection
| Returns an integer bitmask specifying the network connection type.
| Android only.
| Possible values are available through the enumeration `appium.webdriver.ConnectionType`
|
| ----------------------------------------------------------------------
| Methods inherited from selenium.webdriver.remote.webdriver.WebDriver:
|
| __repr__(self)
|
| add_cookie(self, cookie_dict)
| Adds a cookie to your current session.
|
| :Args:
| - cookie_dict: A dictionary object, with required keys - "name" and "value";
| optional keys - "path", "domain", "secure", "expiry"
|
| Usage:
| driver.add_cookie({'name' : 'foo', 'value' : 'bar'})
| driver.add_cookie({'name' : 'foo', 'value' : 'bar', 'path' : '/'})
| driver.add_cookie({'name' : 'foo', 'value' : 'bar', 'path' : '/', 'secure':True})
|
|
|
|