MCPcopy Create free account
hub / github.com/HtmlUnit/htmlunit / textContent

Method textContent

src/test/java/org/htmlunit/html/DomAttrTest.java:43–54  ·  view source on GitHub ↗

@throws Exception if the test fails

()

Source from the content-addressed store, hash-verified

41 * @throws Exception if the test fails
42 */
43 @Test
44 public void textContent() throws Exception {
45 final String html = DOCTYPE_HTML + "<html id='foo'><body></body></html>";
46 final HtmlPage page = loadPage(html);
47 final DomAttr attr = page.getDocumentElement().getAttributeNode("id");
48
49 assertEquals("foo", attr.getTextContent());
50 attr.setTextContent("hello");
51 assertEquals("hello", attr.getTextContent());
52
53 assertEquals(page.getDocumentElement(), page.getHtmlElementById("hello"));
54 }
55}

Callers

nothing calls this directly

Calls 7

getDocumentElementMethod · 0.95
getTextContentMethod · 0.95
setTextContentMethod · 0.95
getHtmlElementByIdMethod · 0.95
loadPageMethod · 0.45
getAttributeNodeMethod · 0.45
assertEqualsMethod · 0.45

Tested by

no test coverage detected