Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions appium/webdriver/common/mobileby.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ class MobileBy(By):
ANDROID_VIEWTAG = '-android viewtag'
ACCESSIBILITY_ID = 'accessibility id'
IMAGE = '-image'
CUSTOM = '-custom'
29 changes: 29 additions & 0 deletions appium/webdriver/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
By.ANDROID_VIEWTAG = MobileBy.ANDROID_VIEWTAG
By.ACCESSIBILITY_ID = MobileBy.ACCESSIBILITY_ID
By.IMAGE = MobileBy.IMAGE
By.CUSTOM = MobileBy.CUSTOM

def start_session(self, capabilities, browser_profile=None):
"""
Expand Down Expand Up @@ -416,6 +417,34 @@ def find_elements_by_accessibility_id(self, accessibility_id):
"""
return self.find_elements(by=By.ACCESSIBILITY_ID, value=accessibility_id)

def find_element_by_custom(self, selector):
"""Finds an element in conjunction with a custom element finding plugin

:Args:
- selector - a string of the form "module:selector", where "module" is
the shortcut name given in the customFindModules capability, and
"selector" is the string that will be passed to the custom element
finding plugin itself

:Usage:
driver.find_element_by_custom("foo:bar")
"""
return self.find_element(by=By.CUSTOM, value=selector)

def find_elements_by_custom(self, selector):
"""Finds elements in conjunction with a custom element finding plugin

:Args:
- selector - a string of the form "module:selector", where "module" is
the shortcut name given in the customFindModules capability, and
"selector" is the string that will be passed to the custom element
finding plugin itself

:Usage:
driver.find_elements_by_custom("foo:bar")
"""
return self.find_elements(by=By.CUSTOM, value=selector)

def create_web_element(self, element_id):
"""
Creates a web element with the specified element_id.
Expand Down