Native Input Events with typeKeys

Prev Next

In some cases, typing into text fields does not produce the desired effect since certain JavaScript events are not triggered.

To properly use native input events, you must first click the mouse on the input field and wait for the field to respond. Then, issue the typeKeys verb to emulate typing each character into the input field.

Example:

// Step - 1
open(http://www.example.com/login)
clickMouse(//input[@name='username'])
pause(250)
typeKeys(//input[@name='username'], 'catchpoint')
clickMouse(//input[@name='password'])
pause(250)
typeKeys(//input[@name='password'], 'rocks')

// Step - 2
clickMouseAndWait(//*[@name='submit'])