Package com.gistlabs.mechanize.document

Examples of com.gistlabs.mechanize.document.AbstractDocument.form()


    addPageRequest("http://test.com",
        newHtml("Test Page", "<form action=\"form\" id=\"form\"></form>"));
   
    AbstractDocument page = agent().get("http://test.com");
   
    assertNull(page.form("foo"));
    assertNotNull(page.form("form"));
  }

}
View Full Code Here


        newHtml("Test Page", "<form action=\"form\" id=\"form\"></form>"));
   
    AbstractDocument page = agent().get("http://test.com");
   
    assertNull(page.form("foo"));
    assertNotNull(page.form("form"));
  }

}
View Full Code Here

  @Test
  public void testGooglePageSearchForm() {
    Mechanize agent = new MechanizeAgent();
    AbstractDocument page = agent.get("http://www.google.com");
    Form form = page.form("f");
    form.get("q").set("mechanize java");
    Resource response = form.submit();
    assertTrue(response.getTitle().startsWith("mechanize java"));
  }
}
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.