This code just aims to find the textbox and send some text to it. When it does that the keyboard appears on the android device.How to dismiss it after the sendKeys.
@Test
public static void test_demo() throws Exception {
WebElement element = driver.findElement(By.id("mytextfield"));
element.sendKeys("test");
//how do I dismiss keyboard which appears on my android device after sendKeys?
}
Add these desired capabilities values if you want to disable the keyboard on your android selenium tests.
capabilities.setCapability("unicodeKeyboard", true);
capabilities.setCapability("resetKeyboard", true);
driver.hideKeyboard()
will only work with AppiumDriver
.
I am using java-client-2.2.0.jar that contains this capability.
Best way is to use the back button.
driver.navigate().back(); // For older version of appium
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With