Package com.gistlabs.mechanize.document.link

Examples of com.gistlabs.mechanize.document.link.Link.href()


        newHtml("Test Page", "<a id=\"foo\" href=\"foo.html\">foo</a>"));
   
    AbstractDocument page = agent().get("http://test.com");
    Link link = page.links().find("#foo");
    assertNotNull(link);
    assertEquals("http://test.com/foo.html", link.href());
  }

  @Test
  public void testLinkQueryByClass() {
    addPageRequest("http://test.com",
View Full Code Here


   
    assertNull(page.links().find(".foo")); // foo class
   
    Link link1 = page.links().find(".bar");
    assertNotNull(link1);
    assertEquals("http://test.com/foo.html", link1.href());

    Link link2 = page.links().find(".baz");
    assertNotNull(link2);
    assertEquals("http://test.com/foo.html", link2.href());
  }
View Full Code Here

    assertNotNull(link1);
    assertEquals("http://test.com/foo.html", link1.href());

    Link link2 = page.links().find(".baz");
    assertNotNull(link2);
    assertEquals("http://test.com/foo.html", link2.href());
  }

  @Test
  public void testLinkQueryByNameNotFound() {
    addPageRequest("http://test.com",
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.