Dismiss iOS keypad using Java

165 Views Asked by At

Need advise on how I can dismiss the keypad on iOS as I need to access an element below it.

I tried

driver.hideKeyboard();
driver.getKeyboard().sendKeys(Keys.RETURN);
driver.getKeyboard().sendKeys(Keys.CANCEL);
driver.getKeyboard().sendKeys(Keys.ENTER);

but all in vain.

I also tried scrollDown()

which is basically this code:

JavascriptExecutor js = (JavascriptExecutor) driver; HashMap scrollObject = new HashMap(); scrollObject.put("direction", "down"); js.executeScript("mobile: scroll", scrollObject);

and when I do this something weird thing like this happens keys 'e' gets typed.

Attaching GIF For your reference.

http://g.recordit.co/2WeVI3m6KM.gif

Any advise on this would be super great. Thanks.

0

There are 0 best solutions below