The sendKeys method

This is used to type in alphanumeric and special character keys into WebElements such as textbox, textarea, and so on. This is different than the WebElement.sendKeys(CharSequence keysToSend) method, as this method expects the WebElements to have the focus before being called. The API syntax for the sendkeys() method is as follows:

public Actions sendKeys(CharSequence keysToSend)

We expect you to implement a couple of test scripts around these keyboard events using the keyUp, keyDown, and sendKeys() methods.

Get Selenium WebDriver 3 Practical Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.