Examples of findElementById()


Examples of org.openqa.selenium.htmlunit.HtmlUnitDriver.findElementById()

      HtmlUnitDriver driver = new HtmlUnitDriver();

      // Load page1 and click on the button which will render page2 (without faces-redirect=true)
      driver.get(baseUrl + "page1.jsf");
      driver.findElementById("form1:goto-page2").click();

      // The form URL on page2 should NOT point to page1
      String actionUrl = driver.findElementById("form2").getAttribute("action");
      assertThat(actionUrl, Matchers.containsString("page2"));
View Full Code Here

Examples of org.openqa.selenium.htmlunit.HtmlUnitDriver.findElementById()

      // Load page1 and click on the button which will render page2 (without faces-redirect=true)
      driver.get(baseUrl + "page1.jsf");
      driver.findElementById("form1:goto-page2").click();

      // The form URL on page2 should NOT point to page1
      String actionUrl = driver.findElementById("form2").getAttribute("action");
      assertThat(actionUrl, Matchers.containsString("page2"));

      // Click the button which creates a FacesMessage. Due to #166 this fails with a ViewExpiredException
      driver.findElementById("form2:create-message").click();
      assertThat(driver.getPageSource(), Matchers.containsString("Action method got executed"));
View Full Code Here

Examples of org.openqa.selenium.htmlunit.HtmlUnitDriver.findElementById()

      // The form URL on page2 should NOT point to page1
      String actionUrl = driver.findElementById("form2").getAttribute("action");
      assertThat(actionUrl, Matchers.containsString("page2"));

      // Click the button which creates a FacesMessage. Due to #166 this fails with a ViewExpiredException
      driver.findElementById("form2:create-message").click();
      assertThat(driver.getPageSource(), Matchers.containsString("Action method got executed"));

   }

}
View Full Code Here

Examples of org.openqa.selenium.htmlunit.HtmlUnitDriver.findElementById()

        HtmlUnitDriver driver = new HtmlUnitDriver();
        driver.get(authUrlObject.toString());

        List<WebElement> webElements = driver.findElementsByTagName("form");

        WebElement usernameElement = driver.findElementById("username");
        usernameElement.sendKeys(username);
        WebElement passwordElement = driver.findElementById("password");
        passwordElement.sendKeys(password);
        webElements.get(0).submit();
View Full Code Here

Examples of org.openqa.selenium.htmlunit.HtmlUnitDriver.findElementById()

        List<WebElement> webElements = driver.findElementsByTagName("form");

        WebElement usernameElement = driver.findElementById("username");
        usernameElement.sendKeys(username);
        WebElement passwordElement = driver.findElementById("password");
        passwordElement.sendKeys(password);
        webElements.get(0).submit();

        CodeUrl codeUrl = new CodeUrl(driver.getCurrentUrl());
View Full Code Here

Examples of org.openqa.selenium.remote.RemoteWebElement.findElementById()

  }

  @Test
  public void testElementId() throws Exception {
    RemoteWebElement contain = (RemoteWebElement) driver.findElement(By.id("content"));
    WebElement el = contain.findElementById("local");
    assertEquals(el.getText(), "accumsan ante");

  }

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