every date picker format is not the same but try this
[quote:2a4d4ame]
DateFormat dateFormat2 = new SimpleDateFormat("dd");
Date date2 = new Date();
String today = dateFormat2.format(date2);
//find the calendar
WebElement dateWidget = driver.findElement(By.id("dp-calendar"));
List<WebElement> columns=dateWidget.findElements(By.tagName("td"));
//comparing the text of cell with today's date and clicking it.
for (WebElement cell : columns)
{
if (cell.getText().equals(today))
{
cell.click();
break;
}
}[/quote:2a4d4ame]
Hi,
I m using the date picker of "https://www.cathaypacific.com".
the code which u have given works only for today's date.
i want to select any from and return date.
Please help me on it.
for that I think you have to use actions class.
but I don't have any working code for that.