1
2 <label for="birthday">Birthday:</label>
3<input type="date"
4 id="birthday" name="birthday">
5
1<!doctype html>
2<html lang="en">
3<head>
4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 <title>jQuery UI Datepicker - Default functionality</title>
7 <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
8 <link rel="stylesheet" href="/resources/demos/style.css">
9 <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
10 <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
11 <script>
12
13 </script>
14</head>
15<body>
16
17<p>Date: <input type="text" id="datepicker"></p>
18
19
20</body>
21</html>
22
1Some date pickers allow you to type. In this case we can
2just use sendKeys method to enter the date we want.
3
4If that does not work, we need to write our logic
5for this using java and selenium.
61. Click on the field to trigger the date picker
72. Get the displayed date on the date picker and calculate
8how many times you need to click left/right
9to go to the right month/year.
103. Once we go to the correct month/year, select the date.