Forum Discussion

TGupta's avatar
TGupta
New Contributor
17 years ago

relative path for txt Files to be loaded from in Properties Step

Ole,
Can a txt file be loaded up with a relative path?  This is necessary so that after we check in our scripts in a repository(all the files can be in 1 folder), anyone can check them out and without changing any paths, run the scripts.

Thanks,
Tanvi

4 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi,

    currently relative paths are resolved relative to the working directory, I guess you want to resolve relative to the project file?

    regards,

    /Ole
    eviware.com
  • alibaba82's avatar
    alibaba82
    Super Contributor
    lets say our project file and properties file are in C:\temp
    can we use something like

    testRunner.testCase.testSuite.project.path\temp
    or
    context.testCase.testSuite.project.path\temp

    in a datasource or properties file.

    I saw this in one of your posts about absolute paths in groovy in sourceforge forums.

    Thanks

    Ali
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Ali,

    no, this will unfortunately not work.. as you know we are in the process of improving property-related functionality, one improvement will be the availability of a number of predefined properties, including a "projectDir" property containing the folder of the project file, which you will be able to use as you suggest, for example with "${projectDir}\temp.properties" in a properties step source file.. for now you will need a groovy script..

    regards,

    /Ole
    eviware.com