-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment132_.java
More file actions
37 lines (20 loc) · 981 Bytes
/
Assignment132_.java
File metadata and controls
37 lines (20 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package BasicsSelenium;
//Login Face book with Firefox Browser
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
//WAP to login to facebook ?
public class Assignment132_ {
public static void main(String[] args) {
FirefoxDriver driver = new FirefoxDriver(); // Launching Firefox
driver.get("https://www.facebook.com/"); // loading a web page or url
driver.manage().window().maximize(); // max the tab
WebElement username = driver.findElement(By.name("email")); // findelement and locate value
username.sendKeys("abhilash.var5@gmail.com"); // sending the values to locater
WebElement Password = driver.findElement(By.name("pass")); //// findelement and locate value
Password.sendKeys("Password");
WebElement login = driver.findElement(By.name("login")); // findelement and locate value
login.click(); // click the login with the help of refrencevariable
driver.quit();
}
}