There isnt a straight forward way to do this . In the specific case of a
name value pair , you can model this as two columns.
In the case of arrays you have some options
a. If you can fix the maximum number of elements you can keep as many
columns as the max number (leave them empty when you have no data) and you
can have your JMeter conditionally add non empty parameters
b. You can use a separate delimiting scheme and parse that in bsh
e.g. "a","b","c~d~e","f" where the third column is actually an array
["c","d","e"]. You then use BSH or javaScript to parse this third String.
c. You can store your XML and just have the CSV point to the location of the
XML (or have the entire XML as a single column ). I did this once using JSON
as the format.
d. You can store complex data in a separate file which shares a common key
with the CSV file. And read that from BSH
So CSV will have
"key1","a","b","c"
"key2","d","e","f"
and the other file read by BSH will have
"key1","x"
"key1","y"
"key2","z"

regards
deepak


On Fri, Jun 18, 2010 at 8:56 AM, Whatis myname <[email protected]>wrote:

> I am trying to get JMeter to read data from a .csv file to perfrom the load
> testing.
>
> The method which is being used is:
>
>  public void log(String transactionId, String principal, String eventName,
> String eventType, int status, String[] contexts, IAuditData[] datas)
>
>
> I created a sample .csv file, and tried to make JMeter read data from it. I
> added the csv data set configuration element and then added the following
> variables under the variable names section:
>
> transactionId, principal,eventName,eventType,status,contexts, datas
>
>
> I also added them to the http request element.
>
> I am not sure how to add the last argument both in the csv file and in
> JMeter. The first six arguments are all primitive types ( though I am not
> sure how to add the String [] too, but for now I am just adding a single
> string value.), but the last argument is an object, which itself is a name,
> value pair. So an Audit data would contain a name( which is a string, and a
> value, which is also a string.). So I am not sure how can I add it in the
> excel file as well as in the Jmeter config.
>
>
> This is what my excel file looks like right now without the data for the
> last argument:
>
>
> transactionID1    principal1    eventname1    eventtype1    0    Contexts
> transactionID1    principal1    eventname1    eventtype1    0    Contexts
> transactionID1    principal1    eventname1    eventtype1    0    Contexts
> transactionID1    principal1    eventname1    eventtype1    0    Contexts
> transactionID1    principal1    eventname1    eventtype1    0    Contexts
> transactionID1    principal1    eventname1    eventtype1    0    Contexts
> transactionID1    principal1    eventname1    eventtype1    0    Contexts
> transactionID1    principal1    eventname1    eventtype1    0    Contexts
> transactionID1    principal1    eventname1    eventtype1    0    Contexts
> transactionID1    principal1    eventname1    eventtype1    0    Contexts
> transactionID1    principal1    eventname1    eventtype1    0    Contexts
> transactionID1    principal1    eventname1    eventtype1    0    Contexts
>
>
> The soap message is supposed to look like this ( with an empty string array
> passed in as the sixth argument):
>
>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/
> "><soap:Body>
> <ns1:log xmlns:ns1="http://auditservice.auditing.asdf.comp.com/
> "><ns1:transactionId>THX-4EVR-0</ns1:transactionId>
>
> <ns1:principal>ANONYMOUS</ns1:principal>
>
> <ns1:eventName>ExtremeLogonAttempt</ns1:eventName>
>
> <ns1:eventType>ExtremeSecurity</ns1:eventType>
>
> <ns1:status>0</ns1:status>
>
> <ns1:contexts />
>
> <ns1:datas><ns2:IAuditData xmlns:ns2="
> http://iauditdata.auditing.asdf.comp.com
> "><ns2:name>com.comp.security.auditing.data.CurrentDate</ns2:name>
>
> <ns2:value>2010-06-18 14:21:23.917</ns2:value>
>
> </ns2:IAuditData><ns2:IAuditData xmlns:ns2="
> http://iauditdata.auditing.asdf.comp.com";>
>
> <ns2:name>com.comp.security.auditing.data.AuditSource</ns2:name>
>
> <ns2:value>Legal Source</ns2:value>
>
> </ns2:IAuditData></ns1:datas></ns1:log></soap:Body></soap:Envelope>
>
>
> Can someone help me with how to add the last argument, and also what if the
> sixth argument was an array instead of a single value.
>

Reply via email to