/** * {@inheritDoc} */ @Override public final void focus() { super.focus(); // store current value to trigger onchange when needed at focus lost valueAtFocus_ = getInternalValue(); }
/** * {@inheritDoc} */ @Override public void focus() { super.focus(); valueAtFocus_ = getText(); }
/** * Sets the focus to this element. */ public void jsxFunction_focus() { getDomNodeOrDie().focus(); }
/** * Sets the focus to this element. */ @Override public void focus() { final HtmlElement element = getReferencedElement(); if (element != null) { element.focus(); } }
/** * {@inheritDoc} */ @Override public void focus() { super.focus(); valueAtFocus_ = getText(); }
/** * Sets the focus to this element. */ @Override public void focus() { final HtmlElement element = getReferencedElement(); if (element != null) { element.focus(); } }
/** * Sets the focus to this element. */ @Override public void focus() { final HtmlElement element = getReferencedElement(); if (element != null) { element.focus(); } }
/** * Sets the focus to this element. */ public void jsxFunction_focus() { getDomNodeOrDie().focus(); }
/** * Sets the focus to this element. */ public void jsxFunction_focus() { getDomNodeOrDie().focus(); }
/** * Sets the focus to this element. */ @Override public void focus() { final HtmlElement element = getReferencedElement(); if (element != null) { element.focus(); } }
/** * {@inheritDoc} */ @Override public final void focus() { super.focus(); // store current value to trigger onchange when needed at focus lost valueAtFocus_ = getInternalValue(); }
/** * Sets the focus to this element. */ @Override public void focus() { final HtmlElement element = getReferencedElement(); if (element != null) { element.focus(); } }
/** * Sets the focus to this element. */ @JsxFunction public void focus() { final HtmlElement domNode = getDomNodeOrDie(); if (domNode instanceof SubmittableElement) { domNode.focus(); } // no action otherwise! }
/** * Sets the focus to this element. */ @JsxFunction public void focus() { final HtmlElement domNode = getDomNodeOrDie(); if (domNode instanceof SubmittableElement) { domNode.focus(); } // no action otherwise! }
public void click() { assertElementNotStale(); if (!(element instanceof ClickableElement)) return; ClickableElement clickableElement = ((ClickableElement) element); try { if (parent.isJavascriptEnabled() && !(element instanceof HtmlInput)) { element.focus(); } clickableElement.click(); } catch (IOException e) { throw new WebDriverException(e); } catch (ScriptException e) { System.out.println(e.getMessage()); // Press on regardless } }
/** * Simulate pressing an access key. This may change the focus, may click buttons and may invoke * JavaScript. * * @param accessKey the key that will be pressed * @return the element that has the focus after pressing this access key or null if no element * has the focus. * @throws IOException if an IO error occurs during the processing of this access key (this * would only happen if the access key triggered a button which in turn caused a page load) */ public DomElement pressAccessKey(final char accessKey) throws IOException { final HtmlElement element = getHtmlElementByAccessKey(accessKey); if (element != null) { element.focus(); if (element instanceof HtmlAnchor || element instanceof HtmlArea || element instanceof HtmlButton || element instanceof HtmlInput || element instanceof HtmlLabel || element instanceof HtmlLegend || element instanceof HtmlTextArea) { final Page newPage = element.click(); if (newPage != this && getFocusedElement() == element) { // The page was reloaded therefore no element on this page will have the focus. getFocusedElement().blur(); } } } return getFocusedElement(); }
/** * Simulate pressing an access key. This may change the focus, may click buttons and may invoke * JavaScript. * * @param accessKey the key that will be pressed * @return the element that has the focus after pressing this access key or null if no element * has the focus. * @throws IOException if an IO error occurs during the processing of this access key (this * would only happen if the access key triggered a button which in turn caused a page load) */ public DomElement pressAccessKey(final char accessKey) throws IOException { final HtmlElement element = getHtmlElementByAccessKey(accessKey); if (element != null) { element.focus(); if (element instanceof HtmlAnchor || element instanceof HtmlArea || element instanceof HtmlButton || element instanceof HtmlInput || element instanceof HtmlLabel || element instanceof HtmlLegend || element instanceof HtmlTextArea) { final Page newPage = element.click(); if (newPage != this && getFocusedElement() == element) { // The page was reloaded therefore no element on this page will have the focus. getFocusedElement().blur(); } } } return getFocusedElement(); }
elementWithFocus_.focus(); newElement.fireEvent(Event.TYPE_FOCUS);
final HtmlElement element = getElementByAccessKey(accessKey); if (element != null) { element.focus(); final Page newPage; if (element instanceof HtmlAnchor) {
final HtmlElement element = getElementByAccessKey(accessKey); if (element != null) { element.focus(); final Page newPage; if (element instanceof HtmlAnchor) {