Closed Bug 759485 Opened 12 years ago Closed 11 years ago

HTMLElement does not have an endpoint for submit

Categories

(Remote Protocol :: Marionette, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla27

People

(Reporter: automatedtester, Assigned: automatedtester)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

We need to add submit as this is currently in the json wire and spec

http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/element/:id/submit

Errors from Selenium 
2012-05-24 15:17:40,762 - Selenium-Proxy - DEBUG - /submit - {u'sessionId': u'13', u'id': u'{779fc59e-e659-a94c-9ff3-f7cc8bc9125a}'} - 13 - {779fc59e-e659-a94c-9ff3-f7cc8bc9125a}
2012-05-24 15:17:40,762 - Selenium-Proxy - ERROR - Unknown path - 13
Depends on: 759477
Flags: needinfo?(dburns)
Blocks: webdriver
Attachment #815575 - Flags: review?(mdas)
Flags: needinfo?(dburns)
Comment on attachment 815575 [details] [diff] [review]
Add submit to HTMLElement on Marionette to submit forms without click() or send_keys();

Review of attachment 815575 [details] [diff] [review]:
-----------------------------------------------------------------

r+ if the chrome/content context bug is fixed

::: testing/marionette/client/marionette/tests/unit/test_submit.py
@@ +18,5 @@
> +    def test_should_submit_a_form_when_any_input_element_within_that_form_is_submitted(self):
> +        test_html = self.marionette.absolute_url("formPage.html")
> +        self.marionette.navigate(test_html)
> +        self.marionette.find_element("id", "checky").submit()
> +        for i in range(5):

*sigh* this feels a little clunky but I don't know how else to do it either. I was thinking of async scripts but they error out when unload is called. We just have to wait for MarionetteWait for a location change checker :)

::: testing/marionette/marionette-server.js
@@ +1701,5 @@
> +   *
> +  */
> +  submitElement: function MDA_submitElement(aRequest) {
> +    let command_id = this.command_id = this.getCommandId();
> +    this.sendAsync("submitElement", {id: aRequest.parameters.id}, command_id);

This will let you submit an element even when you're in the chrome context. It will likely generate 'element not found' errors which would confuse the user. Can you put this in a condition on the context?
Attachment #815575 - Flags: review?(mdas) → review+
Attachment #815575 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/cba664ebefdc
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: