Nihal Alfred
Nihal Alfred

Reputation: 31

Dismiss iOS keypad using Java

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.

Upvotes: 0

Views: 159

Answers (0)

Related Questions