Java automation login

  import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

import static java.lang.System.out;
public class checkP1 {
private static Object Assert;

public static void main(String args[]){
out.println("Ranjit");

// Path of chrome driver
// that will be local directory path passed
System.setProperty(
"webdriver.chrome.driver",
"C:\\Users\\ranjit\\Downloads\\chromedriver.exe");
WebDriver driver = new ChromeDriver();

// URL of the login website that is tested
driver.get("https://gmail-login-user.blogspot.com/");

// Maximize window size of browser
driver.manage().window().maximize();

// Enter your login email id
driver.findElement(By.id("Name"))
.sendKeys("xyz@gmail.com");

// Enter your login password
driver.findElement(By.id("Disc"))
.sendKeys("xyz12345");

driver.findElement(By.className("next"))
.click();

}
}


Ranjit Patil

Ranjit is a passionate engineer specializing in AI/ML, Java, and Spring Boot. He loves talking about technology and is endlessly curious about the creation of the universe.

Post a Comment

comment here

Previous Post Next Post