package examples;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Gmail_Login {
public static void main(String[] args) throws Exception {
System.setProperty("webdriver.chrome.driver", "E:\\chromedriver_win32\\chromedriver.exe");
WebDriver driver= new ChromeDriver();
driver.manage().window().maximize();
driver.get("
https://accounts.google.com/signin");
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.findElement(By.id("identifierId")).sendKeys("mail@gmail.com");
driver.findElement(By.xpath("//span[text()='Next']")).click();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.findElement(By.xpath("//input[@name='password']")).sendKeys("test@123");
driver.findElement(By.id("passwordNext")).click();
driver.findElement(By.xpath("//a[@class='gb_D']")).click();
Thread.sleep(3000);
driver.findElement(By.xpath("/html/body/div[2]/header/div[2]/div[4]/ul[1]/li[7]/a/span[2]")).click();
Thread.sleep(3000);
driver.close();
}
}