-
Notifications
You must be signed in to change notification settings - Fork 3.4k
datepicker: send keys in Protractor test #10404
Comments
Yeah im having a same issue. Would be great to get some feedback on this. |
+1 bower.json :
|
Found the solution: element.all(by.css('.md-datepicker-input')).get(0).click().sendKeys('10/16/1947'); |
Just to clear this issue up for everyone getting it.
Still fixing this issue for myself as well (by getting the correct xpath from the known location of the |
That didn't work for me, instead I used something like this: element(by.css('#myDate input')).click().clear().sendKeys('10-03-2019'); |
For me it worked with the standard date format i.e.
|
This works for me. Idea is to reach the year selection, navigate to an year and hit enter 3 times.
For your reference, my HTML code, if applicable:
|
@ravindranathakila Angular Material and CDK questions are handled here and issues here. This repo is for AngularJS Material. |
I have an angular app and I would like to test that a user always enters a valid date of birth in a form.I am using a date picker:
(md-datepicker class="inputForm" id="myDate" name="dateField" required md-min-date="minDate" md-max-date="maxDate" > /md-datepicker>
I am trying to use the sendkeys() function in protractor to set a value for the date but it doesn't work:
var today = new Date();
var date = element(by.id('myDate')).sendKeys(today);
When I run the test nothing happens?Any ideas?
The text was updated successfully, but these errors were encountered: