Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How to make Data Sheet Path for as environment specific

Parasofttoudaya
Parasofttoudaya Posts: 232 ✭✭
edited August 2017 in SOAtest

Data Sheet Path for as environment specific. I have added the the data sheet path as environment variable and trying to access that as data sheet path. It didn't worked for me, is there any way to achieve it??
Scenario: Each excel doc represents each environment.

Comments

  • OmarR
    OmarR Posts: 233 admin

    Good morning,

    Use the ${} syntax to parameterize environment variables.
    For example,

  • Parasofttoudaya
    Parasofttoudaya Posts: 232 ✭✭

    I dont think this is going to help out. I will provide detail explanation.

    I have 3 different environments, for each environment i have different excel files.
    Now when i need to switch environment, i have to change the path of the data source.

    I will specify the path of the excel in env variable, is there any way load the excel file to the data source using that variable path??

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭
    edited September 2017

    Environment variables work in data source editors but you reference then by prefixing the environment variable name with "soa_env:" like ${soa_env:XLS_PATH}. Please also consider using a data group data source which also makes it easy to switch between different data sources (check the User's Guide for details).

  • Parasofttoudaya
    Parasofttoudaya Posts: 232 ✭✭

    Thanks for the response I am able to achieve it.
    In environment I was trying to use relative path by adding below,
    ${project_loc:EnrollmentAPI}/TestData/TestData_TUP.xlsx and then referring the same in datasource using "${soa_env:TestDataPath}. It was not working.

    Finally i changed the value ../ProjectName/TestData.xls :)

    ..--> to refer the workspace.

  • Parasofttoudaya
    Parasofttoudaya Posts: 232 ✭✭

    I replaced all the required information, But i could not get it so..
    I was trying to get that data bank in next test step. Where i get null value.

  • benken_parasoft
    benken_parasoft Posts: 1,228 ✭✭✭

    I'd recommend keeping discussion about your data bank question in your other post. See my last comment: https://forums.parasoft.com/discussion/3138/how-to-access-environment-variable-in-databank

  • Parasofttoudaya
    Parasofttoudaya Posts: 232 ✭✭

    That was a typo, is it possible to remove the comments i made?