You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by sebb <se...@gmail.com> on 2009/09/07 16:28:28 UTC

Re: XPath Extractor - different behavior than my favorite xpath generator

On 05/09/2009, Gromadusi <gr...@gmail.com> wrote:
> Hi,
>
>  I'm trying to validate that every <li> on a page is linked with<a
>  href="..."> to a subpage, and identify those which aren't (with an
>  assertion).
>  For that i'm using the XPath Extractor (thanks sebb, it works with the
>  nightly build!) to get all list items on that page.
>
>  The simple xpath expression that i think should work is "//li".
>  If I evaluate that expr. with xpather (FF plugin), i do get a clean list of
>  ~70 matches, along with the corresponding innerHTML text / text shown on
>  page for every match.
>  However, using this expression in the Xpath Extractor, i actually DO get the
>  array of ~70 matches, but just a few have the displayed text stored. The
>  rest has a blank " " as content.
>
>  Since i have no unique Id or something in my <li>'s, I plan to reiterate
>  through the page using this (missing) string with contains(.,"foo") to
>  identify the list item again and then asserting that it has a valid link
>  stored.
>
>  Here's a full xpath example which is stored WITH text:
>  "/html/body/table/tbody/tr/td[2]/table/tbody/tr[2]/td[2]/div/div[3]/div[6]/div[2]/div[2]/div/ul/li[3]"
>
>  And this is one that is empty:
>  "/html/body/table/tbody/tr/td[2]/table/tbody/tr[2]/td[2]/div/div[3]/div[6]/div[2]/div[2]/div/ul/li[1]"
>
>  Does Jmeter use a different/older/newer xpath language?

JMeter uses Xalan 2.7.1.
I've no idea what xpather uses.

But if they match the same nodes, then it's not likely that XPath is
the problem.

JMeter has to extract the data from the matches; it could be that this
is being done differently.

If there is a suitable URL (or file) that can be used for testing,
please create a Bugzilla issue with the details.

>  or am i missing
>  something basic here?
>
>  Thanks for your help
>
>  cheers
>
>
>  G
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org