Summary: | XPath ignores xpathString if same xml file | ||
---|---|---|---|
Product: | JMeter - Now in Github | Reporter: | Troll <java> |
Component: | Main | Assignee: | JMeter issues mailing list <issues> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 2.1.1 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP |
Description
Troll
2006-01-17 16:23:31 UTC
(In reply to comment #0) > the XPath function call > ${__XPath(testusers.xml,//user/@username)} will return u1 and u2 respectively, but > ${__XPath(testusers.xml,//user/@password)} will also return u1 and u2. The above calls are identical, so the response should be identical as well. > XPathWrapper.getXPathString() only checks if it is the same file, should > probably check xpathString too Please explain (In reply to comment #1) > > the XPath function call > > ${__XPath(testusers.xml,//user/@username)} will return u1 and u2 > respectively, but > > ${__XPath(testusers.xml,//user/@password)} will also return u1 and u2. > > The above calls are identical, so the response should be identical as well. I would expect ${__XPath(testusers.xml,//user/@password)} to return p1 and p2 respectively, the call is asking for a different attribute value (password and not username). If the calls were identical, you couldn't parse more than one attribute from each xml file. Sorry, my mistake, I misread it - of course ...@username is not the same as ...@password - duh! I now understand the comment about the XPath string check as well. I'll take another look at fixing this. As far as I can tell, at present each call only ever returns the first match - I could not get the function to return u2 (using your example). Does it work for you? There does not seem to be any code to increment the internal pointer. This obviously needs to be fixed as well... BTW, a work-round at present is to use different file names for the same file, e.g. testusers.xml and ./testusers.xml I think I've fixed both problems in the 2.1 branch. The nightly build 2-1.20060221 contains the fixes. Found a problem - the nodelist was not being shared across threads. This is in the 2-1.20060222 build. This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1667 |