How to dismiss the keyboard in appium using Java?

后端 未结 8 1360
梦如初夏
梦如初夏 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:55

    Please use Appium 1.0

    Add libraries or add maven dependency of Appium Java client:

    <dependency>
      <groupId>io.appium</groupId>
      <artifactId>java-client</artifactId>
      <version>1.1.0</version>
    </dependency>
    

    Create driver instance in the following way:

    AppiumDriver driver=null;
    driver= new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
    

    And use the following function to hide the keyboard:

    driver.hideKeyboard();
    
    0 讨论(0)
  • 2021-01-02 03:59
    capabilities.setCapability("unicodeKeyboard", true);
    capabilities.setCapability("resetKeyboard", true);
    

    Still works with 1.7.2 and assuming 1.8

    0 讨论(0)
提交回复
热议问题