Examples of InputTag


Examples of org.htmlparser.tags.InputTag

        parser.setNodeFactory (
            new PrototypicalNodeFactory (
                new Tag[]
                {
                    new FormTag (),
                    new InputTag (),
                    new TextareaTag (),
                    new SelectTag (),
                    new OptionTag (),
                    new LinkTag (),
                    new TableTag (),
View Full Code Here

Examples of org.htmlparser.tags.InputTag

        parser.setNodeFactory (
            new PrototypicalNodeFactory (
                new Tag[]
                {
                    new FormTag (),
                    new InputTag (),
                    new TextareaTag (),
                    new SelectTag (),
                    new OptionTag (),
                    new TableTag (),
                }));
View Full Code Here

Examples of org.htmlparser.tags.InputTag

        parser.setNodeFactory (
            new PrototypicalNodeFactory (
                new Tag[]
                {
                    new FormTag (),
                    new InputTag (),
                    new TextareaTag (),
                    new SelectTag (),
                    new OptionTag (),
                }));
        parseAndAssertNodeCount(1);
View Full Code Here

Examples of org.htmlparser.tags.InputTag

        parser.setNodeFactory (
            new PrototypicalNodeFactory (
                new Tag[]
                {
                    new FormTag (),
                    new InputTag (),
                    new TextareaTag (),
                    new SelectTag (),
                    new OptionTag (),
                }));
        parseAndAssertNodeCount(1);
View Full Code Here

Examples of org.htmlparser.tags.InputTag

     */
    public void testTextArea () throws Exception
    {
        FormTag formTag;
        NodeList nl;
        InputTag inpTag;
        TextareaTag texTag;
       
        String html = "<body onload=\"otextnloadHandler()\" onunload=\"closeAdvanced()\">\n" +
            "  <form name=\"searchForm\" onsubmit=\"doSearch()\">\n" +
            "    <table id=\"searchTable\" align=\"left\" valign=\"middle\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n" +
            "      <tbody><tr nowrap=\"\" valign=\"middle\">\n" +
            "        <td id=\"searchTD\">\n" +
            "          <label id=\"searchLabel\" for=\"searchWord\">\n" +
            "           Search:\n" +
            "          </label>\n" +
            "        </td>\n" +
            "\n" +
            "        <td>\n" +
            "          <input type=\"text\" id=\"searchWord\" name=\"searchWord\" value=\"\" size=\"24\" maxlength=\"256\" alt=\"Search Expression\">\n" +
            "        </td>\n" +
            // note: this was added as there weren't any textarea tags in the page referenced
            "        <td>\n" +
            "          <textarea name=\"mytextarea\" rows=\"1\" cols=\"12\" alt=\"Free Form Text\">\n" +
            "             The text.\n" +
            "          </textarea>\n" +
            "        </td>\n" +
            "        <td>\n" +
            "           <input type=\"button\" onclick=\"this.blur();doSearch()\" value=\"GO\" id=\"go\" alt=\"GO\">\n" +
            "          <input type=\"hidden\" name=\"maxHits\" value=\"500\">\n" +
            "        </td>\n" +
            "        <td nowrap=\"nowrap\">\n" +
            "\n" +
            "          <a id=\"scopeLabel\" href=\"javascript:openAdvanced();\" title=\"Search only the following topics\" alt=\"Search only the following topics\" onmouseover=\"window.status='Search only the following topics'; return true;\" onmouseout=\"window.status='';\">Search scope:</a>\n" +
            "        </td>\n" +
            "        <td nowrap=\"nowrap\">\n" +
            "          <input type=\"hidden\" name=\"workingSet\" value=\"All topics\">\n" +
            "          <div id=\"scope\">All topics</div>\n" +
            "        </td>\n" +
            "      </tr>\n" +
            "\n" +
            "    </tbody></table>\n" +
            "  </form>\n" +
            "\n" +
            "</body>\n";
        createParser (html);
        formTag =
            (FormTag)(parser.extractAllNodesThatMatch (new NodeClassFilter (
                FormTag.class
            )).elementAt (0));
        assertNotNull ("Should have found a form tag",formTag);
        assertStringEquals ("name", "searchForm", formTag.getFormName ());
        nl = formTag.getFormInputs ();
        assertTrue ("4 inputs", 4 == nl.size ());
        inpTag = (InputTag)nl.elementAt (0);
        assertStringEquals ("name", "searchWord", inpTag.getAttribute ("name"));
        assertStringEquals ("value", "", inpTag.getAttribute ("value"));
        inpTag = (InputTag)nl.elementAt (1);
        assertNull ("name", inpTag.getAttribute ("name"));
        assertStringEquals ("value", "GO", inpTag.getAttribute ("value"));
        inpTag = (InputTag)nl.elementAt (2);
        assertStringEquals ("name", "maxHits", inpTag.getAttribute ("name"));
        assertStringEquals ("value", "500", inpTag.getAttribute ("value"));
        inpTag = (InputTag)nl.elementAt (3);
        assertStringEquals ("name", "workingSet", inpTag.getAttribute ("name"));
        assertStringEquals ("value", "All topics", inpTag.getAttribute ("value"));
        nl = formTag.getFormTextareas ();
        assertTrue ("1 textarea", 1 == nl.size ());
        texTag = (TextareaTag)nl.elementAt (0);
        assertStringEquals ("name", "mytextarea", texTag.getAttribute ("name"));
        assertTrue ("only 1 child", 1 == texTag.getChildCount ());
View Full Code Here

Examples of org.htmlparser.tags.InputTag

     */
    public void testInputInTable () throws Exception
    {
        FormTag formTag;
        NodeList nl;
        InputTag inpTag;

        String html = "<html>\n" +
            "<body>\n" +
            "<form action=\"/cgi-bin/test.pl\" method=\"post\">\n" +
            "<table><tr><td>\n" +
            "<INPUT type=hidden NAME=\"test1\" VALUE=\"insidetable\">\n" +
            "</td></tr>\n" +
            "</table>\n" +
            "<INPUT type=hidden NAME=\"Test2\"\n" +
            "VALUE=\"outsidetable\">\n" +
            "<INPUT type=hidden name=\"a\" value=\"b\">\n" +
            "</form>\n" +
            "</body>\n" +
            "</html>\n";
        createParser (html);
        formTag =
            (FormTag)(parser.extractAllNodesThatMatch (new NodeClassFilter (
                FormTag.class
            )).elementAt (0));
        assertNotNull ("Should have found a form tag",formTag);
        nl = formTag.getFormInputs ();
        assertTrue ("3 inputs", 3 == nl.size ());
        inpTag = (InputTag)nl.elementAt (0);
        assertStringEquals ("name", "test1", inpTag.getAttribute ("name"));
        assertStringEquals ("value", "insidetable", inpTag.getAttribute ("value"));
        inpTag = (InputTag)nl.elementAt (1);
        assertStringEquals ("name", "Test2", inpTag.getAttribute ("name"));
        assertStringEquals ("value", "outsidetable", inpTag.getAttribute ("value"));
        inpTag = (InputTag)nl.elementAt (2);
        assertStringEquals ("name", "a", inpTag.getAttribute ("name"));
        assertStringEquals ("value", "b", inpTag.getAttribute ("value"));
    }
View Full Code Here

Examples of org.htmlparser.tags.InputTag

    {
        String testHTML = "<INPUT type=\"text\" name=\"Google\">";
        createParser(testHTML);
        parseAndAssertNodeCount(1);
        assertTrue("Node 1 should be INPUT Tag",node[0] instanceof InputTag);
        InputTag InputTag;
        InputTag = (InputTag) node[0];
        assertStringEquals ("HTML String",testHTML,InputTag.toHtml());
    }
View Full Code Here

Examples of org.htmlparser.tags.InputTag

            +"name=\"cbCheck\" checked>";
        createParser(testHTML);
        parseAndAssertNodeCount(1);
        assertTrue("Node 1 should be INPUT Tag",
            node[0] instanceof InputTag);
        InputTag InputTag;
        InputTag = (InputTag) node[0];
        assertStringEquals("HTML String", testHTML, InputTag.toHtml());
    }
View Full Code Here

Examples of org.htmlparser.tags.InputTag

        createParser("<INPUT type=\"text\" name=\"Google\">","http://www.google.com/test/index.html");
        parseAndAssertNodeCount(1);
        assertTrue(node[0] instanceof InputTag);

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

Examples of org.htmlparser.tags.InputTag

        parser.setNodeFactory (
            new PrototypicalNodeFactory (
                new Tag[]
                {
                    new Div (),
                    new InputTag (),
                }));
        parseAndAssertNodeCount(1);
        assertType("node should be div",Div.class,node[0]);
        Div div = (Div)node[0];
        assertType("child not input",InputTag.class,div.getChild (0));
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.