Example usage for org.openqa.selenium UnhandledAlertException UnhandledAlertException

List of usage examples for org.openqa.selenium UnhandledAlertException UnhandledAlertException

Introduction

In this page you can find the example usage for org.openqa.selenium UnhandledAlertException UnhandledAlertException.

Prototype

public UnhandledAlertException(String message) 

Source Link

Usage

From source file:com.seleniumtests.it.driver.TestDriver.java

License:Apache License

/**
 * deactivated as it depends on browser//from   w w  w.  j  av  a  2s. c om
 */
@Test(groups = { "it", "ut" }, expectedExceptions = UnhandledAlertException.class, enabled = false)
public void testFindWithAlert() {
    DriverTestPage.startButton.click();
    DriverTestPage.greenSquare.click();
    DriverTestPage.redSquare.click();

    if (((CustomEventFiringWebDriver) driver).getWebDriver() instanceof FirefoxDriver
            && FirefoxDriverFactory.isMarionetteMode()) {
        throw new UnhandledAlertException(
                "fake exception as firefox / marionette does not raise any exception");
    }
}

From source file:ru.stqa.selenium.factory.FakeAlertiveWebDriver.java

License:Apache License

@Override
public Set<String> getWindowHandles() {
    if (isActive) {
        throw new UnhandledAlertException("alert");
    } else {//from   w ww  . j  a va  2  s .  co m
        throw new WebDriverException("closed");
    }
}