This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23876 - Typing keys algorithm should special case input type=file elements
Summary: Typing keys algorithm should special case input type=file elements
Status: ASSIGNED
Alias: None
Product: Browser Test/Tools WG
Classification: Unclassified
Component: WebDriver (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Marc Fisher
QA Contact: Browser Testing and Tools WG
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 20860
  Show dependency treegraph
 
Reported: 2013-11-20 13:57 UTC by Andreas Tolfsen
Modified: 2016-09-20 09:39 UTC (History)
4 users (show)

See Also:


Attachments

Description Andreas Tolfsen 2013-11-20 13:57:24 UTC
The typing keys section specifies key-based interaction with web elements that are interactable.  There's no special casing of input type=file elements which, from a driver perspective, requires special handling.

My suggestion is that we allow that to short-curcuit the algorithm and leave the steps to fill filename(s) into the field undefined since the widgets are radically different depending on user agent and operating system.

As we discussed at the F2F in Boston we also need to cover input type=file multiple elements.

Link to the section:

  https://dvcs.w3.org/hg/webdriver/raw-file/tip/webdriver-spec.html#typing-keys
Comment 1 Andreas Tolfsen 2013-11-20 16:06:16 UTC
Following up on the point about input type=file multiple:  The resolution from our F2F in Boston was to follow the logic that sendKeys, by default, appends.  Provided the user agent supports the concept of multiple, calling it a second time would append another file.  If the user agent doesn't understand this concept, it will replace the set file.

Link to the resolution:

    http://www.w3.org/2013/06/13-testing-minutes.html#item08
Comment 2 Alexei Barantsev 2014-05-19 19:35:01 UTC
Another aspect is: should we check presense of the file or not?
Comment 3 Andreas Tolfsen 2014-07-09 13:28:57 UTC
We (In reply to Alexei Barantsev from comment #2)
> Another aspect is: should we check presense of the file or not?

This is out of scope for WebDriver and is enforced by the user agent.
Comment 4 Alexei Barantsev 2014-07-09 13:33:51 UTC
Unfortunately it is *not* enforced, see https://code.google.com/p/selenium/issues/detail?id=7276
Comment 5 David Burns :automatedtester 2016-05-09 09:57:06 UTC
This was put in in https://github.com/w3c/webdriver/commit/de28aa7427f4aea3e3d07e433ae58a8485a72c58

Only missing piece is <input type=file multiple>
Comment 6 David Burns :automatedtester 2016-09-19 16:06:26 UTC
subsequent calls to element.send_keys(path) to <input type=file multiple> would append. This needs to be added to the specification