Forum Discussion

davidcole's avatar
davidcole
Occasional Contributor
12 years ago

Dynamic datasource and datasink filename

Can I set /TestFiles/Statements<Variable with environment name>.csv in the Datasource filename and datasink filename fields?

Or so I need to put a script in there somewhere to create the filename variable (the question then becomes how to I then use that filename).
  • SiKing's avatar
    SiKing
    Community Expert
    You can use property expansion anywhere! I often use something like
    ${projectDir}/resources/${TestStep#someVar}.csv
  • davidcole's avatar
    davidcole
    Occasional Contributor
    SiKing wrote:
    You can use property expansion anywhere! I often use something like
    ${projectDir}/resources/${TestStep#someVar}.csv


    So I saw a variable somewhere that was ${#env#} that was supposed to be the variable name, but when I plugged this into the filename field
    /My Directory/${#env#}/File.csv


    It didn't seem to do anything but generate an error.
  • SiKing's avatar
    SiKing
    Community Expert
    Ummmm, I think you want
    ${#env#some_variable_name}
  • davidcole's avatar
    davidcole
    Occasional Contributor
    Is the environment name not a variable that's accessible?