Variables From CSV FileThis Config item allows you to load variable values from CSV file. Variable names and values taken from CSV file, name from first column, value from second column, respectively. In the CSV File: window, you can specify the absolute path to your csv file. However, to make your test plans more portable, you can also use dynamic path by evaluating ${} expressions. TutorialLet's create a text file c:\temp\testvariables.csv with following content:
Save this test plan to c:\temp\test1.jmx. Now, run the test, go to View Results Tree and click on Debug Sampler, then click on Response data tab. You'll see that your variables from testvariables.csv are defined in JMeter, e.g.:
{{{${__groovy(import org.apache.jmeter.services.FileServer; FileServer.getFileServer().getBaseDir();,)}${__groovy(File.separator;,)}resources${__groovy(File.separator;,)}properties.csv}}} This expression dynamically resolves the path (like D:\JAVA_pet_projects\resources\properties.csv) relative to the directory of the current .jmx file.
|