Here is simple program to fill email id and password in facebook page.
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class MyClass2 {
public static void main(String[] args) {
System.setProperty(""webdriver.chrome.driver"",""C:\\Users\\Desk-105\\Documents\\SELENIUM\\chromedriver.exe"");
WebDriver driver = new ChromeDriver();
String baseUrl = ""http://www.facebook.com"";
driver.get(baseUrl);
WebElement email = driver.findElement(By.id(""email""));
email.sendKeys(""namo@onlinetutorial.com"");
WebElement pwd = driver.findElement(By.id(""pass""));
pwd.sendKeys(""12345678"");
}
}
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class MyClass2 {
public static void main(String[] args) {
System.setProperty(""webdriver.chrome.driver"",""C:\\Users\\Desk-105\\Documents\\SELENIUM\\chromedriver.exe"");
WebDriver driver = new ChromeDriver();
String baseUrl = ""http://www.facebook.com"";
driver.get(baseUrl);
WebElement email = driver.findElement(By.id(""email""));
email.sendKeys(""namo@onlinetutorial.com"");
WebElement pwd = driver.findElement(By.id(""pass""));
pwd.sendKeys(""12345678"");
}
}
No comments:
Post a Comment