I am unable to Verify Previous Month arrow should not be present in DatePicker but as it is not present in DOM getting Exception unable to find Such Exception.
void fillDepartureDate() {
// Date Text
// driver.findElement(By.xpath("//input[@id='departureCalendar']"));
wait = new WebDriverWait(driver, 10);
wait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.xpath("//div[@role='application']")));
// Validate prev Arrow in current month
//Assert.assertFalse(driver.findElement(By.xpath("//div[@class='DayPicker-NavBar']/span[contains(@class,'prev')]")).isDisplayed());
// Validate Current month and Year September 2020
Date dateObj = getCurrentDateObj();
DateFormat month = new SimpleDateFormat("MMMM" + " " + "y"); // September 2020
String actualCurrentMonthYear = driver.findElement(By.xpath("//div[@class='DayPicker-Caption']")).getText();
Assert.assertEquals(actualCurrentMonthYear, month.format(dateObj));
//weekdays Validation
calendarWeekdaysValidation();
// Creating customize Id for selecting current date
DateFormat date = new SimpleDateFormat("YMMdd");
String selectDate = "fare_" + date.format(dateObj);
// Fill Current date
DateFormat expectedPopulatedDateValue = new SimpleDateFormat("d MMM");
driver.findElement(By.xpath("//div[@id=\'" + selectDate + "\']")).click();
//Verifying selected date should be populated in field
String populatedDateValue = driver.findElement(By.xpath("//input[@id='departureCalendar']")).getAttribute("value");
Assert.assertTrue(populatedDateValue.contains(expectedPopulatedDateValue.format(dateObj)));
}