Package com.gargoylesoftware.htmlunit.html

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


        //testing the static part of the gallery
        final String pageAsXml = page.asXml();
        assertTrue(pageAsXml.contains("<a href=\"javascript:displayGallery()\" onmouseover=\"document.index.src=index_on.src\" onmouseout=\"document.index.src=index_off.src\" onmousedown=\"beforeClick();\">"));
        assertTrue(pageAsXml.contains("<body onload=\"initGallery()\">"));
        final String pageAsText = page.asText();
        assertTrue(pageAsText.contains("Apache PhotArk Gallery"));

        Thread.sleep(3000);
        //testing the dynamic part of the gallery
View Full Code Here


   Select.setSelectedAttribute("1", true);
   list = Select.getOptions();
   /*for(HtmlOption ho: list){
     System.out.println(ho.asText());
   }*/
   System.out.println(queryPage.asText());
  
   /* 
   //Professores
   List<HtmlRadioButtonInput> radioButtonList = form.getRadioButtonsByName("S15_");
View Full Code Here

    public void testSmokes()
        throws Exception
    {
        client.setThrowExceptionOnFailingStatusCode( false );
        HtmlPage page = client.getPage( baseUrl + "index.html" );
        assertTrue( page.asText().contains( "Hello World" ) );
    }
}
View Full Code Here

    public void testSmokes()
        throws Exception
    {
        client.setThrowExceptionOnFailingStatusCode( false );
        HtmlPage page = client.getPage( baseUrl + "index.html" );
        assertFalse( page.asText().contains( "Hello World" ) );
    }
}
View Full Code Here

    public void testNoScript() throws Exception {
        WebClient wc = startWebClient();
        wc.setJavaScriptEnabled(false);
        wc.setCssEnabled(true);
        HtmlPage page = wc.getPage(url("/tools/Tools.action"));
        assertTrue(page.asText().contains("The tools on this page are only usable with JavaScript enabled"));
        assertFalse(page.asText().contains("Type a password in the field below"));

        wc.setJavaScriptEnabled(true);
        page = wc.getPage(url("/tools/Tools.action"));
        assertFalse(page.asText().contains("The tools on this page are only usable with JavaScript enabled"));
View Full Code Here

        WebClient wc = startWebClient();
        wc.setJavaScriptEnabled(false);
        wc.setCssEnabled(true);
        HtmlPage page = wc.getPage(url("/tools/Tools.action"));
        assertTrue(page.asText().contains("The tools on this page are only usable with JavaScript enabled"));
        assertFalse(page.asText().contains("Type a password in the field below"));

        wc.setJavaScriptEnabled(true);
        page = wc.getPage(url("/tools/Tools.action"));
        assertFalse(page.asText().contains("The tools on this page are only usable with JavaScript enabled"));
        assertTrue(page.asText().contains("Type a password in the field below"));
View Full Code Here

        assertTrue(page.asText().contains("The tools on this page are only usable with JavaScript enabled"));
        assertFalse(page.asText().contains("Type a password in the field below"));

        wc.setJavaScriptEnabled(true);
        page = wc.getPage(url("/tools/Tools.action"));
        assertFalse(page.asText().contains("The tools on this page are only usable with JavaScript enabled"));
        assertTrue(page.asText().contains("Type a password in the field below"));
    }

    @Test
    public void testEvalPassword() throws Exception {
View Full Code Here

        assertFalse(page.asText().contains("Type a password in the field below"));

        wc.setJavaScriptEnabled(true);
        page = wc.getPage(url("/tools/Tools.action"));
        assertFalse(page.asText().contains("The tools on this page are only usable with JavaScript enabled"));
        assertTrue(page.asText().contains("Type a password in the field below"));
    }

    @Test
    public void testEvalPassword() throws Exception {
        WebClient wc = startWebClient();
View Full Code Here

    @Test
    public void testGeneratePassword() throws Exception {
        WebClient wc = startWebClient();
        HtmlPage page = wc.getPage(url("/tools/Tools.action"));
        wc.waitForBackgroundJavaScript(10000L);
        assertFalse(page.asText().contains("Generated password:"));
        page.getHtmlElementById("generatePasswordButton").click();
        wc.waitForBackgroundJavaScript(10000L);
        assertTrue(page.asText().contains("Generated password:"));
        assertTrue(page.getHtmlElementById("generatedPasswordStrength").asText().contains("93 %"));
    }
View Full Code Here

        HtmlPage page = wc.getPage(url("/tools/Tools.action"));
        wc.waitForBackgroundJavaScript(10000L);
        assertFalse(page.asText().contains("Generated password:"));
        page.getHtmlElementById("generatePasswordButton").click();
        wc.waitForBackgroundJavaScript(10000L);
        assertTrue(page.asText().contains("Generated password:"));
        assertTrue(page.getHtmlElementById("generatedPasswordStrength").asText().contains("93 %"));
    }

    @Test
    public void testGeneratePasswordButtonEnabledHandler() throws Exception {
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.