@@ -43,6 +43,7 @@ def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub',
4343
4444 # add new method to the `find_by_*` pantheon
4545 By .IOS_UIAUTOMATION = MobileBy .IOS_UIAUTOMATION
46+ By .IOS_PREDICATE = MobileBy .IOS_PREDICATE
4647 By .ANDROID_UIAUTOMATOR = MobileBy .ANDROID_UIAUTOMATOR
4748 By .ACCESSIBILITY_ID = MobileBy .ACCESSIBILITY_ID
4849
@@ -98,6 +99,28 @@ def find_elements_by_ios_uiautomation(self, uia_string):
9899 """
99100 return self .find_elements (by = By .IOS_UIAUTOMATION , value = uia_string )
100101
102+ def find_element_by_ios_predicate (self , predicate_string ):
103+ """Find an element by ios predicate string.
104+
105+ :Args:
106+ - predicate_string - The predicate string
107+
108+ :Usage:
109+ driver.find_element_by_ios_predicate('label == "myLabel"')
110+ """
111+ return self .find_element (by = By .IOS_PREDICATE , value = predicate_string )
112+
113+ def find_elements_by_ios_predicate (self , predicate_string ):
114+ """Finds elements by ios predicate string.
115+
116+ :Args:
117+ - predicate_string - The predicate string
118+
119+ :Usage:
120+ driver.find_elements_by_ios_predicate('label == "myLabel"')
121+ """
122+ return self .find_elements (by = By .IOS_PREDICATE , value = predicate_string )
123+
101124 def find_element_by_android_uiautomator (self , uia_string ):
102125 """Finds element by uiautomator in Android.
103126
@@ -829,3 +852,5 @@ def _addCommands(self):
829852 ('GET' , '/session/$sessionId/element/$id/location_in_view' )
830853 self .command_executor ._commands [Command .GET_DEVICE_TIME ] = \
831854 ('GET' , '/session/$sessionId/appium/device/system_time' )
855+ self .command_executor ._commands [Command .CLEAR ] = \
856+ ('POST' , '/session/$sessionId/element/$id/clear' )
0 commit comments