Index: /home/buckett/workspace/jmeter/src/protocol/http/org/apache/jmeter/protocol/http/modifier/AnchorModifier.java =================================================================== --- /home/buckett/workspace/jmeter/src/protocol/http/org/apache/jmeter/protocol/http/modifier/AnchorModifier.java (revision 372904) +++ /home/buckett/workspace/jmeter/src/protocol/http/org/apache/jmeter/protocol/http/modifier/AnchorModifier.java (working copy) @@ -99,6 +99,7 @@ } addAnchorUrls(html, result, sampler, potentialLinks); addFormUrls(html, result, sampler, potentialLinks); + addFramesetUrls(html, result, sampler, potentialLinks); if (potentialLinks.size() > 0) { HTTPSamplerBase url = (HTTPSamplerBase) potentialLinks.get(rand.nextInt(potentialLinks.size())); sampler.setDomain(url.getDomain()); @@ -196,6 +197,39 @@ } } } + + private void addFramesetUrls(Document html, HTTPSampleResult result, + HTTPSamplerBase config, List potentialLinks) { + String base = ""; + NodeList baseList = html.getElementsByTagName("base"); + if (baseList.getLength() > 0) { + base = baseList.item(0).getAttributes().getNamedItem("href") + .getNodeValue(); + } + NodeList nodeList = html.getElementsByTagName("frame"); + for (int i = 0; i < nodeList.getLength(); i++) { + Node tempNode = nodeList.item(i); + NamedNodeMap nnm = tempNode.getAttributes(); + Node namedItem = nnm.getNamedItem("src"); + if (namedItem == null) { + continue; + } + String hrefStr = namedItem.getNodeValue(); + try { + HTTPSamplerBase newUrl = HtmlParsingUtils.createUrlFromAnchor( + hrefStr, new URL(result.getURL(), base)); + newUrl.setMethod(HTTPSamplerBase.GET); + log.debug("possible match: " + newUrl); + if (HtmlParsingUtils.isAnchorMatched(newUrl, config)) { + log.debug("Is a match! " + newUrl); + potentialLinks.add(newUrl); + } + } catch (MalformedURLException e) { + } catch (org.apache.oro.text.regex.MalformedPatternException e) { + log.error("Bad pattern", e); + } + } + } public static class Test extends JMeterTestCase { public Test(String name) {