jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Shetty <shet...@gmail.com>
Subject Re: __XPath problems
Date Thu, 11 Feb 2010 23:54:08 GMT
/root/code  definitely does work in XSLT - however here it is clearly
defined that the selected value of a node is the concatenation of the all
the child nodes.
But DOM based stuff would not, since the value of this selected Node is
null, and you have to get the children text nodes and get their values. So
it depends on how this has been implemented, If the XPATH simply selects the
DOM Node and then calls getValue on it, you would observe the behavior that
you got.

On Thu, Feb 11, 2010 at 3:46 PM, Sonam Chauhan <sonam.chauhan@ce.com.au>wrote:

>
> > /root/code/text() works on 2.3.4
>
> Thanks Deepak - I've verified this for 2.3.1 as well.
>
> I was using /root/code, instead of /root/code/text()
>
> I thought /root/code is valid XPath too?
>
>
> Sonam
>
> PS: The CSV data set config you mentioned in your other email was in 2.3.4
> and seemed to apply for inter-thread sharing only.
>
> -----Original Message-----
> From: Deepak Shetty [mailto:shettyd@gmail.com]
> Sent: Friday, 12 February 2010 10:36 AM
> To: JMeter Users List
> Subject: Re: __XPath problems
>
>  /root/code/text() works on 2.3.4
>
> On Thu, Feb 11, 2010 at 3:33 PM, Sonam Chauhan <sonam.chauhan@ce.com.au
> >wrote:
>
> > > However you could just use __StringFromFile() instead.
> > > Or CSV Dataset - just ensure it is in the loop.
> >
> > Aha - Thanks Sebb. I just tried your suggestion and used CSV Dataset
> within
> > the loop - it works.
> >
> > Previously, I had tried using both __StringFromFile() and CSV Dataset
> > earlier, but at the top of the test plan instead of within the loop as
> you
> > suggested. That gave me the same code for each loop iteration.
> >
> > > Also, 2.3.1 is really old; there have been lots of bug fixes since
> then.
> >
> > I also tried the latest 2.3.4 release and the same __XPath() problem
> exists
> > there too.
> >
> > Regards,
> > Sonam
> >
> >
> > -----Original Message-----
> > From: sebb [mailto:sebbaz@gmail.com]
> > Sent: Friday, 12 February 2010 10:09 AM
> > To: JMeter Users List
> > Subject: Re: __XPath problems
> >
> > On 11/02/2010, Sonam Chauhan <sonam.chauhan@ce.com.au> wrote:
> > > Hello:
> > >
> > >  I've run into some problems with the __XPath function.  I use it as
> the
> > 'Value' of a HTTP sampler parameter:
> > >  -----------------------------------------------------
> > >  ${__XPath(prodcodes.xml, /root/code)}
> > >  -----------------------------------------------------
> > >
> > >  This obtains a product code from the prodcodes.xml file, whose content
> > looks like this:
> > >  -----------------------------------------------------
> > >  <?xml version="1.0"?>
> > >  <root>
> > >  <code>00000123</code>
> > >  <code>00001234</code>
> > >  <code>00012345</code>
> > >  ...
> > >  </root>
> > >  -----------------------------------------------------
> > >
> > >  However, this __XPath function call always evaluates to value "null".
> > >
> > >  The jmeter.log simply notes the prodcodes.xml file being used, and
> then
> > 'Stop Thread' signal when the HTTP sampler fails due to "null" not being
> a
> > product code:
> > >  -----------------------------------------------------
> > >  2010/02/12 08:42:03 INFO  - jmeter.functions.XPathWrapper: Integration
> > Tests Thread Group 1-1: Opening prodcodes.xml
> > >  2010/02/12 08:42:03 INFO  - jmeter.threads.JMeterThread: Stop Thread
> > detected by thread Integration Tests Thread Group 1-1
> > >  -----------------------------------------------------
> > >
> > >
> > >  Any thoughts on what could be wrong? Our setup uses JMeter 2.3.1 - I
> > didn't see any bugzilla entries for __XPath
> >
> > No idea what the problem is, sorry.
> >
> > However you could just use __StringFromFile() instead.
> >
> > Or CSV Dataset - just ensure it is in the loop.
> >
> > BTW, it's easy to test functions etc using Java Request - just put the
> > function call in the "Label" field and it will show up in the
> > Listeners.
> >
> > Also, 2.3.1 is really old; there have been lots of bug fixes since then.
> >
> >
> > >  Regards,
> > >  Sonam Chauhan
> > >
> > >  PS: I use __XPath() because the HTTP sampler runs within a loop and it
> > needs to use a new product code in every iteration of the loop. CSV Data
> Set
> > Config et al allocate one config item per thread.
> > >
> > >
> > >
> > >  The information contained in this email and any attached files are
> > strictly
> > >  private and confidential. This email should be read by the intended
> > addressee
> > >  only. If the recipient of this message is not the intended addressee,
> > please
> > >  call Corporate Express Australia Limited on +61 2 9335 0555 or
> Corporate
> > Express
> > >  New Zealand Limited on +64 9 271 7600 and promptly delete this email
> and
> > any
> > >  attachments. The intended recipient of this email may only use,
> > reproduce,
> > >  disclose or distribute the information contained in this email and any
> > attached
> > >  files with Corporate Express' permission. If you are not the intended
> > addressee,
> > >  you are strictly prohibited from using, reproducing, disclosing or
> > distributing
> > >  the information contained in this email and any attached files.
> > Corporate
> > >  Express advises that this email and any attached files should be
> scanned
> > to
> > >  detect viruses. Corporate Express accepts no liability for loss or
> > damage
> > >  (whether caused by negligence or not) resulting from the use of any
> > attached
> > >  files.
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message