Faceing issue with date selection from date picker
Faceing issue with date selection from date picker
M
Posted on 10/05/2016
Hi ,
I need to select current date from date picker and no need to go back or forward in calendar. I am following video15 and part3 but as per video its ok but for my current project date is not selecting.
xpath: <td class="today active day">11</td> firebug :html/body/div[5]/div[1]/table/tbody/tr[3]/td[4]
As per that code is as below //click on date picker
public static void selectDate(String date) throws ParseException{ SimpleDateFormat df=new SimpleDateFormat("dd-MM-yyyy"); Date dateToBeSelect=df.parse(date); Date currentDate=new Date(); System.out.println("current date is "+currentDate);
String monthYearToBeSelected=month+ " " +year; System.out.println(monthYearToBeSelected); //Current date to be select driver.findElement(By.xpath("//*td[@class='today active day']")).click();