'How to set path to the file location in the "CSV Data Set Config" if csv.file is located in bitbucket

I want to run Jmeter project in Jenkins. I commited project.jmx and related csv files in bitbucket. How can I set the path to the csv file located in bitbucket



Solution 1:[1]

CSV Data Set config will accept

  • Absolute path (the complete path like c:\path\to\csv\file.csv)
  • Relative path from the test (csvfolder\csvfile.csv)

    csvfolder
         csvfile.csv
    .jmx
    

    Assuming the 'csvfolder' folder is present where you have .jmx

If your folder structure is as given below,

csvfolder
   csvfile
jmxfolder
   jmx

then your CSV file path should be ../csvfolder/csvfile

Solution 2:[2]

Not sure about you specific combination, but usually if your files are in the same location you can refer to them by name only.

Let's say

%JMETER_HOME%\jmeter -n -t %LOAD_TESTS_RUNNER_%/_warmup.jmx 
-Jusers=1 -Jrampup=5 -Jloop=2 -JpathToToken=Token.txt

Token.txt is just located in the same directory as *.jmx file.

Optionally, you could use system variables to contain your paths.

Solution 3:[3]

Depending on your Bitbucket underlying repository type you can configure Jenkins job to be triggered by commit using

So you will be able to refer paths to JMeter .jmx and .csv files just using their names. Or if you prefer full paths - you can use WORKSPACE Jenkins variable like:

  • %WORKSPACE% - for MS Windows Family
  • $WORKSPACE - for Linux/Unix/MacOSX

See Continuous Integration 101: How to Run JMeter With Jenkins article for more information on running JMeter tests from Jenkins

Solution 4:[4]

How to read data from CSV File and run jmx for linux

If my jmx file is login.jmx my input file is users.csv

what should be the syntax or command in linux

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vins
Solution 2 Olha Horak
Solution 3 Dmitri T
Solution 4 Raju