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

Method cloneNode

src/test/java/org/htmlunit/WebClient8Test.java:78–97  ·  view source on GitHub ↗

@throws Exception if something goes wrong

()

Source from the content-addressed store, hash-verified

76 * @throws Exception if something goes wrong
77 */
78 @Test
79 public void cloneNode() throws Exception {
80 final String html = DOCTYPE_HTML
81 + "<html>\n"
82 + "<head><title>foo</title></head>\n"
83 + "<body>\n"
84 + "<p>hello world</p>\n"
85 + "</body></html>";
86
87 try (WebClient webClient = new WebClient(getBrowserVersion(), false, null, -1)) {
88 final HtmlPage page = loadPage(webClient, html, null, URL_FIRST);
89
90 final String org = page.asXml();
91
92 final HtmlPage clonedPage = page.cloneNode(true);
93 final String clone = clonedPage.asXml();
94
95 assertEquals(org, clone);
96 }
97 }
98
99 /**
100 * @throws Exception if something goes wrong

Callers 15

sarissa.jsFile · 0.45
sarissa.jsFile · 0.45
manipulation.jsFile · 0.45
support.jsFile · 0.45
dojo.jsFile · 0.45
jquery-1.7.2.jsFile · 0.45
jquery-1.8.1.jsFile · 0.45
jquery.jsFile · 0.45
jquery-1.9.1.jsFile · 0.45
testAppendForObjectFunction · 0.45

Calls 5

cloneNodeMethod · 0.95
getBrowserVersionMethod · 0.45
loadPageMethod · 0.45
asXmlMethod · 0.45
assertEqualsMethod · 0.45

Tested by

no test coverage detected