enter image description here below is the HTML for date input field.i am unable to inspect the calendar.
If you want to check whether DatePicker is present or not, pass the locator of the title of the DatePicker (ex:month name) and use an if condition
// Validate the title, so that you can find whether the date picker is present or not
if(monthname.isdisPlayed()) {
....
}
First, find what type of date picker is it.. If it's jQuery date picker you can inspect and handle it.
The calendar shown in the image below is a jQuery date picker:
If all you want to do is to send keys
to that input field:
driver.findElement(By.id("enddate")).sendKeys("02/03/2005");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.