Package org.encog.bot.browse.range

Examples of org.encog.bot.browse.range.Form


   */
  protected final void loadForm(final int index, final Tag tag) {
    final String method = tag.getAttributeValue("method");
    final String action = tag.getAttributeValue("action");

    final Form form = new Form(this.page);
    form.setBegin(index);
    form.setEnd(findEndTag(index + 1, tag));

    if ((method == null) || method.equalsIgnoreCase("GET")) {
      form.setMethod(Form.Method.GET);
    } else {
      form.setMethod(Form.Method.POST);
    }

    if (action == null) {
      form.setAction(new Address(this.base));
    } else {
      form.setAction(new Address(this.base, action));
    }

    this.page.addContent(form);
    this.lastForm = form;
  }
View Full Code Here


  {
    Browser b = new Browser();
    b.navigate(new URL("http://www.httprecipes.com/1/7/get.php"));
    WebPage page = b.getCurrentPage();
    Assert.assertTrue( page.getTitle().getTextOnly().indexOf("HTTP")!=-1 );
    Form form = (Form)page.find(Form.class, 0);
    Input input1 = form.findType("text", 0);   
    input1.setValue("New York");
    b.navigate(form);
    page = b.getCurrentPage();
    Assert.assertTrue( page.getTitle().getTextOnly().indexOf("HTTP")!=-1 );
  }
View Full Code Here

   */
  protected final void loadForm(final int index, final Tag tag) {
    final String method = tag.getAttributeValue("method");
    final String action = tag.getAttributeValue("action");

    final Form form = new Form(this.page);
    form.setBegin(index);
    form.setEnd(findEndTag(index + 1, tag));

    if ((method == null) || method.equalsIgnoreCase("GET")) {
      form.setMethod(Form.Method.GET);
    } else {
      form.setMethod(Form.Method.POST);
    }

    if (action == null) {
      form.setAction(new Address(this.base));
    } else {
      form.setAction(new Address(this.base, action));
    }

    this.page.addContent(form);
    this.lastForm = form;
  }
View Full Code Here

TOP

Related Classes of org.encog.bot.browse.range.Form

Copyright © 2018 www.massapicom. 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.