.typeText(text)
Using the virtual keyboard, types the given text into a text element.
Usage
element(matcher).typeText(text)
Parameters
text(String): Text to type.
Returns
Element: A new element to avoid mutation and allow function chaining.
Support
| Platform | Supported |
|---|---|
| iOS | Yes |
| Android | Yes |
| Web | Yes |
Examples
Basic text input.
const { element, by } = require("appdriver");
(async () => {
await element(by.label("text-input"))
.typeText("Hello World!");
})();
Known Issues
- iOS simulators fail to input text when the hardware keyboard is connected. Ensure
Hardware > Keyboard > Connect Hardware Keyboardis unchecked.