yahoo registration, select country code, webdriver, select class

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;


public class yahoo_reg
{   
    public static void main(String[] args) throws Exception
    {
             ////////create object for FirefoxDriver and get the URL
      FirefoxDriver fd=new FirefoxDriver();
      fd.get("http://www.yahoomail.com");
      fd.findElement(By.id("signUpBtn")).click();  ///click on signUp Button
      Thread.sleep(5000);
      fd.findElement(By.id("first-name")).sendKeys("abcddfd");  ///input firstname, lastname
      fd.findElement(By.id("last-name")).sendKeys("xdfdfdf");
     
     
     
      fd.findElement(By.id("selected-country-code-1")).click();  ////click country code
      Thread.sleep(2000);
      fd.findElement(By.xpath("//*[@id='country-codes-menu-1']/ul/li[14]")).click(); //select country
      Thread.sleep(2000);
      fd.findElement(By.id("mobile")).sendKeys("12345666");
      new Select(fd.findElement(By.id("month"))).selectByVisibleText("March"); //select month
      new Select(fd.findElement(By.id("day"))).selectByVisibleText("20");   //select day
      new Select(fd.findElement(By.id("year"))).selectByVisibleText("1982");  //select year
      Thread.sleep(3000);
      fd.findElement(By.id("female")).click();
     
    }

}

Comments