How to dismiss the keyboard in appium IOS

Hi all am facing an issue to dismiss or hide the keyboard in ios automation using appium and when i use name like “driver.findElement(By.name(“Done”));” am getting an error like “Locator Strategy ‘name’ is not supported for this session”. can any one please solve my issue.

Am using

  • appium version - 1.5.3

  • I used java-client-4.0.0.jar files for IOS

  • I used these lines in my script but i am getting an error, driver2.getKeyboard().sendKeys(Keys.ENTER);
    driver2.hideKeyboard();

By.name strategy was depreciated in Appium 1.5. I’ve read that it is back in 1.6, but may not be working quite right yet.