How to hide keyboard without closing the dialog box using Appium for IOS?

随声附和 提交于 2020-01-03 04:56:19

问题


I have a dialog box that appears and while closing keyboard with hideKeyboard(); all the form is closed and i get back to the home page so that i can't continue the scenario for filling other data.

Here the screen :


回答1:


Just use UIScrollView in your dialog box, and set scroll view class TPKAScrollViewController. Download class




回答2:


You can fill up the fields first using driver.sendkey() then tap on keyboard next button to switch the driver to the next field untill the last field. in last field you will get done button then you can tap on that button.




回答3:


The default "strategy" of hideKeyboard(); is to tap outside the keyboard, but this can be changed to pressing a key on the keyboard instead.

See the java-client documentation (assuming you're using java-client?) for available hideKeyboard strategies: http://appium.github.io/java-client/io/appium/java_client/ios/IOSDeviceActionShortcuts.html

If your app's keyboard has for example a "Next" button to close the keyboard with, then you could use: driver.hideKeyboard("Next");



来源:https://stackoverflow.com/questions/39294659/how-to-hide-keyboard-without-closing-the-dialog-box-using-appium-for-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!