Forum Discussion

Benz_Andreas's avatar
Benz_Andreas
Occasional Contributor
16 years ago

HowTo set Testcase Properties in SetupScript

Hello,

how can I set Testcase Properties in SetupScript?
Read properties are working with

def tokenIdInitialized = context.expand( '${#TestCase#TokenIdInitialized}' )

but how can I set properties in #TestCase#

Thanks for help

Best regards
Andy
  • BenX's avatar
    BenX
    Contributor
    testRunner.testCase.setPropertyValue("propertyXY", "property_value");

    ?

    Beno
  • Benz_Andreas's avatar
    Benz_Andreas
    Occasional Contributor
    Thanks for Answer.

    With testrunner don't worked.

    I find a way

    context.testCase.setPropertyValue("PropertyName", "PropertyValue");

    Best regards
    Andy
  • Benz_Andreas's avatar
    Benz_Andreas
    Occasional Contributor
    OK

    their are some different things

    If you want set the TestCase properties from a Script Assertion you need
    context.testCase.setPropertyValue("PropertyName", "PropertyValue");

    If you want set the TestCase properties from SetupScript you need
    testRunner.testCase.setPropertyValue("PropertyName", "PropertyValue");

    Sorry for my to fast wrong first Answer

    Thanks
    Andy