On 12/02/2010, Sonam Chauhan <[email protected]> wrote:
> > CSV Dataset produces one line for each parent controller iteration.
>
>
> Thanks - that's very helpful.
>
>
>  > The function __StringFromFile needs to be used either on the sampler
>  > or on a User Parameters Pre-Processor so that it is called each time
>  > you need another line.
>
>
> Actually, my mistake - I had tried __CSVRead (which seems to do once per 
> thread)

CSVRead works much the same as StringFromFile, but you have to
remember to call next to advance the pointer.

> and thought I'd tried __StringFromFile also, but __StringFromFile seems to 
> work now!
>
>  :-)
>
>  Thanks for your help!
>
>
>  Sonam
>
>
>
>  -----Original Message-----
>  From: sebb [mailto:[email protected]]
>
> Sent: Friday, 12 February 2010 10:53 AM
>  To: JMeter Users List
>  Subject: Re: __XPath problems
>
>  On 11/02/2010, Sonam Chauhan <[email protected]> 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.
>
>  The function __StringFromFile needs to be used either on the sampler
>  or on a User Parameters Pre-Processor so that it is called each time
>  you need another line.
>
>  CSV Dataset produces one line for each parent controller 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:[email protected]]
>  >  Sent: Friday, 12 February 2010 10:09 AM
>  >  To: JMeter Users List
>  >  Subject: Re: __XPath problems
>  >
>  >  On 11/02/2010, Sonam Chauhan <[email protected]> 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: [email protected]
>  >  For additional commands, e-mail: [email protected]
>  >
>  >
>  >
>  >
>  >  ---------------------------------------------------------------------
>  >  To unsubscribe, e-mail: [email protected]
>  >  For additional commands, e-mail: [email protected]
>  >
>  >
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [email protected]
>  For additional commands, e-mail: [email protected]
>
>
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [email protected]
>  For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to