Forum Discussion

pleuraXeraphim's avatar
pleuraXeraphim
Occasional Contributor
16 years ago

Global Storing of Objects

Hello again.

I'm guessing its not possible but can you store a user created object for use later on in a Test Case.

The documentation mentions that:  "A property is a named string value (currently all properties are handled as strings)"

Would there be any other way of storing an instance of an object ? I would imagine there must be workaround.

At the moment I import my own defined java class and I populate with values using the Groovy Scripting. I then would use that Object to pass to an AMF call later on.

Cheers Dave

1 Reply

  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    I was storing credentials in the project object like this:

    if (!project.metaClass.hasMetaProperty("credentials")) {
        project.metaClass.credentials = null
    }

    project.credentials = new Credentials(user,password)


    I then had access to the Credentials object everywhere in the project.

    I would think it would work for TestSuite or TestCase objects as well, but there might be hidden gotchas for the technique, so no guarantees.