Examples of InputTag


Examples of org.htmlparser.tags.InputTag

  }

  public void testToHTML() throws ParserException {
    parseAndAssertNodeCount(1);
    assertTrue("Node 1 should be INPUT Tag", node[0] instanceof InputTag);
    InputTag InputTag;
    InputTag = (InputTag) node[0];
    assertEquals("HTML String", "<INPUT NAME=\"Google\" TYPE=\"text\">", InputTag.toHtml());
  }
View Full Code Here

Examples of org.htmlparser.tags.InputTag

  }

  public void testToString() throws ParserException {
    parseAndAssertNodeCount(1);
    assertTrue("Node 1 should be INPUT Tag", node[0] instanceof InputTag);
    InputTag InputTag;
    InputTag = (InputTag) node[0];
    assertEquals("HTML Raw String", "INPUT TAG\n--------\nNAME : Google\nTYPE : text\n", InputTag.toString());
  }
View Full Code Here

Examples of org.htmlparser.tags.InputTag

    createParser(testHTML);
    parser.addScanner(new InputTagScanner("-i"));

    parseAndAssertNodeCount(1);
    assertTrue("Node 1 should be INPUT Tag", node[0] instanceof InputTag);
    InputTag InputTag;
    InputTag = (InputTag) node[0];
    assertStringEquals("HTML String", "<INPUT CHECKED=\"\" NAME=\"cbCheck\" TYPE=\"checkbox\">", InputTag.toHtml());
  }
View Full Code Here

Examples of org.htmlparser.tags.InputTag

    ids[0] = "INPUT";
    return ids;
  }

  protected Tag createTag(TagData tagData, Tag tag, String url) throws ParserException {
    return new InputTag(tagData);
  }
View Full Code Here

Examples of org.htmlparser.tags.InputTag

          + "\n and is :" + ((Node) object).toHtml());
    }
  }

  protected void assertHiddenIDTagPresent(FormTag formTag, String name, String inputTagValue) {
    InputTag inputTag = formTag.getInputTag(name);
    assertNotNull("Hidden Tag " + name + " should have been there", inputTag);
    assertStringEquals("Hidden Tag Contents", inputTagValue, inputTag.getAttribute("VALUE"));
    assertStringEquals("Hidden Tag Type", "hidden", inputTag.getAttribute("TYPE"));
  }
View Full Code Here

Examples of org.htmlparser.tags.InputTag

    assertTrue("Node 0 should be Form Tag", node[0] instanceof FormTag);
    FormTag formTag = (FormTag) node[0];
    assertStringEquals("Method", FormTag.POST, formTag.getFormMethod());
    assertStringEquals("Location", "http://www.google.com/test/do_login.php", formTag.getFormLocation());
    assertStringEquals("Name", "login_form", formTag.getFormName());
    InputTag nameTag = formTag.getInputTag("name");
    InputTag passwdTag = formTag.getInputTag("passwd");
    InputTag submitTag = formTag.getInputTag("submit");
    InputTag dummyTag = formTag.getInputTag("dummy");
    assertNotNull("Input Name Tag should not be null", nameTag);
    assertNotNull("Input Password Tag should not be null", passwdTag);
    assertNotNull("Input Submit Tag should not be null", submitTag);
    assertNull("Input dummy tag should be null", dummyTag);
View Full Code Here

Examples of org.htmlparser.tags.InputTag

    parser.addScanner(scanner);
    parseAndAssertNodeCount(1);
    assertTrue(node[0] instanceof InputTag);

    // check the input node
    InputTag inputTag = (InputTag) node[0];
    assertEquals("Input Scanner", scanner, inputTag.getThisScanner());
    assertEquals("Type", "text", inputTag.getAttribute("TYPE"));
    assertEquals("Name", "Google", inputTag.getAttribute("NAME"));
  }
View Full Code Here

Examples of org.htmlparser.tags.InputTag

          binUrlStr = image.getImageURL();
        } else if (node instanceof AppletTag) {
          AppletTag applet = (AppletTag) node;
          binUrlStr = applet.getAppletClass();
        } else if (node instanceof InputTag) {
          InputTag input = (InputTag) node;
          // we check the input tag type for image
          String strType = input.getAttribute("type");
          if (strType != null && strType.equalsIgnoreCase("image")) {
            // then we need to download the binary
            binUrlStr = input.getAttribute("src");
          }
        } else if (node instanceof LinkTag) {
          LinkTag link = (LinkTag) node;
          if (link.getChild(0) instanceof ImageTag) {
            ImageTag img = (ImageTag) link.getChild(0);
View Full Code Here

Examples of org.htmlparser.tags.InputTag

                  FormTag form = (FormTag) ni.nextNode();
                  String fragment = "action:"+form.getAttribute("action")+" method:"+form.getAttribute("method");
                  _model.addFragment(url, id, FragmentsModel.KEY_FORMS,fragment );
                }
                for (NodeIterator ni = inputs.elements(); ni.hasMoreNodes(); ) {
                  InputTag tag = (InputTag) ni.nextNode();
                  String type = tag.getAttribute("type");
                  if( "hidden".equals(type))
                  {
                    String fragment = tag.toHtml();
                    _model.addFragment(url, id, FragmentsModel.KEY_HIDDENFIELD, fragment);
                  }
                  if("file".equals(type))
                  {
                    String fragment = tag.toHtml();
                    _model.addFragment(url, id, FragmentsModel.KEY_FILEUPLOAD, fragment);
                  }
                }
            } catch (ParserException pe) {
                _logger.warning("Looking for fragments, got '" + pe + "'");
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.