I think I know what's going on:

If I take the .csv file and manually enter bogus IDs, the API call functions as 
intended.  However, data from the Flexible File Writer (FFW) results in the 
malfunction as illustrated below.  The manual entry results in a string being 
stored in the .csv file whereas the FFW approach stores an integer.  Hence, 
there's a mismatch.

Is there a simple way of converting an integer to a string in jmeter?  I'm 
probably missing something obvious, but I just don't see one.

Best regards,

Bo


-----Original Message-----
From: Deepak Shetty [mailto:[email protected]] 
Sent: Thursday, June 05, 2014 12:49 PM
To: JMeter Users List
Subject: Re: Dynamic Data

Hi
I tried on 2.9 - it works fine for me - This is literally the line 
${__CSVRead(../data/a.csv,0)} - ${__CSVRead(../data/a.csv,1)} - 
${__CSVRead(../data/a.csv,next)} prints out the values as expected

Are you trying to write to the file at the same time as you are reading from 
it? I dont think that works




On Thu, Jun 5, 2014 at 9:32 AM, BOLB (Bohdan L Bodnar) <[email protected]>
wrote:

> Deepak, thank you kindly for such a quick response.  The file is being 
> found, and opened, correctly.  The error message is as follows:
>
> 2014/06/05 11:15:52 WARN  - jmeter.functions.CSVRead: APIUSER1 1-1 - 
> invalid column number: 0 at row 0 java.lang.IndexOutOfBoundsException:
> Index: 0, Size: 0
>
> In the current embodiment, there are two columns and one row.  Each 
> column has one integer in it.  If I replace the column number with 
> "1", I obtain the following error message:
>
> 2014/06/05 11:24:16 WARN  - jmeter.functions.CSVRead: APIUSER1 1-1 - 
> can't parse column number:  1 java.lang.NumberFormatException: For input 
> string:
> " 1"
>
> The integers are separated by a comma followed by a space; for 
> example,
>
> 23, 99
>
> I forgot to mention that this is jmeter 2.9
>
> Best regards,
>
> Bo
>
>
> -----Original Message-----
> From: Deepak Shetty [mailto:[email protected]]
> Sent: Thursday, June 05, 2014 10:08 AM
> To: JMeter Users List
> Subject: Re: Dynamic Data
>
> Hi
> the 1 will be the second column , do you have two columns?
> Also check jmeter.log \ might be a special character so you could 
> either escape it \\ or change to use / . Also check jmeter.log for 
> errors
>
> http://jmeter.apache.org/usermanual/functions.html#__CSVRead - please 
> read other info in the docs as well (The function is not suitable for 
> use with large files, as the entire file is stored in memory.)
>
>
> On Thu, Jun 5, 2014 at 7:57 AM, BOLB (Bohdan L Bodnar) 
> <[email protected]>
> wrote:
>
> > I've a situation that I can't figure out how to solve; I'm hoping 
> > someone in this forum can provide ideas.  Here is the background:
> >
> > I am making HTTP-based API calls to a system.  The response to one 
> > of these calls returns the ID (an integer) of an entity that has 
> > been
> created.
> >  This ID is extracted via the Regular Expression Extractor and 
> > assigned to a variable (call it "DEVICE_ID") in the Regular 
> > Expression Extractor pane and the value of DEVICE_ID is written to a 
> > .csv file via the Flexible File Writer plugin.  I have confirmed 
> > that the integer value is correctly written to the file.  
> > Eventually, I want to delete this entity via an API call.  The 
> > following API call (format)
> works exactly as intended:
> >
> > /rest/api/X/Y/${DEVICE_ID}
> >
> > whereas the following fails:
> >
> > /rest/api/X/Y/${__CSVRead(C:\Users\Administrator\Desktop\jmeter\bin\
> > FI
> > LENAME.csv,1)}
> >
> > The failure occurs because there is no appending of the device ID.
> >
> > What I am doing incorrectly?
> >
> > Best regards,
> >
> > Bo
> >
>
> ---------------------------------------------------------------------
> 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