0 votes
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(“[email protected]”);  - 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

Related questions

0 votes
asked Aug 19, 2019 in Selenium by rahulsharma
0 votes
asked Aug 19, 2019 in Selenium by rahulsharma
...