public void assertErrorContains(String msg) { assertThat(signupForm.getPage().getElementById("main-panel").getTextContent(),containsString(msg)); } }
/** * Returns the charset to use for the form submission. This is the first one * from the list provided in {@link #getAcceptCharsetAttribute()} if any * or the page's charset else * @return the charset to use for the form submission */ private String getSubmitCharset() { if (getAcceptCharsetAttribute().length() > 0) { return getAcceptCharsetAttribute().trim().replaceAll("[ ,].*", ""); } return getPage().getPageEncoding(); }
/** * Returns the charset to use for the form submission. This is the first one * from the list provided in {@link #getAcceptCharsetAttribute()} if any * or the page's charset else * @return the charset to use for the form submission */ private Charset getSubmitCharset() { String charset = getAcceptCharsetAttribute(); if (!charset.isEmpty()) { charset = charset.trim(); return EncodingSniffer.toCharset( SUBMIT_CHARSET_PATTERN.matcher(charset).replaceAll("").toUpperCase(Locale.ROOT)); } return getPage().getCharset(); }
/** * Returns the charset to use for the form submission. This is the first one * from the list provided in {@link #getAcceptCharsetAttribute()} if any * or the page's charset else * @return the charset to use for the form submission */ private String getSubmitCharset() { if (getAcceptCharsetAttribute().length() > 0) { return getAcceptCharsetAttribute().trim().replaceAll("[ ,].*", ""); } return getPage().getPageEncoding(); }
/** * Returns the charset to use for the form submission. This is the first one * from the list provided in {@link #getAcceptCharsetAttribute()} if any * or the page's charset else * @return the charset to use for the form submission */ private String getSubmitCharset() { if (getAcceptCharsetAttribute().length() > 0) { return getAcceptCharsetAttribute().trim().replaceAll("[ ,].*", ""); } return getPage().getPageEncoding(); }
/** * Returns the charset to use for the form submission. This is the first one * from the list provided in {@link #getAcceptCharsetAttribute()} if any * or the page's charset else * @return the charset to use for the form submission */ private Charset getSubmitCharset() { String charset = getAcceptCharsetAttribute(); if (!charset.isEmpty()) { charset = charset.trim(); return EncodingSniffer.toCharset( SUBMIT_CHARSET_PATTERN.matcher(charset).replaceAll("").toUpperCase(Locale.ROOT)); } return getPage().getCharset(); }
/** * Returns the value of the JavaScript attribute "action". * @return the value of this attribute */ public String jsxGet_action() { String action = getHtmlForm().getActionAttribute(); if (getBrowserVersion().isFirefox()) { try { action = ((HtmlPage) getHtmlForm().getPage()).getFullyQualifiedUrl(action).toExternalForm(); } catch (final MalformedURLException e) { // nothing, return action attribute } } return action; }
/** * Returns the value of the JavaScript attribute "action". * @return the value of this attribute */ public String jsxGet_action() { String action = getHtmlForm().getActionAttribute(); if (getBrowserVersion().isFirefox()) { try { action = ((HtmlPage) getHtmlForm().getPage()).getFullyQualifiedUrl(action).toExternalForm(); } catch (final MalformedURLException e) { // nothing, return action attribute } } return action; }
/** * Returns the value of the JavaScript attribute "action". * @return the value of this attribute */ public String jsxGet_action() { String action = getHtmlForm().getActionAttribute(); if (getBrowserVersion().isFirefox()) { try { action = ((HtmlPage) getHtmlForm().getPage()).getFullyQualifiedUrl(action).toExternalForm(); } catch (final MalformedURLException e) { // nothing, return action attribute } } return action; }
/** * Resets this form to its initial values, returning the page contained by this form's window after the * reset. Note that the returned page may or may not be the same as the original page, based on JavaScript * event handlers, etc. * * @return the page contained by this form's window after the reset */ public Page reset() { final SgmlPage htmlPage = getPage(); final ScriptResult scriptResult = fireEvent(Event.TYPE_RESET); if (ScriptResult.isFalse(scriptResult)) { return scriptResult.getNewPage(); } for (final HtmlElement next : getAllHtmlChildElements()) { if (next instanceof SubmittableElement) { ((SubmittableElement) next).reset(); } } return htmlPage; }
/** * Resets this form to its initial values, returning the page contained by this form's window after the * reset. Note that the returned page may or may not be the same as the original page, based on JavaScript * event handlers, etc. * * @return the page contained by this form's window after the reset */ public Page reset() { final SgmlPage htmlPage = getPage(); final ScriptResult scriptResult = fireEvent(Event.TYPE_RESET); if (ScriptResult.isFalse(scriptResult)) { return scriptResult.getNewPage(); } for (final HtmlElement next : getAllHtmlChildElements()) { if (next instanceof SubmittableElement) { ((SubmittableElement) next).reset(); } } return htmlPage; }
/** * Resets this form to its initial values, returning the page contained by this form's window after the * reset. Note that the returned page may or may not be the same as the original page, based on JavaScript * event handlers, etc. * * @return the page contained by this form's window after the reset */ public Page reset() { final SgmlPage htmlPage = getPage(); final ScriptResult scriptResult = fireEvent(Event.TYPE_RESET); if (ScriptResult.isFalse(scriptResult)) { return scriptResult.getNewPage(); } for (final HtmlElement next : getAllHtmlChildElements()) { if (next instanceof SubmittableElement) { ((SubmittableElement) next).reset(); } } return htmlPage; }
/** * Returns the value of the property {@code action}. * @return the value of this property */ @JsxGetter public String getAction() { final String action = getHtmlForm().getActionAttribute(); if (action != DomElement.ATTRIBUTE_NOT_DEFINED && action.length() == 0 && getBrowserVersion().hasFeature(JS_FORM_ACTION_EXPANDURL_IGNORE_EMPTY)) { return action; } if (action == DomElement.ATTRIBUTE_NOT_DEFINED && !getBrowserVersion().hasFeature(JS_FORM_ACTION_EXPANDURL_NOT_DEFINED)) { return action; } try { return ((HtmlPage) getHtmlForm().getPage()).getFullyQualifiedUrl(action).toExternalForm(); } catch (final MalformedURLException e) { // nothing, return action attribute } return action; }
/** * Returns the value of the property {@code action}. * @return the value of this property */ @JsxGetter public String getAction() { final String action = getHtmlForm().getActionAttribute(); if (action != DomElement.ATTRIBUTE_NOT_DEFINED && action.length() == 0 && getBrowserVersion().hasFeature(JS_FORM_ACTION_EXPANDURL_IGNORE_EMPTY)) { return action; } if (action == DomElement.ATTRIBUTE_NOT_DEFINED && !getBrowserVersion().hasFeature(JS_FORM_ACTION_EXPANDURL_NOT_DEFINED)) { return action; } try { return ((HtmlPage) getHtmlForm().getPage()).getFullyQualifiedUrl(action).toExternalForm(); } catch (final MalformedURLException e) { // nothing, return action attribute } return action; }
final BrowserVersion browser = getPage().getWebClient().getBrowserVersion(); if (browser.hasFeature(FORM_PARAMETRS_NOT_SUPPORTED_FOR_IMAGE) && typeImage) { return;
final BrowserVersion browser = getPage().getWebClient().getBrowserVersion(); if (browser.hasFeature(FORM_PARAMETRS_NOT_SUPPORTED_FOR_IMAGE) && typeImage) { return;
/** * Resets this form to its initial values, returning the page contained by this form's window after the * reset. Note that the returned page may or may not be the same as the original page, based on JavaScript * event handlers, etc. * * @return the page contained by this form's window after the reset */ public Page reset() { final SgmlPage htmlPage = getPage(); final ScriptResult scriptResult = fireEvent(Event.TYPE_RESET); if (ScriptResult.isFalse(scriptResult)) { return htmlPage.getWebClient().getCurrentWindow().getEnclosedPage(); } for (final HtmlElement next : getHtmlElementDescendants()) { if (next instanceof SubmittableElement) { ((SubmittableElement) next).reset(); } } return htmlPage; }
/** * Resets this form to its initial values, returning the page contained by this form's window after the * reset. Note that the returned page may or may not be the same as the original page, based on JavaScript * event handlers, etc. * * @return the page contained by this form's window after the reset */ public Page reset() { final SgmlPage htmlPage = getPage(); final ScriptResult scriptResult = fireEvent(Event.TYPE_RESET); if (ScriptResult.isFalse(scriptResult)) { return htmlPage.getWebClient().getCurrentWindow().getEnclosedPage(); } for (final HtmlElement next : getHtmlElementDescendants()) { if (next instanceof SubmittableElement) { ((SubmittableElement) next).reset(); } } return htmlPage; }
final HtmlPage htmlPage = (HtmlPage) htmlForm.getPage(); final WebClient webClient = htmlPage.getWebClient();
final HtmlPage htmlPage = (HtmlPage) getPage(); final WebClient webClient = htmlPage.getWebClient(); if (webClient.getOptions().isJavaScriptEnabled()) {