Examples of manage()


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

    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

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

        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

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

        // 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

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

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

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

        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

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

    }

    @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

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

            driver.switchTo().window(handle);
            String url = driver.getCurrentUrl();
            String title = driver.getTitle();
            message = formatUrlAndTitle(url, title);
            origin = getOrigin(url);
            for (Cookie cookie : driver.manage().getCookies())
                cookieMap.add(cookie);
        } catch (NotFoundException e) {
            message = "No focused window/frame.";
            origin = "";
        } catch (UnhandledAlertException e) {
View Full Code Here

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

public class ResizeBrowser {

  public static void main(String[] args) {
    WebDriver dr = new ChromeDriver();
    dr.manage().window().setSize(new Dimension(240, 320));
    dr.get("http://www.3g.qq.com/");
    dr.quit();
  }

}
View Full Code Here

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

    System.out.printf("now accesss %s \n", url);
   
    dr.get(url);
    Thread.sleep(2000);
   
    System.out.println(dr.manage().getCookies());
   
    dr.manage().deleteAllCookies();
   
    Cookie c1 = new Cookie("BAIDUID", "xxxxxxxxxx");
    Cookie c2 = new Cookie("BDUSS", "xxxxxxxxxx");
View Full Code Here

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

    dr.get(url);
    Thread.sleep(2000);
   
    System.out.println(dr.manage().getCookies());
   
    dr.manage().deleteAllCookies();
   
    Cookie c1 = new Cookie("BAIDUID", "xxxxxxxxxx");
    Cookie c2 = new Cookie("BDUSS", "xxxxxxxxxx");
    dr.manage().addCookie(c1);
    dr.manage().addCookie(c2);
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.