Forum Discussion

sanj's avatar
sanj
Super Contributor
7 years ago

why is referencing datasource inconsistent when compared to referencing test suite variable

ok when I reference a datasource I need something like:

${USAirportRefData#country}

but when referencing test suite variable ${#TestSuite#timeZone2}

Many times I left # in front for data source and of course what do I get nothing!

8 Replies

  • groovyguy's avatar
    groovyguy
    Champion Level 1

    Is the DataSource in your test case, the same test case as the request? That's why you don't need the extra #. It is required for the TestSuite level properties, since ReadyAPI has to know to go up a level. 

     

    Documentation for Property Expansion

  • nmrao's avatar
    nmrao
    Champion Level 3
    1. # is required for referring to Test Case / Suite / Project level properties

    2. # is not required if you are referring to a name of Test step.
    • groovyguy's avatar
      groovyguy
      Champion Level 1

      nmrao: Doesn't 2 in your reply only apply to TestSteps at the same level as the test request? IE, they have to be in the same test case? That is an important distinction. 

      • nmrao's avatar
        nmrao
        Champion Level 3
        Most of the times, I use Type 1.
        Never remember using 2nd type.
        Thumb rule, which I follow, each test case independent. So, the case you mentioned does not arise or I never used as mentioned.