Enter text intoTextbox in WebDriver
In Selenium we have sendkeys() method of Webdriver Interface for Typing in textbox of username and password.
sendKeys()- This method will accept string as an argument whatever text you will specify it will type into that textbox.
//Here is the code for textbox
package test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Facebook {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://facebook.com");
//Enter the text into emailaddress
driver.findElement(By.xpath("//*[@id='Email']")).sendKeys("ritu7180@gmail.com");
//Enter the text into password Filled
driver.findElement(By.xpath("//*[@id='Passwd']")).sendKeys("password");
}
}




