Closed Bug 1206126 Opened 9 years ago Closed 8 years ago

Return unexpected alert errors when mandated

Categories

(Remote Protocol :: Marionette, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1279211

People

(Reporter: ato, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: pi-marionette-server)

According to the spec:

“When a user prompt appears, it is the task of the subsequent command to handle it. If the subsequent requested command is not one listed in this chapter, an unexpected alert open error will be returned.”

http://www.w3.org/TR/webdriver/#user-prompts

This Selenium test is designed to check this requirement:

  public void testIncludesAlertTextInUnhandledAlertException() {
    driver.findElement(By.id("alert")).click();
    wait.until(alertIsPresent());
    try {
      driver.getTitle();
      fail("Expected UnhandledAlertException");
    } catch (UnhandledAlertException e) {
      assertEquals("cheese", e.getAlertText());
      assertThat(e.getMessage(), containsString("cheese"));
    }
  }

But it fails due to lack of exception, getTitle command returns the title instead of unexpected alert open error.

This was originally reported by Alexei Barancev in https://github.com/jgraham/wires/issues/21.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.