public boolean matchesCriteria( Object htmlElement, Object criteria ) { return HttpUnitUtils.contains( ((WebLink) htmlElement).getURLString(), (String) criteria ); } };
/** * convert the given child to a link anchor * @param child * @return */ private WebLink toLinkAnchor( Element child ) { return (!isWebLink( child )) ? null : new WebLink( _response, _baseURL, child, _frame, _baseTarget, _characterSet ); }
private URL getReference() { try { return getRequest().getURL(); } catch (MalformedURLException e) { return WebLink.this.getBaseURL(); } } }
/** * Submits a request as though the user had clicked on this link. Will also fire the 'onClick', 'onMouseDown' and 'onMouseUp' event if defined. * Returns the updated contents of the frame containing the link. Note that if the click updates a different frame, * that frame will not be returned by this method. **/ public WebResponse click() throws IOException, SAXException { if (handleEvent("onclick")) { ((HTMLElementImpl) getNode()).doClickAction(); } return getCurrentFrameContents(); }
/** * Returns the text value of this link. * @deprecated as of 1.6, use #getText instead **/ public String asText() { return getText(); }
/** * Finds a hyper-link that has the specified text and whose * target URL starts with the given prefix. */ static WebLink findLink( WebConversation wc, String text, String urlPrefix ) throws ProcessingException, SAXException { WebLink[] links = wc.getCurrentPage().getLinks(); for( int i=0; i<links.length; i++ ) { if( links[i].asText().indexOf(text)==-1 ) continue; if( !links[i].getURLString().startsWith(urlPrefix)) continue; return links[i]; } throw new ProcessingException("no link found for '"+text+'\''); }
String[] parts = fileLink.getURLString().split("/"); String id = parts[4]; WebLink[] links = r.getLinks(); WebLink editFileLink = null; for (WebLink link : links) { if (link.getURLString().contains("ProjectDocumentEdit?documentID="+id)) { editFileLink = link; break; r = editFileLink.click(); WebForm[] forms = r.getForms(); for (WebForm form : forms) { throw new ProcessingException("Unable to find 'add new file' link. Does this account have a permission to post a file?"); r = addFileLink.click();
/** * Returns the text value of this link. * @since 1.6 **/ public String getText() { if (getElement().getNodeName().equalsIgnoreCase( "area" )) { return getAttribute( "alt" ); } else { return super.getText(); } }
/** * Click on a Seam s:link component. * * @param componentID The JSF component ID or a suffix of the client ID. * * @throws SAXException if the current response page can not be parsed * @throws ComponentIDNotFoundException if the component can not be found * @throws DuplicateClientIDException if more than one client ID matches the * componentID suffix */ public void clickSLink(String componentID) throws SAXException, IOException { String clientID = getClientIDs().findClientID(componentID); WebLink link = getWebResponse().getLinkWithID(clientID); doWebRequest(link.getRequest()); }
public boolean matchesCriteria( Object link, Object parentNode ) { for (Node parent = (Node) parentNode; parent != null; parent = parent.getParentNode()) { if (parent.equals( ((WebLink) link).getElement() )) return true; } return false; } }, _element.getParentNode() );
public boolean matchesCriteria( Object htmlElement, Object criteria ) { return HttpUnitUtils.matches( ((WebLink) htmlElement).getName(), (String) criteria ); } };
public boolean matchesCriteria( Object htmlElement, Object criteria ) { return HttpUnitUtils.matches( ((WebLink) htmlElement).getID(), (String) criteria ); } };
/** * Returns the text value of this link. * @deprecated as of 1.6, use #getText instead **/ public String asText() { return getText(); }
/** * Submits a request as though the user had clicked on this link. Will also fire the 'onClick', 'onMouseDown' and 'onMouseUp' event if defined. * Returns the updated contents of the frame containing the link. Note that if the click updates a different frame, * that frame will not be returned by this method. **/ public WebResponse click() throws IOException, SAXException { if (handleEvent("onclick")) { ((HTMLElementImpl) getNode()).doClickAction(); } return getCurrentFrameContents(); }
/** * Returns the text value of this link. * @since 1.6 **/ public String getText() { if (getElement().getNodeName().equalsIgnoreCase( "area" )) { return getAttribute( "alt" ); } else { return super.getText(); } }
public boolean matchesCriteria( Object link, Object parentNode ) { for (Node parent = (Node) parentNode; parent != null; parent = parent.getParentNode()) { if (parent.equals( ((WebLink) link).getElement() )) return true; } return false; } }, _element.getParentNode() );
public boolean matchesCriteria( Object htmlElement, Object criteria ) { return HttpUnitUtils.matches( ((WebLink) htmlElement).getName(), (String) criteria ); } };
public boolean matchesCriteria( Object htmlElement, Object criteria ) { return HttpUnitUtils.matches( ((WebLink) htmlElement).getID(), (String) criteria ); } };