Package org.openqa.selenium

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


            userField.sendKeys(username);
            passwordField.sendKeys(password);

            submit.click();

            Cookie session = driver.manage().getCookieNamed("JSESSIONID");
            sessionId = session.getValue();
        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
            if(driver != null) {
View Full Code Here


            if(WebDriver.class.isAssignableFrom(event.getDroneType())) {
                WebDriver driver = event.getInstance().asInstance(WebDriver.class);
                // We need to navigate somewhere before we can set a cookie.
                // https://www.w3.org/Bugs/Public/show_bug.cgi?id=20975
                driver.get(holder.get().getURI() + "/../");
                driver.manage().deleteAllCookies();
                driver.manage().addCookie(new Cookie("JSESSIONID", holder.get().getSessionId()));
            }
        }

        private String authenticate(URI authUri) {
View Full Code Here

                WebDriver driver = event.getInstance().asInstance(WebDriver.class);
                // We need to navigate somewhere before we can set a cookie.
                // https://www.w3.org/Bugs/Public/show_bug.cgi?id=20975
                driver.get(holder.get().getURI() + "/../");
                driver.manage().deleteAllCookies();
                driver.manage().addCookie(new Cookie("JSESSIONID", holder.get().getSessionId()));
            }
        }

        private String authenticate(URI authUri) {
            return new TwitterLogin().login(authUri.toASCIIString());
View Full Code Here

        ImeHandler ime = mock(ImeHandler.class, isProxyable);
        Timeouts timeouts = mock(Timeouts.class, isProxyable);

        // then
        try {
            driver.manage();
            driver.navigate();
            driver.switchTo();
            driver.findElement(By.className(""));
            driver.findElements(By.className(""));
            driver.getWindowHandles();
View Full Code Here

    public void prepare(@Observes AfterDroneEnhanced event) {

        WebDriver browser = event.getInstance().asInstance(WebDriver.class);
        if (BrowserUtils.isPhantomjs(browser)) {
            browser.manage().window().setSize(new Dimension(1280, 1024));
        }
    }

}
View Full Code Here

        Firebug.configure(new File("."), capabilities);
        // **************************************

        WebDriver driver = new FirefoxDriver(capabilities);

        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

        // page 1
        driver.get("http://twitter.com/#!/search-home");
        driver.findElement(By.xpath("//div[text() = 'Search']/../../input")).sendKeys("#WebPerfSD");

View Full Code Here

        // configure it as a desired capability
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability(CapabilityType.PROXY, proxy.seleniumProxy());

        WebDriver driver = new FirefoxDriver(capabilities);
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

        // start capture
        proxy.newHar("twitter.com");

        // page 1
View Full Code Here

import java.util.concurrent.TimeUnit;

public class SimpleTest {
    public static void main(String[] args) {
        WebDriver driver = new FirefoxDriver();
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

        // page 1
        driver.get("http://twitter.com/#!/search-home");
        driver.findElement(By.xpath("//div[text() = 'Search']/../../input")).sendKeys("#WebPerfSD");
View Full Code Here

        try {
            Thread.sleep(sleepTime);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        WebDriver.Options manage = webDriver.manage();
        Site site = task.getSite();
        if (site.getCookies() != null) {
            for (Map.Entry<String, String> cookieEntry : site.getCookies().entrySet()) {
                Cookie cookie = new Cookie(cookieEntry.getKey(), cookieEntry.getValue());
                manage.addCookie(cookie);
View Full Code Here

    }

    @Override
    protected Result executeImpl(Context context, String... curArgs) {
        WebDriver driver = context.getWrappedDriver();
        Window window = driver.manage().window();
        window.maximize();
        return SUCCESS;
    }
}
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.