Return unexpected alert errors when mandated

RESOLVED DUPLICATE of bug 1279211

Status

defect
RESOLVED DUPLICATE of bug 1279211
4 years ago
3 years ago

People

(Reporter: ato, Unassigned)

Tracking

(Blocks 1 bug, {pi-marionette-server})

Firefox Tracking Flags

(Not tracked)

Details

Reporter

Description

4 years ago
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.
Reporter

Updated

4 years ago
Reporter

Updated

3 years ago
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1279211
You need to log in before you can comment on or make changes to this bug.