Examples of executeJavaScript()


Examples of chrriis.dj.nativeswing.swtimpl.components.JWebBrowser.executeJavascript()

    configurationPanel.add(scrollPane, BorderLayout.CENTER);
    JPanel configurationButtonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 5, 2));
    JButton executeJavascriptButton = new JButton("Execute Javascript");
    executeJavascriptButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        webBrowser.executeJavascript(configurationTextArea.getText());
      }
    });
    configurationButtonPanel.add(executeJavascriptButton);
    JCheckBox enableJavascriptCheckBox = new JCheckBox("Enable Javascript", true);
    enableJavascriptCheckBox.addItemListener(new ItemListener() {
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScript()

public class BehaviorTest extends HudsonTestCase {
    public void testCssSelectors() throws Exception {
        HtmlPage p = createWebClient().goTo("self/testCssSelectors");

        // basic class selector, that we use the most often
        assertEquals(2,asInt(p.executeJavaScript("findElementsBySelector($('test1'),'.a',true).length")));
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test1'),'.a',false).length")));

        // 'includeSelf' should only affect the first axis and not afterward
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test2'),'.a .b',true).length")));
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test2'),'.a .b',false).length")));
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScript()

    public void testCssSelectors() throws Exception {
        HtmlPage p = createWebClient().goTo("self/testCssSelectors");

        // basic class selector, that we use the most often
        assertEquals(2,asInt(p.executeJavaScript("findElementsBySelector($('test1'),'.a',true).length")));
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test1'),'.a',false).length")));

        // 'includeSelf' should only affect the first axis and not afterward
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test2'),'.a .b',true).length")));
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test2'),'.a .b',false).length")));
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScript()

        // basic class selector, that we use the most often
        assertEquals(2,asInt(p.executeJavaScript("findElementsBySelector($('test1'),'.a',true).length")));
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test1'),'.a',false).length")));

        // 'includeSelf' should only affect the first axis and not afterward
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test2'),'.a .b',true).length")));
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test2'),'.a .b',false).length")));

        // tag.class. Should exclude itself anyway even if it's included
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test3'),'P.a',true).length")));
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test3'),'P.a',false).length")));
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScript()

        assertEquals(2,asInt(p.executeJavaScript("findElementsBySelector($('test1'),'.a',true).length")));
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test1'),'.a',false).length")));

        // 'includeSelf' should only affect the first axis and not afterward
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test2'),'.a .b',true).length")));
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test2'),'.a .b',false).length")));

        // tag.class. Should exclude itself anyway even if it's included
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test3'),'P.a',true).length")));
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test3'),'P.a',false).length")));
    }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScript()

        // 'includeSelf' should only affect the first axis and not afterward
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test2'),'.a .b',true).length")));
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test2'),'.a .b',false).length")));

        // tag.class. Should exclude itself anyway even if it's included
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test3'),'P.a',true).length")));
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test3'),'P.a',false).length")));
    }

    private int asInt(ScriptResult r) {
        return ((Double)r.getJavaScriptResult()).intValue();
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScript()

        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test2'),'.a .b',true).length")));
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test2'),'.a .b',false).length")));

        // tag.class. Should exclude itself anyway even if it's included
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test3'),'P.a',true).length")));
        assertEquals(1,asInt(p.executeJavaScript("findElementsBySelector($('test3'),'P.a',false).length")));
    }

    private int asInt(ScriptResult r) {
        return ((Double)r.getJavaScriptResult()).intValue();
    }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScript()

     * even when multiple nodes are added.
     */
    public void testBehaviour() throws Exception {
        HtmlPage p = createWebClient().goTo("self/testBehaviour");

        p.executeJavaScript("renderOnDemand(document.getElementsBySelector('.lazy')[0])");
        // all AJAX calls complete before the above method returns

        ScriptResult r = p.executeJavaScript("var r=document.getElementsBySelector('DIV.a'); r[0].innerHTML+r[1].innerHTML+r[2].innerHTML");
        assertEquals("AlphaBravoCharlie",r.getJavaScriptResult().toString());
    }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScript()

        HtmlPage p = createWebClient().goTo("self/testBehaviour");

        p.executeJavaScript("renderOnDemand(document.getElementsBySelector('.lazy')[0])");
        // all AJAX calls complete before the above method returns

        ScriptResult r = p.executeJavaScript("var r=document.getElementsBySelector('DIV.a'); r[0].innerHTML+r[1].innerHTML+r[2].innerHTML");
        assertEquals("AlphaBravoCharlie",r.getJavaScriptResult().toString());
    }
}
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScript()

        verifyTotal(webClient, jsCoverPage, 15, branchPercentage1, functionPercentage1);

        page.getHtmlElementById("radio3").click();
        webClient.waitForBackgroundJavaScript(100);

        jsCoverPage.executeJavaScript("jscoverage_recalculateSummaryTab();");
        webClient.waitForBackgroundJavaScript(500);
        verifyTotal(webClient, jsCoverPage, 73, branchPercentage2, functionPercentage2);
    }

    @Test
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.