开发者

How to hold Xml file names in CSV Data set Config (Jmeter)

How can I use CSV Data set Config for holding Xml File names? I have Xml files storin开发者_JS百科g Soap Messages and I want to CSV Data set Config to read them. How can I do it?


This can be done the same way as creating any CSV Data Set file.

  1. Create a CSV data set file.
  2. In the file, specify the FULL PATH for the XML files
  3. In Jmeter, create and configure your CSV DataSet config as needed 3a. You may need to put the full path of the CSV data set file 3b. make sure the order of your variable names match your column headers. Most likely, you'll only have one column.
  4. In your SOA request, reference the variables declared in your CSV Data Set config.
  5. Execute and enjoy.


Though you have got the correct answer. I though of sharing another solution may be helpful for the same scenario which is reading xml from the CSV file. Instead of having different xml file that holding the Xml content, you could also have xml content inside the CSV file.

Here is the sample for one row in single line. This row also has another value separated by comma

<?xml version="1.0" encoding="usascii"?><ApplicationContact ReceiveNewsletter="No">  <FirstName>test first name</FirstName> <LastName>test last name</LastName>  <Address1>132 Main st</Address1>  <City>New York</City>  <State>NY</State> <ZIPCode>21225</ZIPCode>  <EmailAddress>email@aol.com</EmailAddress>  </ApplicationContact>,458669


I found that above example by Amzath only works in groovy script if you then later refer to the individual csv variables like this:

String value = '${value}'

(Note that String value is assumed)

Using double quotes will mess up the read XML and groovy will mistake it for being a linked HashMap.

Hope this helps someone

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜