Forum Discussion

Sachin_Sawe's avatar
Sachin_Sawe
Contributor
17 years ago

Dynamically creating property key?

Ole,

I have a Properties step with bunch of properties for e.g.

1=Excellent
2=Good
3=Ok

Now I know I can retrieve these using context.expand( 'Properties#1' )
However, I want to make "1" dynamic. For example I do not know what to substitute after # sign only up until I reach that point of execution so in other words I want to have a variable that will take any number and that will be substituted after 'Properties#' above. I am not able to do this. I tried doing 'Properties#${variable}' but that does not work

Also since I want to do this in assertion step, I am not able to access testRunner either, otherwise I would have done something like

testRunner.testCase.tesSteps['Properties'].getPropertyValue(variable)

Please help.

Thanks,
Sachin
  • Ole,

    Nevermind. I figured this out. I can access testRunner in assertion step via context

    I can do either of

    context.getTestRunner() or
    context.getTestCase() directly

    thanks,
    Sachin