Google+

Using Selenium Test Automation - Create a google account by providing all the details

The below is the problem and solution code for creating a google account by providing all the details from Name to Locations fields.

Problem:



Solution:

public class Demo {
 
 public static void main(String[] args) {
  
       WebDriver driver = new FirefoxDriver();
  
       driver.manage().window().maximize();
  
       driver.get("https://accounts.google.com/SignUp");
  
       driver.findElement(By.id("FirstName")).sendKeys("Selenium");
       driver.findElement(By.id("LastName")).sendKeys("ByArun");
       driver.findElement(By.id("GmailAddress")).sendKeys("SeleniumByArunDemoThree");
       driver.findElement(By.id("Passwd")).sendKeys("DemoPassword");
       driver.findElement(By.id("PasswdAgain")).sendKeys("DemoPassword");
       driver.findElement(By.cssSelector("div[title='Birthday']")).sendKeys("March");
       driver.findElement(By.id("BirthDay")).sendKeys("12");
       driver.findElement(By.id("BirthYear")).sendKeys("1990");
       driver.findElement(By.cssSelector(" div[title='Gender']")).sendKeys("Male");
       driver.findElement(By.id("RecoveryPhoneNumber")).sendKeys("9123455432");
       driver.findElement(By.id("RecoveryEmailAddress")).sendKeys("seleniumtraining11292017@gmail.com");
       driver.findElement(By.cssSelector("#CountryCode div[title='Location']")).sendKeys("India");
  
 }

}

No comments: