Category:
Selenium WebDriver
Selenium already provides Select class that has some predefined method which help is a lot while working with Dropdown.
WebElement month_dropdown=driver.findElement(By.id(“month”));
Select month=new Select(month_dropdown);
month.selectByIndex(4);
month.selectByValue(“5”);
month.selectByVisibleText("Aug");