Skip to content

Commit 34e41e6

Browse files
committed
Adding tests for #3398
1 parent 9343e7b commit 34e41e6

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import static org.openqa.selenium.testing.TestUtilities.isIe7;
3636

3737
import org.junit.Test;
38+
import org.openqa.selenium.environment.webserver.Page;
3839
import org.openqa.selenium.testing.Ignore;
3940
import org.openqa.selenium.testing.JUnit4TestBase;
4041
import org.openqa.selenium.testing.JavascriptEnabled;
@@ -322,6 +323,32 @@ public void testCanClickOnAnExternalImplicitSubmitButton() {
322323
checkSubmitButton("external_implicit_submit");
323324
}
324325

326+
@Test
327+
@Ignore(value = MARIONETTE, issue = "3398")
328+
public void canSubmitFormWithSubmitButtonIdEqualToSubmit() {
329+
String blank = appServer.create(new Page().withTitle("Submitted Successfully!"));
330+
driver.get(appServer.create(new Page().withBody(
331+
String.format("<form action='%s'>", blank),
332+
" <input type='submit' id='submit' value='Submit'>",
333+
"</form>")));
334+
335+
driver.findElement(By.id("submit")).submit();
336+
wait.until(titleIs("Submitted Successfully!"));
337+
}
338+
339+
@Test
340+
@Ignore(value = MARIONETTE, issue = "3398")
341+
public void canSubmitFormWithSubmitButtonNameEqualToSubmit() {
342+
String blank = appServer.create(new Page().withTitle("Submitted Successfully!"));
343+
driver.get(appServer.create(new Page().withBody(
344+
String.format("<form action='%s'>", blank),
345+
" <input type='submit' name='submit' value='Submit'>",
346+
"</form>")));
347+
348+
driver.findElement(By.name("submit")).submit();
349+
wait.until(titleIs("Submitted Successfully!"));
350+
}
351+
325352
private void checkSubmitButton(String buttonId) {
326353
driver.get(appServer.whereIs("click_tests/html5_submit_buttons.html"));
327354
String name = "Gromit";

0 commit comments

Comments
 (0)