问题
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