You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In trying to dismiss the soft keyboard after a .clear() without resetting the session's keyboard setting (i.e. hide_keyboard is a no go), I thought I'd be clever and use TouchAction like this to tap just outside of the element that had displayed the soft keyboard:
def dismiss_keyboard(element):
elem_x = element.location['x']
elem_y = element.location['y']
# Find average x-value between left edge of app and left edge of element
benign_x = (elem_x - 0) / 2
# Tap between element and edge of app to dismiss soft keyboard
action = TouchAction(self.driver)
action.move_to(
benign_x, elem_y).press(
x=benign_x, y=elem_y).release().perform()
But, of course, not clever, because both press() and tap() require an element:
Traceback (most recent call last):
File "/Users/kraymoure/repos/r64/qa/tests/mobile/test_ios_environments.py", line 53, in setUp
self.clear_search()
File "/Users/kraymoure/repos/r64/qa/tests/mobile/ios_base.py", line 272, in clear_search
self.dismiss_soft_keyboard(search_input)
File "/Users/kraymoure/repos/r64/qa/tests/mobile/ios_base.py", line 295, in dismiss_soft_keyboard
benign_x, search_y).press(
File "/Library/Python/2.7/site-packages/appium/webdriver/common/touch_action.py", line 79, in move_to
self._add_action('moveTo', self._get_opts(el, x, y))
File "/Library/Python/2.7/site-packages/appium/webdriver/common/touch_action.py", line 118, in _get_opts
opts['element'] = element.id
AttributeError: 'int' object has no attribute 'id'
The text was updated successfully, but these errors were encountered:
In trying to dismiss the soft keyboard after a
.clear()
without resetting the session's keyboard setting (i.e.hide_keyboard
is a no go), I thought I'd be clever and useTouchAction
like this to tap just outside of the element that had displayed the soft keyboard:But, of course, not clever, because both press() and tap() require an element:
The text was updated successfully, but these errors were encountered: