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

Method assertTextNotPresent

src/main/java/org/htmlunit/WebAssert.java:229–234  ·  view source on GitHub ↗

Verifies that the specified page does not contain the specified text. @param page the page to check @param text the text to check for @throws AssertionError if the page contains the specified text @throws NullPointerException if page or text is null

(final HtmlPage page, final String text)

Source from the content-addressed store, hash-verified

227 * @throws NullPointerException if page or text is null
228 */
229 public static void assertTextNotPresent(final HtmlPage page, final String text) {
230 if (page.asNormalizedText().contains(text)) {
231 final String msg = "Found unexpected text '" + text + "' on the page.";
232 throw new AssertionError(msg);
233 }
234 }
235
236 /**
237 * Verifies that the element on the specified page which matches the specified ID does not

Callers 1

assertTextNotPresentMethod · 0.95

Calls 2

containsMethod · 0.65
asNormalizedTextMethod · 0.45

Tested by 1

assertTextNotPresentMethod · 0.76