Skip to content

Commit 865c140

Browse files
OndraMbarancev
authored andcommitted
[java] Fix submitting form containing input with name or id "submit" (#3398)
Signed-off-by: Alexei Barantsev <[email protected]>
1 parent d7b43ef commit 865c140

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

java/client/src/org/openqa/selenium/remote/http/W3CHttpCommandCodec.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public W3CHttpCommandCodec() {
294294
"if (!form.ownerDocument) { throw Error('Unable to find owning document'); }\n" +
295295
"var e = form.ownerDocument.createEvent('Event');\n" +
296296
"e.initEvent('submit', true, true);\n" +
297-
"if (form.dispatchEvent(e)) { form.submit() }\n",
297+
"if (form.dispatchEvent(e)) { HTMLFormElement.prototype.submit.call(form) }\n",
298298
asElement(parameters.get("id")));
299299

300300
default:

java/client/test/org/openqa/selenium/FormHandlingTest.java

-2
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ public void testCanClickOnAnExternalImplicitSubmitButton() {
308308
}
309309

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

323322
@Test
324-
@Ignore(value = MARIONETTE, issue = "3398")
325323
public void canSubmitFormWithSubmitButtonNameEqualToSubmit() {
326324
String blank = appServer.create(new Page().withTitle("Submitted Successfully!"));
327325
driver.get(appServer.create(new Page().withBody(

0 commit comments

Comments
 (0)