Bug 188514 - WebDriver: handle elements of type file in send keys command
Summary: WebDriver: handle elements of type file in send keys command
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebDriver (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 188513 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-08-13 05:36 PDT by Carlos Garcia Campos
Modified: 2019-12-03 02:04 PST (History)
9 users (show)

See Also:


Attachments
Patch (4.90 KB, patch)
2019-11-18 03:59 PST, Carlos Garcia Campos
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews210 for win-future (14.07 MB, application/zip)
2019-11-18 05:46 PST, EWS Watchlist
no flags Details
Patch (41.42 KB, patch)
2019-11-26 00:34 PST, Carlos Garcia Campos
no flags Details | Formatted Diff | Diff
Patch (43.45 KB, patch)
2019-11-27 02:01 PST, Carlos Garcia Campos
bburg: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2018-08-13 05:36:47 PDT
https://w3c.github.io/webdriver/#element-send-keys
Comment 1 Carlos Garcia Campos 2019-11-18 03:59:44 PST
Created attachment 383738 [details]
Patch
Comment 2 Carlos Garcia Campos 2019-11-18 04:08:57 PST
*** Bug 188513 has been marked as a duplicate of this bug. ***
Comment 3 EWS Watchlist 2019-11-18 05:46:18 PST
Comment on attachment 383738 [details]
Patch

Attachment 383738 [details] did not pass win-ews (win):
Output: https://webkit-queues.webkit.org/results/13264000

New failing tests:
fast/forms/file/file-input-user-selection-events.html
Comment 4 EWS Watchlist 2019-11-18 05:46:21 PST
Created attachment 383740 [details]
Archive of layout-test-results from ews210 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews210  Port: win-future  Platform: CYGWIN_NT-10.0-17763-3.0.5-338.x86_64-x86_64-64bit
Comment 5 Carlos Garcia Campos 2019-11-25 01:34:27 PST
Ping Brian?
Comment 6 Carlos Garcia Campos 2019-11-26 00:31:35 PST
I've just realized I submitted the wrong patch here...
Comment 7 Carlos Garcia Campos 2019-11-26 00:34:05 PST
Created attachment 384330 [details]
Patch

This is the right one
Comment 8 Carlos Garcia Campos 2019-11-26 08:20:32 PST
Build failures in apple ports would be a matter of exporting symbols I think, I'll submit an updated patch.
Comment 9 Carlos Garcia Campos 2019-11-27 02:01:16 PST
Created attachment 384403 [details]
Patch
Comment 10 BJ Burg 2019-12-02 16:09:59 PST
taking a look.
Comment 11 BJ Burg 2019-12-02 16:21:28 PST
Comment on attachment 384403 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=384403&action=review

r=me

> Source/WebDriver/Session.cpp:1569
> +Session::IsFileUpload Session::parseElementIsFileUploadResult(const RefPtr<JSON::Value>& resultValue)

I would have encoded it as Optional<FileUploadType> and have FileUploadType be one of {Single, Multiple}.

> Source/WebKit/ChangeLog:9
> +        differently, so I'm keeping both to not break safari driver. The new one simply sends the file list ot the web

Typo: ot -> to, safari driver -> safaridriver.

> Source/WebKit/ChangeLog:11
> +        panel, intercept and complete the open panel request and send a dismiss open panel event to the driver.

I don't recall offhand why I didn't pursue an approach like yours. Perhaps it was related to sandboxing not being able to open the file without going through the file chooser path (which grants a sandbox exception for the selected files)?
Comment 12 Carlos Garcia Campos 2019-12-03 02:03:39 PST
Committed r253030: <https://trac.webkit.org/changeset/253030>
Comment 13 Radar WebKit Bug Importer 2019-12-03 02:04:37 PST
<rdar://problem/57585779>