Closed
Bug 941085
Opened 11 years ago
Closed 10 years ago
File uploads support
Categories
(Remote Protocol :: Marionette, defect, P1)
Remote Protocol
Marionette
Tracking
(firefox40 fixed)
RESOLVED
FIXED
mozilla40
Tracking | Status | |
---|---|---|
firefox40 | --- | fixed |
People
(Reporter: ato, Assigned: ato)
References
(Blocks 1 open bug)
Details
(Keywords: pi-marionette-server, pi-marionette-spec, Whiteboard: [marionette=1.0])
Attachments
(2 files, 1 obsolete file)
Marionette lacks support for file uploads. WebDriver uses sendKeys on
<input type=file> elements to set the value to the absolute path of
the file.
When using WebDriver remotely over the wire an additional end-point,
POST /file, is used to temporarily store the file on the remote server
until sendKeys is called a second time, upon which the absolute path
should refer to the remote file instead of the local file.
The resolution from our F2F in Boston was to follow the logic that
sendKeys, by default, appends as it would textual elements. 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.
The discussion around the resolution can be found here:
http://www.w3.org/2013/06/13-testing-minutes.html#item08
See also the spec bug about covering this in the algorithm for sendKeys:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=23876
See the attached TC for a few tests, which can be executed using
`python runtests.py --binary=/path/to/firefox --type=browser
~/test_file_upload.py`.
Updated•11 years ago
|
Whiteboard: [spec]
Updated•11 years ago
|
Keywords: ateam-marionette-spec
Assignee | ||
Comment 1•10 years ago
|
||
hsteen experimented with this using special powers last night, and was able to come up with a solution:
<hallvors> yay. m.set_context(m.CONTEXT_CHROME) followed by m.execute_script('gBrowser.contentDocument.getElementById("input_type_file_id").value="file.txt" WORKS! I can upload files!
Comment 2•10 years ago
|
||
(AFAIK this won't work on Android though - the extension API is different.. In any case using send_keys or a dedicated API should be supported :))
Assignee | ||
Comment 3•10 years ago
|
||
It also won't work in a B2G context, but leaving Android and B2G as unsupported for the time being should be fine according to :automatedtester.
Updated•10 years ago
|
Keywords: ateam-marionette-server
Updated•10 years ago
|
Whiteboard: [spec] → [marionette=1.0]
Updated•10 years ago
|
Priority: -- → P1
Updated•10 years ago
|
Assignee: nobody → ato
Assignee | ||
Updated•10 years ago
|
OS: Linux → All
Hardware: x86_64 → All
Updated•10 years ago
|
Attachment #8335385 -
Attachment mime type: text/x-python → text/plain
Assignee | ||
Comment 4•10 years ago
|
||
Have a working patch locally. Need to add tests for uploading to local httpd.
Status: NEW → ASSIGNED
Assignee | ||
Comment 5•10 years ago
|
||
/r/6359 - Bug 941085: File uploads support in Marionette
Pull down this commit:
hg pull review -r 810d78270512243b91f0e93a199907e9cbeaf406
Assignee | ||
Comment 6•10 years ago
|
||
Comment on attachment 8586157 [details]
MozReview Request: bz://941085/ato
/r/6359 - Bug 941085: File uploads support in Marionette
Pull down this commit:
hg pull review -r 9c53900e6c7d8ba99f2d256dd2f054a346b011d5
Attachment #8586157 -
Flags: review?(dburns)
Assignee | ||
Comment 7•10 years ago
|
||
try based off inbound: https://treeherder.mozilla.org/#/jobs?repo=try&revision=d2f44c8e2f18
Comment 8•10 years ago
|
||
Comment on attachment 8586157 [details]
MozReview Request: bz://941085/ato
https://reviewboard.mozilla.org/r/6357/#review5323
::: testing/marionette/driver.js
(Diff revision 2)
> + let f;
variable name to `file`
Attachment #8586157 -
Flags: review?(dburns)
Assignee | ||
Comment 9•10 years ago
|
||
Comment on attachment 8586157 [details]
MozReview Request: bz://941085/ato
/r/6359 - Bug 941085: File uploads support in Marionette
Pull down this commit:
hg pull -r 73ab0d4b4ca088eca38ad8ff49286b97dff76b8c https://reviewboard-hg.mozilla.org/gecko/
Attachment #8586157 -
Flags: review?(dburns)
Assignee | ||
Comment 10•10 years ago
|
||
New try run, fixes sendKeysToElement for non-file input elements: https://treeherder.mozilla.org/#/jobs?repo=try&revision=5583d4255b66
Comment 11•10 years ago
|
||
Try is not happy, will review after next try run
Updated•10 years ago
|
Attachment #8586157 -
Flags: review?(dburns)
Assignee | ||
Comment 12•10 years ago
|
||
Comment on attachment 8586157 [details]
MozReview Request: bz://941085/ato
/r/6359 - Bug 941085: File uploads support in Marionette
Pull down this commit:
hg pull -r 81ffce46bc24c3eb0485d42b4b27d5af262159cc https://reviewboard-hg.mozilla.org/gecko/
Attachment #8586157 -
Flags: review?(dburns)
Assignee | ||
Comment 13•10 years ago
|
||
Assignee | ||
Comment 14•10 years ago
|
||
Filed bug 1149998 since we seem unable to use HTMLElement#mozSetFileArray on CPOW-wrapped elements passed from a remote content process.
Assignee | ||
Comment 15•10 years ago
|
||
Comment on attachment 8586157 [details]
MozReview Request: bz://941085/ato
/r/6359 - Bug 941085: File uploads support in Marionette
Pull down this commit:
hg pull -r 906d7b65c4bc4315fe0d93284e5ecdebb054130b https://reviewboard-hg.mozilla.org/gecko/
Assignee | ||
Comment 16•10 years ago
|
||
new try run with test fixes for upload test: https://treeherder.mozilla.org/#/jobs?repo=try&revision=bf04b863f74f
Comment 17•10 years ago
|
||
Windows failure :(
Assignee | ||
Comment 18•10 years ago
|
||
Disabled failing test on Windows due to http://bugs.python.org/issue14574 and filed bug 1150512 about moving to wptserve.
Pushed to inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/93166201fca0
Comment 19•10 years ago
|
||
Backed out for widespread Gip timeouts.
https://hg.mozilla.org/integration/mozilla-inbound/rev/ada788536540
Assignee | ||
Updated•10 years ago
|
Attachment #8586157 -
Flags: review?(dburns) → review+
Assignee | ||
Comment 20•10 years ago
|
||
Fixed test failures and pushed to inbound again: https://hg.mozilla.org/integration/mozilla-inbound/rev/f3a27b508519
The cause of the failures was that GaiaTestRunner relied on internal state set in BaseMarionetteTestRunner (self.httpd) and modified this. This patch changed BaseMarionetteTestRunner.start_httpd to create_httpd which instead returned the httpd which the constructor assigned to self.httpd.
This was a problem for GaiaTestRunner because it is overriding start_httpd.
Comment 21•10 years ago
|
||
Assignee | ||
Comment 22•10 years ago
|
||
Either e10s isn't being entirely truthful to us about its load events, or WebElement.click is doing something very wrong. I added another explicit wait for the URL to change after the submit element is clicked.
I didn't see the problem rerunning the tests on e10s locally 40 times.
Pushed to inbound again: https://hg.mozilla.org/integration/mozilla-inbound/rev/3ea71f4c74e6
Comment 23•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox40:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Assignee | ||
Comment 24•9 years ago
|
||
Attachment #8586157 -
Attachment is obsolete: true
Attachment #8618061 -
Flags: review+
Assignee | ||
Comment 25•9 years ago
|
||
Updated•2 years ago
|
Product: Testing → Remote Protocol
You need to log in
before you can comment on or make changes to this bug.
Description
•