Example usage for org.openqa.selenium.support.events EventFiringWebDriver quit

List of usage examples for org.openqa.selenium.support.events EventFiringWebDriver quit

Introduction

In this page you can find the example usage for org.openqa.selenium.support.events EventFiringWebDriver quit.

Prototype

@Override
    public void quit() 

Source Link

Usage

From source file:ch.vorburger.webdriver.reporting.tests.SampleGoogleSearchReportTest.java

License:Apache License

@Test
public void testGoogleSearch() {
    EventFiringWebDriver driverWithReporting;
    {//ww w.j a  v  a 2 s  .  c  om
        // System.setProperty("webdriver.chrome.driver", "/opt/google/chrome/chrome");
        // WebDriver driver = new ChromeDriver();
        WebDriver driver = new FirefoxDriver();

        WebDriverEventListener loggingListener = new LoggingWebDriverEventListener(LOG_FILE_WRITER);
        ;
        driverWithReporting = new EventFiringWebDriver(driver);
        driverWithReporting.register(loggingListener);
    }

    driverWithReporting.get("http://www.google.com");
    WebElement element = driverWithReporting.findElement(By.name("q"));
    element.sendKeys("Mifos");
    element.submit();

    (new WebDriverWait(driverWithReporting, 10))
            .until(ExpectedConditions.presenceOfElementLocated(By.id("bfoot")));

    driverWithReporting.quit();
}