Examples of switchTo()


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

        String windowHandle = driver.getWindowHandle();
        try {
            WebElement iframe = driver.findElement(By.className("mceEditorIframe"));
            driver.switchTo().frame(iframe).switchTo().activeElement().sendKeys(keysToSend);
        } finally {
            driver.switchTo().window(windowHandle);
        }
    }

    public void clickWysiwygUnorderedListButton()
    {
View Full Code Here

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

     * Selects the rich text area frame. Selectors are relative to the edited document after calling this method.
     */
    public void selectRichTextAreaFrame()
    {
        WebDriver driver = getDriver();
        driver.switchTo().frame(driver.findElement(By.className("gwt-RichTextArea"))).switchTo().activeElement();
    }

    /**
     * Selects the top frame.
     */
 
View Full Code Here

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

    @Override
    public Object intercept(InvocationContext context) throws Throwable {
        WebDriver browser = context.getGrapheneContext().getWebDriver();
        if (indexOfFrame != -1) {
            browser.switchTo().frame(indexOfFrame);
        } else if (nameOrIdOfFrame != null) {
            browser.switchTo().frame(nameOrIdOfFrame);
        }
        Object result = null;
        try {
View Full Code Here

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

    public Object intercept(InvocationContext context) throws Throwable {
        WebDriver browser = context.getGrapheneContext().getWebDriver();
        if (indexOfFrame != -1) {
            browser.switchTo().frame(indexOfFrame);
        } else if (nameOrIdOfFrame != null) {
            browser.switchTo().frame(nameOrIdOfFrame);
        }
        Object result = null;
        try {
            result = context.invoke();
        } finally {
View Full Code Here

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

        }
        Object result = null;
        try {
            result = context.invoke();
        } finally {
            browser.switchTo().defaultContent();
        }
        if (result instanceof GrapheneProxyInstance) {
            ((GrapheneProxyInstance) result).registerInterceptor(this);
        }
        return result;
View Full Code Here

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

    $("h1").shouldHave(text("Tabs"));

    Set<String> windowHandles = driver.getWindowHandles();
    windowHandles.remove(windowHandle);

    driver.switchTo().window(windowHandles.iterator().next());
    $("h1").shouldHave(text("File uploads"));

    driver.switchTo().window(windowHandle);
    $("h1").shouldHave(text("Tabs"));
  }
View Full Code Here

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

    windowHandles.remove(windowHandle);

    driver.switchTo().window(windowHandles.iterator().next());
    $("h1").shouldHave(text("File uploads"));

    driver.switchTo().window(windowHandle);
    $("h1").shouldHave(text("Tabs"));
  }

  @Test
  public void canSwitchToWindowByTitle() {
View Full Code Here

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

        // Uploading files across a network may take a while, even if they're really small.
        // Wait for the loading label to disappear.
        WebDriverWait wait = new WebDriverWait(d, 10);
        wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id("upload_label")));

        d.switchTo().frame("upload_target");

        wait = new WebDriverWait(d, 5);
        wait.until(ExpectedConditions.textToBePresentInElementLocated(By.xpath("//body"), LOREM_IPSUM_TEXT));

        // Navigate after file upload to verify callbacks are properly released.
View Full Code Here

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

        // Click on link that will cause popup to be created
        d.findElement(By.xpath("//a")).click();
        // Switch to new popup
        String popupHandle = (String)d.getWindowHandles().toArray()[1];
        d.switchTo().window(popupHandle);

        assertTrue(d.getTitle().contains("Japan"));
    }
}
View Full Code Here

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

        // Close 1 window and check that 1 is left
        d.close();
        assertEquals(1, d.getWindowHandles().size());

        // Switch to that window
        d.switchTo().window("google");
        assertNotNull(d.getWindowHandle());

        // Close the remaining window and check now there are no windows available
        d.close();
        assertEquals(0, d.getWindowHandles().size());
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.