For security reasons, Apple does not allow direct access to the iOS keyboard. This release introduces the ability to remotely access device keyboards by generating Virtual keyboards that replicate the characteristics of the native ones. Additionally, these keyboards can be shared with Ranorex Spy for further testing and automation.
The following three UI controls, commonly used by iOS applications, are now supported:
- TextField
- TextView
- SearchBar
Supported Keyboards
The Virtual Keyboard supports the following languages:
- en-US
- en-GB
- es-ES
- de-DE
- fr-FR
To use a specific language, ensure it is installed on your device or simulator. You can do this by navigating to Settings > General > Keyboard and selecting Add New Keyboard.
This new feature supports six different keyboard types:
- KeyboardTypeDefault
- KeyboardTypeNumbersAndPunctuation
- KeyboardTypeNumberPad
- KeyboardTypeEmailAddress
- KeyboardTypePhonePad
- KeyboardTypeDecimalPad
Refresh Ranorex Spy to Detect Changes
To begin, open Ranorex Spy and follow these instructions on how to refresh Ranorex Spy to see the changes you perform.
- Tap a TextField to bring up the system keyboard (this works on a simulator, device, or in Spy).
- In Ranorex Spy, click the Refresh button.
- Under the UIWindow container, a new Keyboard view will appear. Select this to see the Keyboard in the Spy render view.
Important Notes for Using the Virtual Keyboard
Here are some notes that are important to consider when using a Virtual Keyboard:
- When switching between alphabetic and numeric keyboard layouts, always use the 123 button on the Virtual Keyboard to perform this action. Changing the keyboard layout directly on the device will not be reflected in Ranorex Spy.
- To use the Shift key, select the Shift option from the virtual keyboard, then refresh Spy. This updates all letters to uppercase or lowercase. Using the Shift option from the device keyboard will not reflect in Spy.
- To display special symbols, use the #+= option on the virtual keyboard. Special symbols entered using the device keyboard with this option will not appear in Ranorex Spy.
- The Return key on the virtual keyboard is used to dismiss the keyboard. It will close the device keyboard as well. After refreshing Spy, the keyboard view will no longer be visible.
- If a device screen contains multiple input fields and you switch from one to another, you must refresh Spy to update the keyboard type for the input field, to ensure the active field is correctly identified in Ranorex Spy.
- Virtual keyboard letters should be clicked on the selection of letter button, not letter title.
Virtual Keyboard in Automation Testing
To use Virtual Keyboard keys in automation testing or if you want to add to the Repository, use the drag and drop mechanism to add keys to the repository, and from there, add a touch action to the recording script, as any other component.