Examples of IElement


Examples of net.sourceforge.jwebunit.api.IElement

   * @param notText
   * @return
   */
  protected String getLabelIDForText(String text, String notText, String alsoCondition) {
    logTimed("web", "internal", "get label ID for text (3)");
    IElement element = getElementByXPath("//label[" + getContainsTextXPath(text) + " and not(" + getContainsTextXPath(notText) + ") and (" + alsoCondition + ")]");
    logTimed("web", "internal", "get label ID for text (3) complete");
    return element.getAttribute("id");
  }
View Full Code Here

Examples of net.sourceforge.jwebunit.api.IElement

   *
   * @see #getLabelIDForText(String)
   * @param text label text to search for
   */
  protected void assertLabelNotPresent(String text) {
    IElement element;
    try {
      element = getElementByXPath("//label[contains(text(),'" + text + "')]");
    } catch (AssertionFailedError e) {
      // expected
      element = null;
View Full Code Here

Examples of net.sourceforge.jwebunit.api.IElement

   * Reset the debug dialog text, improving the accuracy of methods
   * like {@link #assertNoProblem()}.
   */
  public void resetDebug() {
    if (hasElementById("debug")) {
      IElement debug = getElementById("debug");
      debug.setTextContent("");
    }
    if (hasElementById("response")) {
      IElement debug = getElementById("response");
      debug.setTextContent("");
    }
  }
View Full Code Here

Examples of net.sourceforge.jwebunit.api.IElement

   *
   * @return the debug dialog text, or <code>null</code> if no debug dialog exists
   */
  public String getDebugText() {
    if (hasElementById("debug")) {
      IElement debug = getElementById("debug");
      return debug.getTextContent();
    }
    return null;
  }
View Full Code Here

Examples of net.sourceforge.jwebunit.api.IElement

   * @return the Label found with the given text.
   */
  public IElement assertLabelTextPresent(String text) {
    assertFalse("Cannot assert the presence of an empty label", text.isEmpty());
   
    IElement match = getElementByXPath("//label[" + getContainsTextXPath(text) + "]");
    assertNotNull(match);
    String textContent = match.getTextContent();
    // normalise
    textContent = normalizeSpace(textContent);
    assertEquals(text, textContent);
    return match;
  }
View Full Code Here

Examples of net.sourceforge.jwebunit.api.IElement

   *
   * @param text
   * @return the Label found with the given text.
   */
  public IElement assertLabelTextExactlyPresent(String text) {
    IElement match = getElementByXPath("//label[" + getExactTextXPath(text) + "]");
    assertNotNull(match);
    String textContent = match.getTextContent();
    // normalise
    textContent = normalizeSpace(textContent);
    assertEquals(text, textContent);
   
    // make sure it's visible
View Full Code Here

Examples of net.sourceforge.jwebunit.api.IElement

   */
  public IElement assertLabelTextPresent(String text, String notText) {
    assertFalse(text.equals(notText))// sanity check
    assertFalse("Cannot assert the presence of an empty label", text.isEmpty());
   
    IElement match = getElementByXPath("//label[" + getContainsTextXPath(text) + " and not(" + getContainsTextXPath(notText) + ")]");
    assertNotNull(match);
    String textContent = match.getTextContent();
    // normalise
    textContent = textContent.replaceAll("[\\s]+", " ").trim();
    assertEquals(text, textContent);
   
    return match;
View Full Code Here

Examples of net.sourceforge.jwebunit.api.IElement

     *
     * <p>{@inheritDoc}
     */
    @Override
  public void assertButtonPresentWithText(String text) {
      IElement button = getButtonWithText(text);
      // we found a button; check that it is visible
        assertTrue("Found button with text '" + text + "', but it was hidden", isDisplayed(button));
    }
View Full Code Here

Examples of net.sourceforge.jwebunit.api.IElement

     *
     * <p>{@inheritDoc}
     */
    @Override
  public void assertButtonNotPresentWithText(String text) {
      IElement button;
      try {
        button = getButtonWithText(text);
      } catch (AssertionFailedError e) {
        // expected
        return;
View Full Code Here

Examples of net.sourceforge.jwebunit.api.IElement

   *
   * @throws IOException
   */
  public void typeLabeledFormElement(String id, String text) throws IOException {
    // get the elements referenced by this label
    IElement label = getElementById(id);
    assertNotNull(label);
   
    List<IElement> elements = getFieldsForLabel(label);
    assertFalse("Could not find any elements for label " + id, elements.isEmpty());
   
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.