Search⌘ K

Entering Text Into Text Fields and Text Areas

Learn how you can interact with the text fields using Selenium, and try them out yourself.

Enter text into a text field by name

We can add text into a text field with the following command:

driver.findElement(By.name("username")).sendKeys("agileway");

Here, the name attribute is the identification used by the programmers to ...