how to pick date from datepicker in selenium

Solutions on MaxInterview for how to pick date from datepicker in selenium by the best coders in the world

showing results for - "how to pick date from datepicker in selenium"
Leon
09 Aug 2019
1((JavascriptExecutor)driver).executeScript("document.getElementById('fromDate').setAttribute('value','10 Jan 2013')")
2
Eric
11 Mar 2016
1((JavascriptExecutor)driver).executeScript ("document.getElementById('fromDate').removeAttribute('readonly',0);"); // Enables the from date box
2
3WebElement fromDateBox= driver.findElement(By.id("fromDate"));
4fromDateBox.clear();
5fromDateBox.sendKeys("8-Dec-2014"); //Enter date in required format
6