【问题标题】:driver.hideKeyboard(); is not available on iOS but I am able to use it on Android and its working finedriver.hideKeyboard();在 iOS 上不可用,但我可以在 Android 上使用它并且工作正常
【发布时间】:2020-04-28 23:07:37
【问题描述】:

在安卓上运行良好

submitEmail(email) {
this.emailInPutField.click();
this.emailInPutField.setValue(email);
driver.hideKeyboard();
this.confirmButton.click();

}

但是当我想对 iOS 使用相同的功能时,它无法为驱动程序提供选项。

【问题讨论】:

    标签: node.js webdriver appium appium-ios


    【解决方案1】:

    你可以试试这个:

    IOSDriver< WebElement> AD= (IOSDriver) driver;
    AD.getKeyboard().sendKeys(Keys.RETURN);
    

    注意:如果您在多行输入字段内,它将不起作用

    【讨论】:

    • 驱动功能本身没有出现。当我编写驱动程序时,它会替换为 webdriver。但在 Android 上它工作得非常好。我不明白为什么。
    • 你是如何访问驱动实例的?
    • 我想用这个driver.hideKeyboard();但是当我写驱动程序时什么都没有出现。
    • 请尝试我提到的解决方案
    • 错误 ReferenceError: Keys is not defined
    猜你喜欢
    • 1970-01-01
    • 2012-07-26
    • 2020-04-02
    • 2016-08-14
    • 1970-01-01
    • 2019-06-16
    • 2020-07-31
    • 2012-04-17
    • 1970-01-01
    相关资源
    最近更新 更多