Package org.openqa.selenium

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


   
//    ֱ����������frame
    dr.switchTo().defaultContent();

//    �ٵ�f1
    dr.switchTo().frame("f1");
    dr.findElement(By.linkText("click")).click();
   
    Thread.sleep(1000);
    System.out.println("browser will be close");
    dr.quit()
View Full Code Here


    {
        WebDriver driver = getTest().getDriver();
        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);
        }
    }
View Full Code Here

        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

     * 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

    @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

    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

        }
        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

    $("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

    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

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

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.