Is it possible to “toggle software keyboard” via the code in UI test?

前端 未结 7 626
时光取名叫无心
时光取名叫无心 2020-12-24 03:25

I have UI tests which testing login functionality (and uses it to test other stuff), but sometimes when focus is changed from one field to another - the keyboard hides, and

7条回答
  •  借酒劲吻你
    2020-12-24 04:12

    For Xcode 10.2, none of these solutions work for me, the plist is changed correctly but keyboard is till hidden. I have to use oascript to press Ctrl + Shift + K on Simulator if the keyboard is not displayed. It's not beauty but it's the only workaround that works.

    tell application "Simulator" to activate
    tell application "System Events"
        keystroke "K" using {command down, shift down}
    end tell
    

提交回复
热议问题