Appium 1.5.1 + Python + iOS, hide_keyboard failed, returns invalid key

Configuration:
Appium 1.5.1, python 2.7.10, real device(iPhone 5, version iOS 9.1), Xcode 7.3

key python script:
driver.hide_keyboard(key=‘Done’)

appium log:

device shotcut:

Any suggestion is appreciated! :slight_smile:

Hi,

Generally in java language for hiding a keyboard, we use driver.hideKeyboard();
Other possible way is : You can click on <- at the top (or) try to navigate back by using function if any for iOS.

Regards,
Bhaskar.

you can use following code:
EventFiringWebDriver sExecutor = new EventFiringWebDriver(Driver);
sExecutor.ececuteScript(“UIATarget.localTraget.frontMostApp.keyboard.buttons()[“Hide Keyboard”.tap();”);

Same worked for me.

Sorry It is for Java. if python library have EventFiringWebDriver then same can be used or you can try with iosuiautomation to get hide button key element and perfrom tap action.

met with same issue!

funnies of this is that “Done” key in this case is something like “Done:” :slight_smile:

do check:

  • when keyboard opened in such case wait 3 sec for sure
  • now print you page source into console ( e.g. System.out.println(driver.getPageSource()) )
  • check here what is real name of “Done”
1 Like

OK I’ll try. Thank you @Aleksei.

I’m afraid python has no EventFiringWebDriver, anyway, thanks for your advice. @lakhani.nimesh

Hi,
I use Appium 1.5.3 on IOS
the code that works to me is:
MobileElement me = (MobileElement)iosDriver.findElementsByAccessibilityId(“Next:”).get(0);
me.tap(1,0);

Hope i help.