How to dismiss the keyboard in appium using Java?

后端 未结 8 1359
梦如初夏
梦如初夏 2021-01-02 03:02

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.

相关标签:
8条回答
  • 2021-01-02 03:34

    driver.hideKeyboard() will only work with AppiumDriver. I am using java-client-2.2.0.jar that contains this capability.

    0 讨论(0)
  • 2021-01-02 03:40
    public static AndroidDriver driver= null;
    ......
    
    driver.hideKeyboard();
    

    will works perfectly based from my experience

    0 讨论(0)
  • 2021-01-02 03:42

    Solution for those who are not using AppiumDriver:

    ((AppiumDriver)driver).hideKeyboard(); 
    
    0 讨论(0)
  • 2021-01-02 03:46

    Best way is to use the back button.

    driver.navigate().back(); // For older version of appium
    
    0 讨论(0)
  • 2021-01-02 03:46

    I use driver.hideKeyboard(); every time I'm using sendKeys() to type something. Works perfectly for me.

    0 讨论(0)
  • 2021-01-02 03:54

    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);
    
    0 讨论(0)
提交回复
热议问题