Relative path declared in the environment variable is not being recognized in the test script

bprabhbprabh Posts: 5
edited February 26 in SOAtest

In order to map data with it's respective environments. I followed the below steps,

  1. Created an excel for one environment.
  2. Created a variable in Environment variable and gave the relative path of the excel (${project_loc:project}/TestData/project_TestData_QA.xlsx)
  3. Called this above variable in Data source as ${soa_env:var_name}

It's being recognized in Data source and "show column" works perfectly fine, However when the test script is executed, i'm getting the following error (The filename, directory name, or volume label syntax is incorrect)

But when the same steps are followed by giving absolute path, it works absolutely fine reading all the data from excel.


  • jakubiakjakubiak Posts: 386 admin

    Unfortunately you cannot reference another variable from within an environment variable at runtime, as you observed. I would suggest that instead of putting a variable inside your environment, put only the relative path "/TestData/project_TestData_QA.xlsx". Then, in your data source use two variables: "${project_loc:project}${soa_env:var_name}".

  • bprabhbprabh Posts: 5

    thanks. It worked :)

Sign In or Register to comment.