/** * Simulate clicking this input with a pointing device. The x and y coordinates * of the pointing device will be sent to the server. * * @param <P> the page type * @param x the x coordinate of the pointing device at the time of clicking * @param y the y coordinate of the pointing device at the time of clicking * @return the page that is loaded after the click has taken place * @exception IOException If an IO error occurs * @exception ElementNotFoundException If a particular XML element could not be found in the DOM model */ public <P extends Page> P click(final int x, final int y) throws IOException, ElementNotFoundException { wasPositionSpecified_ = true; xPosition_ = x; yPosition_ = y; return super.click(); }
/** * Simulate clicking this input with a pointing device. The x and y coordinates * of the pointing device will be sent to the server. * * @param <P> the page type * @param x the x coordinate of the pointing device at the time of clicking * @param y the y coordinate of the pointing device at the time of clicking * @return the page that is loaded after the click has taken place * @exception IOException If an IO error occurs * @exception ElementNotFoundException If a particular XML element could not be found in the DOM model */ public <P extends Page> P click(final int x, final int y) throws IOException, ElementNotFoundException { wasPositionSpecified_ = true; xPosition_ = x; yPosition_ = y; return super.click(); }
/** * Simulate clicking this input with a pointing device. The x and y coordinates * of the pointing device will be sent to the server. * * @param <P> the page type * @param x the x coordinate of the pointing device at the time of clicking * @param y the y coordinate of the pointing device at the time of clicking * @return the page that is loaded after the click has taken place * @exception IOException If an io error occurs * @exception ElementNotFoundException If a particular XML element could not be found in the DOM model */ @SuppressWarnings("unchecked") public <P extends Page> P click(final int x, final int y) throws IOException, ElementNotFoundException { // By default this is no different than a click without coordinates. return (P) click(); }
/** * <span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span><br> * * Simulates clicking on this element, returning the page in the window that has the focus * after the element has been clicked. Note that the returned page may or may not be the same * as the original page, depending on the type of element being clicked, the presence of JavaScript * action listeners, etc. * * @param event the click event used * @param <P> the page type * @return the page contained in the current window as returned by * {@link com.gargoylesoftware.htmlunit.WebClient#getCurrentWindow()} * @exception IOException if an IO error occurs */ @Override public <P extends Page> P click(final Event event, final boolean ignoreVisibility) throws IOException { wasPositionSpecified_ = true; return super.click(event, ignoreVisibility); }
/** * Simulate clicking this input with a pointing device. The x and y coordinates * of the pointing device will be sent to the server. * * @param <P> the page type * @param x the x coordinate of the pointing device at the time of clicking * @param y the y coordinate of the pointing device at the time of clicking * @return the page that is loaded after the click has taken place * @exception IOException If an io error occurs * @exception ElementNotFoundException If a particular XML element could not be found in the DOM model */ @Override @SuppressWarnings("unchecked") public <P extends Page> P click(final int x, final int y) throws IOException, ElementNotFoundException { wasPositionSpecified_ = true; xPosition_ = x; yPosition_ = y; return (P) super.click(); }
/** * Simulate clicking this input with a pointing device. The x and y coordinates * of the pointing device will be sent to the server. * * @param <P> the page type * @param x the x coordinate of the pointing device at the time of clicking * @param y the y coordinate of the pointing device at the time of clicking * @return the page that is loaded after the click has taken place * @exception IOException If an io error occurs * @exception ElementNotFoundException If a particular XML element could not be found in the DOM model */ @SuppressWarnings("unchecked") public <P extends Page> P click(final int x, final int y) throws IOException, ElementNotFoundException { // By default this is no different than a click without coordinates. return (P) click(); }
/** * Simulate clicking this input with a pointing device. The x and y coordinates * of the pointing device will be sent to the server. * * @param <P> the page type * @param x the x coordinate of the pointing device at the time of clicking * @param y the y coordinate of the pointing device at the time of clicking * @return the page that is loaded after the click has taken place * @exception IOException If an io error occurs * @exception ElementNotFoundException If a particular XML element could not be found in the DOM model */ @Override @SuppressWarnings("unchecked") public <P extends Page> P click(final int x, final int y) throws IOException, ElementNotFoundException { wasPositionSpecified_ = true; xPosition_ = x; yPosition_ = y; return (P) super.click(); }
/** * Simulate clicking this input with a pointing device. The x and y coordinates * of the pointing device will be sent to the server. * * @param <P> the page type * @param x the x coordinate of the pointing device at the time of clicking * @param y the y coordinate of the pointing device at the time of clicking * @return the page that is loaded after the click has taken place * @exception IOException If an io error occurs * @exception ElementNotFoundException If a particular XML element could not be found in the DOM model */ @Override @SuppressWarnings("unchecked") public <P extends Page> P click(final int x, final int y) throws IOException, ElementNotFoundException { wasPositionSpecified_ = true; xPosition_ = x; yPosition_ = y; return (P) super.click(); }
/** * Simulate clicking this input with a pointing device. The x and y coordinates * of the pointing device will be sent to the server. * * @param <P> the page type * @param x the x coordinate of the pointing device at the time of clicking * @param y the y coordinate of the pointing device at the time of clicking * @return the page that is loaded after the click has taken place * @exception IOException If an io error occurs * @exception ElementNotFoundException If a particular XML element could not be found in the DOM model */ @SuppressWarnings("unchecked") public <P extends Page> P click(final int x, final int y) throws IOException, ElementNotFoundException { // By default this is no different than a click without coordinates. return (P) click(); }
/** * <span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span><br> * * Simulates clicking on this element, returning the page in the window that has the focus * after the element has been clicked. Note that the returned page may or may not be the same * as the original page, depending on the type of element being clicked, the presence of JavaScript * action listeners, etc. * * @param event the click event used * @param <P> the page type * @return the page contained in the current window as returned by * {@link com.gargoylesoftware.htmlunit.WebClient#getCurrentWindow()} * @exception IOException if an IO error occurs */ @Override public <P extends Page> P click(final Event event, final boolean ignoreVisibility) throws IOException { wasPositionSpecified_ = true; return super.click(event, ignoreVisibility); }
private void clickSpinnerButton(String componentID, String imageName) throws IOException { DomNode table = (DomNode)jsfClient.getElement(componentID + "Buttons"); List inputs = table.getByXPath("tbody/tr/td/input"); for (Iterator i = inputs.iterator(); i.hasNext();) { HtmlInput input = (HtmlInput)i.next(); if (input.asXml().contains(imageName)) { input.click(); return; } } throw new RuntimeException("Can't find image for " + imageName); }
username.setValueAttribute("username"); password.setValueAttribute("password"); HtmlPage homePage = submit.click();. Thread.sleep(10 * 1000); HtmlPage homePageFrame = (HtmlPage) homePage.getFrameByName("orkutFrame").getEnclosedPage();
((HtmlInput) e).click(); return (HtmlPage) form.submit((HtmlInput) e);
/** * {@inheritDoc} */ @Override public void click() throws IOException { final HtmlInput domNode = getDomNodeOrDie(); final boolean originalState = domNode.isChecked(); final Event event; if (getBrowserVersion().hasFeature(EVENT_ONCLICK_USES_POINTEREVENT)) { event = new PointerEvent(domNode, MouseEvent.TYPE_CLICK, false, false, false, MouseEvent.BUTTON_LEFT); } else { event = new MouseEvent(domNode, MouseEvent.TYPE_CLICK, false, false, false, MouseEvent.BUTTON_LEFT); } domNode.click(event, true); final boolean newState = domNode.isChecked(); if (originalState != newState && (domNode instanceof HtmlRadioButtonInput || domNode instanceof HtmlCheckBoxInput)) { domNode.fireEvent(Event.TYPE_CHANGE); } }
/** * {@inheritDoc} */ @Override public void click() throws IOException { final HtmlInput domNode = getDomNodeOrDie(); final boolean originalState = domNode.isChecked(); final Event event; if (getBrowserVersion().hasFeature(EVENT_ONCLICK_USES_POINTEREVENT)) { event = new PointerEvent(domNode, MouseEvent.TYPE_CLICK, false, false, false, MouseEvent.BUTTON_LEFT); } else { event = new MouseEvent(domNode, MouseEvent.TYPE_CLICK, false, false, false, MouseEvent.BUTTON_LEFT); } domNode.click(event, true); final boolean newState = domNode.isChecked(); if (originalState != newState && (domNode instanceof HtmlRadioButtonInput || domNode instanceof HtmlCheckBoxInput)) { domNode.fireEvent(Event.TYPE_CHANGE); } }
newPage = ((HtmlInput) element).click();
newPage = ((HtmlInput) element).click();
newPage = ((HtmlInput) element).click();
/** * Tests {@link ManualTriggerAction.Approval#getApprovals(net.sf.json.JSONObject, int)}. * With an all patchsets * * @throws Exception if so. */ @Test public void testDoGerritSearchAllPatchSets() throws Exception { JenkinsRule.WebClient client = j.createWebClient(); HtmlPage page = client.goTo("gerrit_manual_trigger"); HtmlForm theSearch = page.getFormByName("theSearch"); page = theSearch.getInputByName("allPatchSets").click(); theSearch = page.getFormByName("theSearch"); page = j.submit(theSearch); HtmlTable table = page.getElementByName("searchResultTable"); HtmlTableCell verifiedCell = table.getCellAt(SECOND_RESULT_ROW, VERIFIED_COLUMN); DomNode child = verifiedCell.getFirstChild(); assertThat(child, instanceOf(HtmlImage.class)); assertEquals("-1", ((HtmlImage)child).getAltAttribute()); HtmlTableCell codeReviewCell = table.getCellAt(SECOND_RESULT_ROW, CODE_REVIEW_COLUMN); child = codeReviewCell.getFirstChild(); assertThat(child, instanceOf(HtmlImage.class)); assertEquals("2", ((HtmlImage)child).getAltAttribute()); } }