Open Bug 1420888 Opened 6 years ago Updated 7 months ago

WebDriver:SendKeysToElement support for non-typeable form controls (date, color, ...)


(Remote Protocol :: Marionette, defect, P3)



(Not tracked)


(Reporter: whimboo, Unassigned)


(Blocks 2 open bugs)


(Whiteboard: [webdriver:backlog])

The remote end steps of Element Send Keys requires us to handle specific elements differently. Those steps haven't been added yet.

> 10. Run the substeps of the first matching condition: 

* element is an input element whose type attribute is File. 

* The user agent renders element as something other than a text input control (for example an input element in the color state being presented as a colorwheel): 

* element is content editable
Similarly there are a few other “HTML5” form controls we need to
handle, such as <input type=color>.  We already handle <input
type=date> and <input type=time> through interaction.setFormControlValue.
Priority: -- → P2
Summary: Add support to Send Keys for special elements (date, file, contenteditable) → Add support to Element Send Keys for <input type=date> and <input type=color>
Hm, we already have that code in place for content:

What we should do is clearly to move the call of `setFormControlValue()` to after the interactability checks as being worked on in bug 1414322. Otherwise not sure yet what else is broken.
Depends on: 1414322
Blocks: webdriver
OS: Unspecified → All
Hardware: Unspecified → All
Version: 56 Branch → Trunk
Summary: Add support to Element Send Keys for <input type=date> and <input type=color> → WebDriver:SendKeysToElement support for <input type=date> and <input type=color>
Severity: normal → S3
Product: Testing → Remote Protocol
  1. input elements of type date only work when a ISO compatible date like 2023-05-03 has been specified. It doesn't work with formats like 03.05.2023. I'm not sure if that is expected or not given that nothing in the WebDriver classic specification actually points out this requirement. But other browsers like Chrome seem to also support other formats. Maybe we have to try to read the date string and convert to ISO internally before setting the value?

  2. color and other types of non-typeable form control's are not implemented right now. There is only date and time right now.

Lets discuss in next week's triage meeting in how to prioritize this bug.

Summary: WebDriver:SendKeysToElement support for <input type=date> and <input type=color> → WebDriver:SendKeysToElement support for non-typeable form controls (date, color, ...)
Whiteboard: [webdriver:triage]

It's unfortunate that the value of such input types cannot be set directly, but there is still the workaround by using Execute Script. Right now we do not have seen that many reports and assume it's not failing that often.

Priority: P2 → P3
Whiteboard: [webdriver:triage] → [webdriver:backlog]

Thanks for investigating this.

Is it possible to make it as forgiving as possible and not stop operation like element.send_keys() from working without any indication, improper format etc.

Chromium tend to be much more forgiving, and due to deadlines I have no time to investigate much why it fails other places.
So very often I do not have time to make sure it works for firefox/geckodriver if it just works in chromium.

Well, there is a bug for Chromium to make its behavior more strict but that hasn't been fixed yet:

Also there is which is about a validation check. But there is no decision yet.

You need to log in before you can comment on or make changes to this bug.