in Selenium by
How to type text in an input box using Selenium?

1 Answer

0 votes
by

sendKeys() is the method used to type text in input boxes 

Consider the following example - 

  WebElement email = driver.findElement(By.id(“email”)); - Finds the “email” text using the ID locator

  email.sendKeys(“abcd.efgh@gmail.com”);  - Enters text into the URL field

  WebElement password = driver.findElement(By.id(“Password”)); - Finds the “password” text using the ID locator

  password.sendKeys(“abcdefgh123”); - Enters text into the password field

...