Forum Discussion

Glenn_Halstead's avatar
Glenn_Halstead
Occasional Contributor
16 years ago

Is it really so hard to WRITE context properties?

There seems to be a number of ways to read context properties but the only way to write them is:

def testProject = testRunner.testCase.testSuite.project.workspace.getProjectByName("myProject")
testProject.properties["myProperty"].value = "myValue"


and getProjectByName stops me running from the command line.

I'm hoping someone's gonna say 'don't be so dumb! you just do it like this'.

Glenn

1 Reply

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello!

    Sorry to give you bad news, but as you can see in the other thread, even what you were using isn't even long enough...

    It does become much longer once you are accessing properties in other projects, though, writing to a property in the same project as the script is in is somewhat shorter:


    testRunner.testCase.testSuite.project.properties['myProperty'].value = "myValue"


    So if you are able to, maybe you should move the relevant properties you want to write into the project in which you want to write them.

    Regards,
    Dain
    eviware.com