Forum Discussion

JMcKinley's avatar
JMcKinley
Contributor
16 years ago

Reading/Setting test case properties?

Through a groovy script, I know how to read/set test properites associated with a property step... for example:

// define object
def test = testRunner.testCase.getTestStepByNam("testPropertyStep");

// read property value
def version = test.getPropertyValue("testProperty");

// this line would set a property
test.setPropertyValue("testProperty","XYZ");

Is there a way to define the "object" and then read/set properties that are defined as test case properties?

How about the same for test suite properties?

Thanks!
Jim

3 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi,

    try

    testRunner.testCase.setPropertyValue( "", "" )

    or

    testRunner.testCase.testSuite.setPropertyValue( "", "" )

    !?

    regards!

    /Ole
    eviware.com
  • testRunner.testSuite.setPropertyValue("testPropety","test property value");

    gave me the error... No such property testSuite for class...

    The one related to testCase worked... I THINK this will be OK, but it would be great if there is a way to get the test suite version working as some of the info is in the testSuite properties...

    Thanks!!
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    you need to specify

    testRunner.testCase.testSuite.setXX

    to "reach" the TestSuite from the TestRunner..

    regards!

    /Ole
    eviware.com