Examples of asText()


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

        assertEquals( "section", div.getAttribute( "class" ) );

        HtmlHeading3 h3 = (HtmlHeading3) elementIterator.next();
        assertNotNull( h3 );
        // Note: htmlunit strips the white space, actual result is ok
        assertEquals( "SubSection formatting: italicboldmono", h3.asText().trim() );

        a = (HtmlAnchor) elementIterator.next();
        assertEquals( "SubSection_formatting:_italic_bold_mono", a.getAttribute( "name" ) );

        italic = (HtmlItalic) elementIterator.next();
View Full Code Here

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

        assertNotNull( div );
        assertEquals( div.getAttribute( "class" ), "section" );

        HtmlHeading4 h4 = (HtmlHeading4) elementIterator.next();
        assertNotNull( h4 );
        assertEquals( h4.asText().trim(), "Entities" );

        a = (HtmlAnchor) elementIterator.next();
        assertNotNull( a );
        assertEquals( a.getAttribute( "name" ), "Entities" );
View Full Code Here

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

        a = (HtmlAnchor) elementIterator.next();
        assertEquals( "Section_formatting:_italic_bold_mono", a.getAttribute( "name" ) );

        HtmlItalic italic = (HtmlItalic) elementIterator.next();
        assertEquals( "i", italic.getTagName() );
        assertEquals( "italic", italic.asText().trim() );

        HtmlBold bold = (HtmlBold) elementIterator.next();
        assertEquals( "b", bold.getTagName() );
        assertEquals( "bold", bold.asText().trim() );
View Full Code Here

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

   
    final IStringVerifier verifier = getVerifier(false);
    for (final Iterator iter=labels.iterator(); iter.hasNext();)
    {
      final HtmlLabel label = (HtmlLabel) iter.next();
      if (verifier.verifyStrings(labelText, label.asText()))
      {
        LOG.debug("Found label with matching text, examining the associated field: " + label);
        final HtmlElement target = label.getReferencedElement();
        if (keepField(target))
        {
View Full Code Here

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

        assertNotNull(element);
        assertEquals("choice description", ((HtmlElement) element.selectSingleNode("td/div")).getAttribute("description"));
        assertEquals("choice", ((HtmlElement) element.selectSingleNode("td[@class='setting-name']")).getTextContent());
        HtmlOption opt = (HtmlOption)element.selectSingleNode("td/div/select/option[@value='Choice <2>']");
        assertNotNull(opt);
        assertEquals("Choice <2>", opt.asText());
        opt.setSelected(true);

        submit(form);
        Queue.Item q = hudson.getQueue().getItem(project);
        if (q != null) q.getFuture().get();
View Full Code Here

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

    }

    @Test
    public void testWebConsolePlugin() throws IOException {
        final HtmlPage page = webClient.getPage(prepareUrl(PLUGIN_SUFFIX));
        String text = page.asText();

        //Filter name should be part of Filter table
        assertTrue(text.contains("WebConsoleTestTurboFilter"));

        //Console name should be part of console table
View Full Code Here

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

    }

    @Test
    public void testPrinter() throws IOException {
        final HtmlPage page = webClient.getPage(prepareUrl(PRINTER_SUFFIX));
        String text = page.asText();

        //Should dump content of configured file testremote.log
        //with its name
        assertTrue(text.contains("testremote.log"));
    }
View Full Code Here

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

    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

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

    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

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

  }

  @Test
  public void testPipelining() throws Exception {
    HtmlPage page = executePageTest("pipeliningTest", null);
    JSONArray array = new JSONArray(page.asText());
    assertEquals(3, array.length());
    Map<String, JSONObject> jsonObjects = Maps.newHashMap();
    for (int i = 0; i < array.length(); i++) {
      JSONObject jsonObj = array.getJSONObject(i);
      assertTrue(jsonObj.has("id"));
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.