webdriver.common.mobileby.MobileBy¶Bases: selenium.webdriver.common.by.By
ACCESSIBILITY_ID = 'accessibility id'¶ANDROID_DATA_MATCHER = '-android datamatcher'¶ANDROID_UIAUTOMATOR = '-android uiautomator'¶ANDROID_VIEWTAG = '-android viewtag'¶CUSTOM = '-custom'¶IMAGE = '-image'¶IOS_CLASS_CHAIN = '-ios class chain'¶IOS_PREDICATE = '-ios predicate string'¶IOS_UIAUTOMATION = '-ios uiautomation'¶WINDOWS_UI_AUTOMATION = '-windows uiautomation'¶webdriver.common.multi_action.MultiAction(driver: WebDriver, element: Optional[WebElement] = None)¶Bases: object
add(*touch_actions: TouchAction) → None¶Add TouchAction objects to the MultiAction, to be performed later.
touch_actions (TouchAction) – one or more TouchAction objects describing a chain of actions to be performed by one finger
a1 = TouchAction(driver)
a1.press(el1).move_to(el2).release()
a2 = TouchAction(driver)
a2.press(el2).move_to(el1).release()
MultiAction(driver).add(a1, a2)
json_wire_gestures¶perform() → T¶Perform the actions stored in the object.
a1 = TouchAction(driver)
a1.press(el1).move_to(el2).release()
a2 = TouchAction(driver)
a2.press(el2).move_to(el1).release()
MultiAction(driver).add(a1, a2).perform()
webdriver.common.touch_action.TouchAction(driver: Optional[WebDriver] = None)¶Bases: object
json_wire_gestures¶long_press(el: Optional[WebElement] = None, x: Optional[int] = None, y: Optional[int] = None, duration: int = 1000) → T¶Begin a chain with a press down that lasts duration milliseconds
el (appium.webdriver.webelement.WebElement, optional) – the element to press
x (int, optional) – x coordiate to press. If y is used, x must also be set
y (int, optional) – y coordiate to press. If x is used, y must also be set
duration (int, optional) – Duration to press
self instance
TouchAction
move_to(el: Optional[WebElement] = None, x: Optional[int] = None, y: Optional[int] = None) → T¶Move the pointer from the previous point to the element or point specified
el (appium.webdriver.webelement.WebElement, optional) – the element to be moved to
x (int, optional) – x coordiate to be moved to. If y is used, x must also be set
y (int, optional) – y coordiate to be moved to. If x is used, y must also be set
self instance
TouchAction
perform() → T¶Perform the action by sending the commands to the server to be operated upon
self instance
TouchAction
press(el: Optional[WebElement] = None, x: Optional[int] = None, y: Optional[int] = None, pressure: Optional[float] = None) → T¶Begin a chain with a press down action at a particular element or point
el (appium.webdriver.webelement.WebElement, optional) – the element to press
x (int, optional) – x coordiate to press. If y is used, x must also be set
y (int, optional) – y coordiate to press. If x is used, y must also be set
pressure (float, optional) – [iOS Only] press as force touch. Read the description of force property on Apple’s UITouch class
(https://developer.apple.com/documentation/uikit/uitouch?language=objc) for more details on possible value ranges.
self instance
TouchAction
release() → T¶End the action by lifting the pointer off the screen
self instance
TouchAction
tap(element: Optional[WebElement] = None, x: Optional[int] = None, y: Optional[int] = None, count: int = 1) → T¶Perform a tap action on the element
element (appium.webdriver.webelement.WebElement) – the element to tap
x (int, optional) – x coordinate to tap, relative to the top left corner of the element.
y (int, optional) – y coordinate. If y is used, x must also be set, and vice versa
self instance
TouchAction
wait(ms: int = 0) → T¶Pause for ms milliseconds.
ms (int) – The time to pause
self instance
TouchAction
Appium Python Client: WebDriver common classes