Forum Discussion

Raviteja's avatar
Raviteja
New Contributor
11 years ago

Accessing a project level property from another property

Iam new to soapUI. I have a small doubt.
Can we set project level properties to another project level property dynamically?
i mean suppose a project level property "node" with value "12345" is there. Can i use this propery "node" in any other project level property?If it is possible how?
Iam trying like property "node123" and value "${#Project#node}" which calls the old property.
But it was not working.
Can anybody do the needful?

6 Replies

  • PaulDonny's avatar
    PaulDonny
    Regular Contributor
    Hi Raviteja,

    I am not quite understanding your question. From the way it sounds your wanting to take a property (Node), which is dynamic, and store it to another value (I will call it nodeStore) for later use.

    If that is accurate, your best method for this would likely be a groovy script to store it into a property value or a database to store it in if your needing it for a longer term. Both are rather simple to accomplish.

    To store it to another property:

    curTC = testRunner.testCase;
    curTC.setPropertyValue("nodeStore",curTC.getPropertyValue("Node"));


    For the DB option, it would be a bit more difficult but still not that hard to do. I would suggest coding a DBread and DBwrite function in Java and then just copying the code over to SoapUI and include the imports. Sometimes you have to make minor edits but typically nothing too huge. Access or SQLite3 works wonderfully as local databases.
  • Raviteja's avatar
    Raviteja
    New Contributor
    Hello Paul,

    Thanks for your reply.
    I think you are not getting my question.
    Any thing in properties was a key value pair right?
    Suppose a property with key "Node" and value "12345" is there at project level.
    I have another property with key "NodeID" at project level. The value of this property should be same as the value of Key "Node".
    My requirement is i should do this without using a script.
    Iam trying like this for the value of key "NodeID" ${#Project#Node}.
    But this is not working.
    Is there any solution to do this without using a script?
    I think this time i was bit clear...
  • PaulDonny's avatar
    PaulDonny
    Regular Contributor
    Yes much clearer. I am not aware of any way to do this without scripting, you could implement a script into the XML itself but it would still require scripting.

    I am still newer to SoapUI so it is possible that there is a function to perform what you are doing that I am unaware of though.
  • Raviteja's avatar
    Raviteja
    New Contributor
    Thanks Michael.
    Its working if we call the property "NodeID" it in request body only.
    Its setting dynamically in request body only.
    Any how i have solved my problem with small scripting.

    Thanks,
    Raviteja