fHref = href;
}
protected Page findTarget() throws XPathException, IOException {
final HtmlPage currentResp = getContext().getCurrentHtmlResponse(this);
final HtmlAnchor link = (HtmlAnchor) findClickableElement(currentResp);
if (link == null)
{
final StepFailedException e = new StepFailedException("Link not found in page " + currentResp.getWebResponse().getRequestUrl(), this);
final StringBuffer sb = new StringBuffer();
for (final Iterator iter = currentResp.getAnchors().iterator(); iter.hasNext();) {
final HtmlAnchor webLink = (HtmlAnchor) iter.next();
sb.append("- label \"").append(webLink.asText());
sb.append("\" with url \"").append(webLink.getHrefAttribute());
sb.append("\" and id \"").append(webLink.getIdAttribute());
sb.append("\"\n");
}
e.addDetail("available links", sb.toString());
throw e;
}