-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgmail.java
34 lines (30 loc) · 888 Bytes
/
gmail.java
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
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.firefox.FirefoxDriver;
public class gmail
{
FirefoxDriver driver;
public void open()
{
driver=new FirefoxDriver();
driver.manage().window().maximize();
driver.get("http://www.gmail.com");
}
public void login() throws InterruptedException
{
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.findElement(By.name("Email")).sendKeys("");
driver.findElement(By.name("signIn")).click();
driver.findElement(By.name("Passwd")).sendKeys("");
driver.findElement(By.id("signIn")).click();
Thread.sleep(3000);
driver.findElement(By.cssSelector("span.gb_Ka.gbii")).click();
driver.findElement(By.id("gb_71")).click();
}
public static void main(String[] args) throws InterruptedException
{
gmail y=new gmail();
y.open();
y.login();
}
}