Skip to content

Commit

Permalink
[java] Fix submitting form containing input with name or id "submit" (S…
Browse files Browse the repository at this point in the history
…eleniumHQ#3398)

Signed-off-by: Alexei Barantsev <barancev@gmail.com>
  • Loading branch information
OndraM authored and barancev committed Sep 10, 2017
1 parent d7b43ef commit 865c140
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public W3CHttpCommandCodec() {
"if (!form.ownerDocument) { throw Error('Unable to find owning document'); }\n" +
"var e = form.ownerDocument.createEvent('Event');\n" +
"e.initEvent('submit', true, true);\n" +
"if (form.dispatchEvent(e)) { form.submit() }\n",
"if (form.dispatchEvent(e)) { HTMLFormElement.prototype.submit.call(form) }\n",
asElement(parameters.get("id")));

default:
Expand Down
2 changes: 0 additions & 2 deletions java/client/test/org/openqa/selenium/FormHandlingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,6 @@ public void testCanClickOnAnExternalImplicitSubmitButton() {
}

@Test
@Ignore(value = MARIONETTE, issue = "3398")
public void canSubmitFormWithSubmitButtonIdEqualToSubmit() {
String blank = appServer.create(new Page().withTitle("Submitted Successfully!"));
driver.get(appServer.create(new Page().withBody(
Expand All @@ -321,7 +320,6 @@ public void canSubmitFormWithSubmitButtonIdEqualToSubmit() {
}

@Test
@Ignore(value = MARIONETTE, issue = "3398")
public void canSubmitFormWithSubmitButtonNameEqualToSubmit() {
String blank = appServer.create(new Page().withTitle("Submitted Successfully!"));
driver.get(appServer.create(new Page().withBody(
Expand Down

0 comments on commit 865c140

Please sign in to comment.