Package com.gistlabs.mechanize.document.link

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


   
    AbstractDocument page = agent().get("http://test.com");
    assertEquals(1, page.links().size());
    Link link = page.links().find(byIdOrClass("t"));
    assertNotNull(link);
    Resource myPage = link.click();
    assertEquals("My Page", myPage.getTitle());
  }

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


    addPageRequest("http://test.com/myPage.html", newHtml("My Page", ""));
   
    AbstractDocument page = agent().get("http://test.com");
    Link link = page.links().find(contains("myPage"));
    assertNotNull(link);
    Resource myPage = link.click();
    assertEquals("My Page", myPage.getTitle());
  }
 
  @Test
  public void testFollowingAnRelativeLinkWithBaseSetInHtmlPage() {
View Full Code Here

    addPageRequest("http://www1.test.com/myPage.html", newHtml("My Page", ""));
   
    AbstractDocument page = agent().get("http://test.com");
    Link link = page.links().get(0);
    assertNotNull(link);
    Resource myPage = link.click();
    assertEquals("My Page", myPage.getTitle());
  }

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

    addPageRequest("http://www1.test.com/myPage.html", newHtml("My Page", ""));
   
    AbstractDocument page = agent().get("http://test.com");
    Link link = page.links().find(contains("myPage"));
    assertNotNull(link);
    Resource myPage = link.click();
    assertEquals("My Page", myPage.getTitle());
  }

}
View Full Code Here

    assertTrue(page.size() > 10000);
    Links links = page.links();
    assertTrue(links.size() > 10);
    Link link = links.find("*[title*='English']");
    assertNotNull(link);
    Resource englishPage = link.click();
    assertEquals("Wikipedia, the free encyclopedia", englishPage.getTitle());
  }

  @Test
  public void testSearchingWikipediaForAngelaMerkelInGermanLanguageUtilizingSelectAndTextInput() {
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.