_StringFromFile each time it's called it reads next line from the file,
So have a file with firstName,lastName in one line with some separator
then use the __split function to get firstName and lastName
e.g if the content of user.dat are
lName1|fName1
lName2|fName2
lName3|fName3
then you can have
name=${_StringFromFile(user.dat,name)}
VAR=${__split($name,VAR,|)}
${VAR_1} will give you lastName
And ${VAR_2} will give firatName
OR
Use CSV Data set Config
Thanks
_________________________________________________________
Anjan | Associate Technology | Sapient | Bangalore, India
[EMAIL PROTECTED] | +91 80 41047003 (work) | +91 9886619293 (cell)
-----Original Message-----
From: rajendra_sakpal [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 31, 2007 1:19 PM
To: [email protected]
Cc: 'rajendra_sakpal'
Subject: Problem reading value of a test parameter from a data file.
Hi,
I am trying to create a data driven test in JMETER using the
instructions on
http://wiki.apache.org/jakarta-jmeter/JMeterFAQ#head-87f846dad28fd6b2ad5
eb0d
44d527d572f810653 under the question "How do I use external data files
to in
my Test scripts?".
1- I am not clear with the format for specifying value of the
parameter when using the "User Parameters" preprocessor. I have given
value
the parameter "fName" as "${_StringFromFile(user.dat)}". Is the format
for
specifying value of the parameter correct? However, JMETER doesn't
attempt
to read from the data file user.dat. As a result, data posted for my
subsequent request is evaluated as firstName=${fName}. The ${fName} is
not
getting substituted by the value in the data file. Is _StringFromFile a
JMETER function that is invoked to read the data from the mentioned
file?
2- I have specified the data in "user.dat" with the first line
reading
as FNAME & subsequent lines have values in it. Is the data file format
correct?
What could be the problem?
Thanks in advance,
Rajendra
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is
the property of Persistent Systems Pvt. Ltd. It is intended only for the
use of the individual or entity to which it is addressed. If you are not
the intended recipient, you are not authorized to read, retain, copy,
print, distribute or use this message. If you have received this
communication in error, please notify the sender and delete all copies
of this message. Persistent Systems Pvt. Ltd. does not accept any
liability for virus infected mails.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]