Jmeter’s Variables From CSV File – relative path

Jmeters Variables From CSV File config element set its base directory as a user’s home directory. If you ‘Browse’ your file it will put something like:

/Users/your_user/./your_file.txt

So in such case we need to pass base directory to be able to work with relative paths for our files.

1. Define base directory in User Defined Variables:

baseDir =>  ${__BeanShell(import org.apache.jmeter.services.FileServer; FileServer.getFileServer().getBaseDir())}

2. Use it in your element:

${baseDir}/../data/your_data.csv
Advertisements
Jmeter’s Variables From CSV File – relative path

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s