Uses of Class
org.htmlunit.html.HtmlPage
Packages that use HtmlPage
Package
Description
Framework classes (contains the
WebClient
class which is the main entry point).Classes specific to HTML pages, particularly the
HtmlPage which represents
an HTML document and provides access to its content.Content Security Policy (CSP) support: the
ContentSecurityPolicy
of an HtmlPage (from the Content-Security-Policy headers and meta elements),
checks for scripts, styles, images, frames, connections and more against the policy,
and the reporting of violations to a ContentSecurityPolicyViolationListener.Contains the html parser interface.
Contains the neko html parser.
Classes in this package are specific to the JavaScript engine - users of HtmlUnit shouldn't
need anything in this package.
Implementations of the HTML JavaScript host objects - users of HtmlUnit shouldn't
need anything in this package.
Some special ScriptPreProcessor's to make this working with common js libs.
-
Uses of HtmlPage in org.htmlunit
Methods in org.htmlunit that return HtmlPageModifier and TypeMethodDescriptionprotected HtmlPageDefaultPageCreator.createHtmlPage(WebResponse webResponse, WebWindow webWindow) Creates an HtmlPage for this WebResponse.ScriptException.getPage()Gets the HTML page in which the script error occurred.
Caution: this page may be only partially parsed if the exception occurred in a script executed at parsing time.WebClient.loadHtmlCodeIntoCurrentWindow(String htmlCode) Parses the given XHtml code string and loads the resulting XHtmlPage into the current window.Methods in org.htmlunit with parameters of type HtmlPageModifier and TypeMethodDescriptionstatic voidWebAssert.assertAllAccessKeyAttributesUnique(HtmlPage page) Many HTML components can have anaccesskeyattribute which defines a hot key for keyboard navigation.static voidWebAssert.assertAllIdAttributesUnique(HtmlPage page) Verifies that all element IDs in the specified page are unique.static voidWebAssert.assertAllTabIndexAttributesSet(HtmlPage page) Many HTML elements are "tabbable" and can have atabindexattribute that determines the order in which the components are navigated when pressing the tab key.static voidWebAssert.assertElementNotPresent(HtmlPage page, String id) Verifies that the specified page does not contain an element with the specified ID.static voidWebAssert.assertElementNotPresentByXPath(HtmlPage page, String xpath) Verifies that the specified page does not contain an element matching the specified XPath expression.static voidWebAssert.assertElementPresent(HtmlPage page, String id) Verifies that the specified page contains an element with the specified ID.static voidWebAssert.assertElementPresentByXPath(HtmlPage page, String xpath) Verifies that the specified page contains an element matching the specified XPath expression.static voidWebAssert.assertFormNotPresent(HtmlPage page, String name) Verifies that the specified page does not contain a form with the specified name.static voidWebAssert.assertFormPresent(HtmlPage page, String name) Verifies that the specified page contains a form with the specified name.static voidWebAssert.assertInputContainsValue(HtmlPage page, String name, String value) Verifies that the first input element with the specified name on the specified page contains the specified value.static voidWebAssert.assertInputDoesNotContainValue(HtmlPage page, String name, String value) Verifies that the first input element with the specified name on the specified page does not contain the specified value.static voidWebAssert.assertInputNotPresent(HtmlPage page, String name) Verifies that the specified page does not contain an input element with the specified name.static voidWebAssert.assertInputPresent(HtmlPage page, String name) Verifies that the specified page contains an input element with the specified name.static voidWebAssert.assertLinkNotPresent(HtmlPage page, String id) Verifies that the specified page does not contain a link with the specified ID.static voidWebAssert.assertLinkNotPresentWithText(HtmlPage page, String text) Verifies that the specified page does not contain a link with the specified text.static voidWebAssert.assertLinkPresent(HtmlPage page, String id) Verifies that the specified page contains a link with the specified ID.static voidWebAssert.assertLinkPresentWithText(HtmlPage page, String text) Verifies that the specified page contains a link with the specified text.static voidWebAssert.assertTextNotPresent(HtmlPage page, String text) Verifies that the specified page does not contain the specified text.static voidWebAssert.assertTextNotPresentInElement(HtmlPage page, String text, String id) Verifies that the element on the specified page which matches the specified ID does not contain the specified text.static voidWebAssert.assertTextPresent(HtmlPage page, String text) Verifies that the specified page contains the specified text.static voidWebAssert.assertTextPresentInElement(HtmlPage page, String text, String id) Verifies that the element on the specified page which matches the specified ID contains the specified text.static voidWebAssert.assertTitleContains(HtmlPage page, String titlePortion) Verifies that the specified page's title contains the specified substring.static voidWebAssert.assertTitleEquals(HtmlPage page, String title) Verifies that the specified page's title equals the specified expected title.static voidWebAssert.assertTitleMatches(HtmlPage page, String regex) Verifies that the specified page's title matches the specified regular expression.voidPrintHandler.handlePrint(HtmlPage page) Handle a call to Window.print().ScriptPreProcessor.preProcess(HtmlPage htmlPage, String sourceCode, String sourceName, int lineNumber, HtmlElement htmlElement) Pre process the specified source code in the context of the given page.booleanAjaxController.processSynchron(HtmlPage page, WebRequest request, boolean async) Gets notified of an AJAX call to determine how it should be processed.booleanNicelyResynchronizingAjaxController.processSynchron(HtmlPage page, WebRequest settings, boolean async) Resynchronizes calls performed from the thread where this instance has been created.Constructors in org.htmlunit with parameters of type HtmlPageModifierConstructorDescriptionScriptException(HtmlPage page, Throwable throwable) Creates an instance.ScriptException(HtmlPage page, Throwable throwable, String scriptSourceCode) Creates an instance. -
Uses of HtmlPage in org.htmlunit.html
Subclasses of HtmlPage in org.htmlunit.htmlModifier and TypeClassDescriptionclassA representation of an XHTML page returned from a server.Methods in org.htmlunit.html that return HtmlPageModifier and TypeMethodDescriptionprotected HtmlPageHtmlPage.clone()Creates a clone of this instance, and clears cached state to be not shared with the original.HtmlPage.cloneNode(boolean deep) FrameWindow.getEnclosingPage()Returns the HTML page in which the <frame> or <iframe> tag is contained for this frame window.DomNode.getHtmlPageOrNull()Returns the page that contains this node.HtmlPage.getPage()Returns the page that contains this node.Methods in org.htmlunit.html with parameters of type HtmlPageModifier and TypeMethodDescriptionElementFromPointHandler.getElementFromPoint(HtmlPage htmlPage, int x, int y) Returns the element for the specified x coordinate and the specified y coordinate.static URLHtmlAnchor.getTargetUrl(String href, HtmlPage page) INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.static URLHyperlinkElementSupport.getTargetUrl(String href, HtmlPage page) Returns the calculated target url. -
Uses of HtmlPage in org.htmlunit.html.csp
Methods in org.htmlunit.html.csp with parameters of type HtmlPageModifier and TypeMethodDescriptionstatic voidContentSecurityPolicy.addMetaPolicy(HtmlPage page, String serializedPolicy) Adds a policy defined by a meta element to the given page.static booleanContentSecurityPolicy.allowsBaseUri(HtmlPage page, URL url) Checks if the given url is allowed as base url of the document (base-uri).static booleanContentSecurityPolicy.allowsConnection(HtmlPage page, URL url, URL reportedUrl) Checks if a connection (XMLHttpRequest, fetch(), ...) to the given url is allowed (connect-src).static booleanContentSecurityPolicy.allowsEval(HtmlPage page, String source, int lineNumber) Checks if the evaluation of strings as code (eval(), new Function(), setTimeout(string)) is allowed.static booleanContentSecurityPolicy.allowsExternalScript(HtmlPage page, DomElement element, URL url) Checks if the given external script is allowed.static booleanContentSecurityPolicy.allowsExternalScript(HtmlPage page, DomElement element, URL url, URL reportedUrl) Checks if the given external script is allowed.static booleanContentSecurityPolicy.allowsExternalStyle(HtmlPage page, DomElement element, URL url) Checks if loading the external stylesheet (link element or @import) is allowed (style-src-elem).static booleanContentSecurityPolicy.allowsExternalStyle(HtmlPage page, DomElement element, URL url, URL reportedUrl) Checks if loading the external stylesheet (link element or @import) is allowed (style-src-elem).static booleanContentSecurityPolicy.allowsFormAction(HtmlPage page, URL url, URL reportedUrl) Checks if the submission of a form to the given url is allowed (form-action).static booleanContentSecurityPolicy.allowsFrame(HtmlPage page, URL url) Checks if loading the given url into a frame or iframe is allowed (frame-src, with fallback to child-src and default-src).static booleanContentSecurityPolicy.allowsImage(HtmlPage page, URL url) Checks if loading the given image url is allowed (img-src, with fallback to default-src).static booleanContentSecurityPolicy.allowsImage(HtmlPage page, URL url, URL reportedUrl) Checks if loading the given image url is allowed (img-src, with fallback to default-src).static booleanContentSecurityPolicy.allowsInlineScript(HtmlPage page, DomElement element, String source) Checks if the given inline script is allowed.static booleanContentSecurityPolicy.allowsInlineStyle(HtmlPage page, DomElement element, String source) Checks if the inline style element (style-src-elem) is allowed.static booleanContentSecurityPolicy.allowsJavaScriptUrl(HtmlPage page, DomElement element, String source) Checks if the given javascript: url is allowed.static booleanContentSecurityPolicy.allowsScriptAsAttribute(HtmlPage page, DomElement element, String source) Checks if the given event handler attribute is allowed.static booleanContentSecurityPolicy.allowsStyleAttribute(HtmlPage page, DomElement element, String source) Checks if the style attribute (style-src-attr) is allowed.static booleanContentSecurityPolicy.allowsWorker(HtmlPage page, URL url) Checks if creating a worker with the given script url is allowed (worker-src, with fallback to child-src, script-src and default-src).static URLContentSecurityPolicy.upgradeInsecureNavigation(HtmlPage page, URL url) Upgrade Insecure Requests for top level navigations: the url is upgraded only if the host and port are the same as the host and port of the page (or of one of its ancestors) having the upgrade-insecure-requests directive.static voidContentSecurityPolicy.upgradeInsecureNavigationRedirects(HtmlPage page, WebRequest request) Upgrade Insecure Requests for the redirects of a top level navigation.static voidContentSecurityPolicy.upgradeInsecureRedirects(HtmlPage page, WebRequest request) Upgrade Insecure Requests for the redirects of a request (subresources, nested navigations and form submissions): the redirect targets are upgraded like the request itself.static URLContentSecurityPolicy.upgradeInsecureRequest(HtmlPage page, URL url) Upgrade Insecure Requests (upgrade-insecure-requests directive): returns the url to be used for a request of the page; used for subresources, nested navigations (frames) and form submissions. -
Uses of HtmlPage in org.htmlunit.html.parser
Methods in org.htmlunit.html.parser with parameters of type HtmlPageModifier and TypeMethodDescriptionvoidHTMLParser.parse(WebClient webClient, WebResponse webResponse, HtmlPage page, boolean xhtml, boolean createdByJavascript) Parses the WebResponse into an object tree representation. -
Uses of HtmlPage in org.htmlunit.html.parser.neko
Methods in org.htmlunit.html.parser.neko with parameters of type HtmlPageModifier and TypeMethodDescriptionvoidHtmlUnitNekoHtmlParser.parse(WebClient webClient, WebResponse webResponse, HtmlPage page, boolean xhtml, boolean createdByJavascript) Parses the WebResponse into an object tree representation. -
Uses of HtmlPage in org.htmlunit.javascript
Methods in org.htmlunit.javascript with parameters of type HtmlPageModifier and TypeMethodDescriptionJavaScriptEngine.callFunction(HtmlPage page, org.htmlunit.corejs.javascript.Function javaScriptFunction, org.htmlunit.corejs.javascript.Scriptable thisObject, Object[] args, DomNode node) Calls a JavaScript function and return the result.JavaScriptEngine.callFunction(HtmlPage page, org.htmlunit.corejs.javascript.Function function, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Scriptable thisObject, Object[] args) Calls the given function taking care of synchronization issues.final <T> THtmlUnitContextFactory.callSecured(org.htmlunit.corejs.javascript.ContextAction<T> action, HtmlPage page) Same asContextFactoryContextFactory.call(ContextAction)but with handling of some exceptions.final <T> TJavaScriptEngine.callSecured(org.htmlunit.corejs.javascript.ContextAction<T> action, HtmlPage page) Forwards this to theHtmlUnitContextFactorybut with checking shutdown handling.AbstractJavaScriptEngine.compile(HtmlPage owningPage, org.htmlunit.corejs.javascript.VarScope scope, String sourceCode, String sourceName, int startLine) Compiles the specified JavaScript code in the context of a given scope.org.htmlunit.corejs.javascript.ScriptJavaScriptEngine.compile(HtmlPage owningPage, org.htmlunit.corejs.javascript.VarScope scope, String sourceCode, String sourceName, int startLine) Compiles the specified JavaScript code in the context of a given scope.AbstractJavaScriptEngine.execute(HtmlPage page, org.htmlunit.corejs.javascript.VarScope scope, String sourceCode, String sourceName, int startLine) Executes the specified JavaScript code in the context of a given page.AbstractJavaScriptEngine.execute(HtmlPage page, org.htmlunit.corejs.javascript.VarScope scope, SCRIPT script) Executes the specified JavaScript code in the context of a given page.JavaScriptEngine.execute(HtmlPage page, org.htmlunit.corejs.javascript.VarScope scope, String sourceCode, String sourceName, int startLine) Executes the specified JavaScript code in the context of a given page.JavaScriptEngine.execute(HtmlPage page, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Script script) Executes the specified JavaScript code in the context of a given page.protected voidJavaScriptEngine.handleJavaScriptTimeoutError(HtmlPage page, TimeoutError e) Handles an exception that occurred during execution of JavaScript code.voidDefaultJavaScriptErrorListener.loadScriptError(HtmlPage page, URL scriptUrl, Exception exception) Informs about an exception during load of a javascript file refereed from a page.voidJavaScriptErrorListener.loadScriptError(HtmlPage page, URL scriptUrl, Exception exception) Informs about an exception during load of a javascript file refereed from a page.voidSilentJavaScriptErrorListener.loadScriptError(HtmlPage page, URL scriptUrl, Exception exception) voidDefaultJavaScriptErrorListener.malformedScriptURL(HtmlPage page, String url, MalformedURLException malformedURLException) Informs about a malformed url referencing to script.voidJavaScriptErrorListener.malformedScriptURL(HtmlPage page, String url, MalformedURLException malformedURLException) Informs about a malformed url referencing to script.voidSilentJavaScriptErrorListener.malformedScriptURL(HtmlPage page, String url, MalformedURLException malformedURLException) protected StringHtmlUnitContextFactory.preProcess(HtmlPage htmlPage, String sourceCode, String sourceName, int lineNumber, HtmlElement htmlElement) Pre process the specified source code in the context of the given page using the processor specified in theWebClient.voidDefaultJavaScriptErrorListener.scriptException(HtmlPage page, ScriptException scriptException) Informs about a javascript exceptions.voidJavaScriptErrorListener.scriptException(HtmlPage page, ScriptException scriptException) Informs about a javascript exceptions.voidSilentJavaScriptErrorListener.scriptException(HtmlPage page, ScriptException scriptException) voidDefaultJavaScriptErrorListener.timeoutError(HtmlPage page, long allowedTime, long executionTime) Informs about a javascript timeout error.voidJavaScriptErrorListener.timeoutError(HtmlPage page, long allowedTime, long executionTime) Informs about a javascript timeout error.voidSilentJavaScriptErrorListener.timeoutError(HtmlPage page, long allowedTime, long executionTime) -
Uses of HtmlPage in org.htmlunit.javascript.host.html
Methods in org.htmlunit.javascript.host.html that return HtmlPage -
Uses of HtmlPage in org.htmlunit.javascript.preprocessor
Methods in org.htmlunit.javascript.preprocessor with parameters of type HtmlPageModifier and TypeMethodDescriptionHtmxTwoZeroSevenScriptPreProcessor.preProcess(HtmlPage htmlPage, String sourceCode, String sourceName, int lineNumber, HtmlElement htmlElement) Pre process the specified source code in the context of the given page.