Package org.openqa.selenium

Examples of org.openqa.selenium.WebDriver.manage()


public class LogTest extends BaseTestWithServer {
    @Test
    public void shouldReturnListOfAvailableLogs() {
        WebDriver d = getDriver();
        Set<String> logTypes = d.manage().logs().getAvailableLogTypes();

        if (d.getClass().getSimpleName().equals("PhantomJSDriver")) {
            // GhostDriver only has 3 log types...
            assertEquals(3, logTypes.size());
            // ... and "har" is one of them
View Full Code Here


        throwErrorButton.click();
        throwErrorButton.click();
        throwErrorButton.click();

        // Retrieve and count the errors
        LogEntries logEntries = d.manage().logs().get("browser");
        assertEquals(3, logEntries.getAll().size());

        for (LogEntry logEntry : logEntries) {
            System.out.println(logEntry);
        }
View Full Code Here

    @Test
    public void shouldReturnLogTypeHar() {
        WebDriver d = getDriver();
        d.get(server.getBaseUrl() + "/common/iframes.html");

        LogEntries logEntries = d.manage().logs().get("har");
        for (LogEntry logEntry : logEntries) {
            System.out.println(logEntry);
        }
    }
}
View Full Code Here

public class TimeoutSettingTest extends BaseTest {
    @Test
    public void navigateAroundMDN() {
        WebDriver d = getDriver();
        d.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        d.manage().timeouts().pageLoadTimeout(20, TimeUnit.SECONDS);
        d.manage().timeouts().setScriptTimeout(5, TimeUnit.SECONDS);
    }
}
View Full Code Here

public class TimeoutSettingTest extends BaseTest {
    @Test
    public void navigateAroundMDN() {
        WebDriver d = getDriver();
        d.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        d.manage().timeouts().pageLoadTimeout(20, TimeUnit.SECONDS);
        d.manage().timeouts().setScriptTimeout(5, TimeUnit.SECONDS);
    }
}
View Full Code Here

    @Test
    public void navigateAroundMDN() {
        WebDriver d = getDriver();
        d.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        d.manage().timeouts().pageLoadTimeout(20, TimeUnit.SECONDS);
        d.manage().timeouts().setScriptTimeout(5, TimeUnit.SECONDS);
    }
}
View Full Code Here

    }

    @Test
    public void shouldBeAbleToPassMultipleArgumentsToAsyncScripts() {
        WebDriver d = getDriver();
        d.manage().timeouts().setScriptTimeout(0, TimeUnit.MILLISECONDS);
        d.get("http://www.google.com/");
        Number result = (Number) ((JavascriptExecutor) d).executeAsyncScript(
                "arguments[arguments.length - 1](arguments[0] + arguments[1]);",
                1,
                2);
View Full Code Here

    }

    @Test
    public void shouldBeAbleToExecuteMultipleAsyncScriptsSequentially() {
        WebDriver d = getDriver();
        d.manage().timeouts().setScriptTimeout(0, TimeUnit.MILLISECONDS);
        d.get("http://www.google.com/");
        Number numericResult = (Number) ((JavascriptExecutor) d).executeAsyncScript(
                "arguments[arguments.length - 1](123);");
        assertEquals(123, numericResult.intValue());
        String stringResult = (String) ((JavascriptExecutor) d).executeAsyncScript(
View Full Code Here

    public void shouldBeAbleToExecuteMultipleAsyncScriptsSequentiallyWithNavigation() {
        // NOTE: This test is supposed to fail!
        // It's a reminder that there is some internal issue in PhantomJS still to address.

        WebDriver d = getDriver();
        d.manage().timeouts().setScriptTimeout(0, TimeUnit.MILLISECONDS);

        d.get("http://www.google.com/");
        Number numericResult = (Number) ((JavascriptExecutor) d).executeAsyncScript(
                "arguments[arguments.length - 1](123);");
        assertEquals(123, numericResult.intValue());
View Full Code Here

        WebDriver d = getDriver();
        d.get("http://www.google.com");
        JavascriptExecutor js = (JavascriptExecutor) d;

        // Of course, no cookie yet(!)
        Cookie c = d.manage().getCookieNamed(ckey);
        assertNull(c);

        // Attempt to create cookie on multiple Google domains
        js.executeScript("javascript:(" +
                "function() {" +
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.