cancel
Showing results for 
Search instead for 
Did you mean: 

Transfer the value of one property to another without using groovy

Highlighted
New Contributor

Transfer the value of one property to another without using groovy

Hello All,

 

I want to save the value of "projectDir" in  test suite custom properties. I creeated a param "path" and assigned the value "${projectDir}". When I try to print the value of this I still get $projectDir instead of the actual path. Is there anything I am missing.

 

Thanks in advance.

 

Regards,

Manju

5 REPLIES 5
Community Hero

Re: Transfer the value of one property to another without using groovy

Would it be possible with a screen shot from where to where the transfer has to happen? And why not groovy?


Regards,
Rao.
New Contributor

Re: Transfer the value of one property to another without using groovy

Hello Rao,

 

Below is my scenario:

With groovy script I fetched the value of "projectDir"  (context.expand('${projectDir}') ). The output of this was stored in test suite custome property "path". I have one more property variable in the same suite "certPath" for which the value should be ${path}\abc\xyz\ (attached screen shot). Here the "path" varaible value is not evaluated.

The value for certPath may change in future to ${path}\xyz\. I will be suing this variable in many places , so changing in properties will be easier than using groovy. If I use groovy I will end up modifying all the scripts where this path needs changes.

So I have 2 queries here:

1. How to tranfer the property value of "path" to "certPath" ?( both the properties are in same suite)
2. How to use ${projectDir} directly in property instead of exapnding this value in groovy and then saving to property?

Community Hero

Re: Transfer the value of one property to another without using groovy

Thank you for clarifying.

For instance, a custom property is defined at project level. Say WORKSPACE_DIR and value is "D:/workspace"
Another property is required to be used and reuse the above.
Say TOOLS_DIR and set value as ${#Project#WORKSPACE_DIR}/tools

If the same has to be done as suite level, use ${#TestSuite#PROPERTY_NAME} .

Does that help?


Regards,
Rao.
New Contributor

Re: Transfer the value of one property to another without using groovy

Hello Rao,


Thank you for the quick response.
I tried this but it is not working.
Project level property "path" has value "C:\workspace"

Suite level property "projectPath" has value "${#Project#path}"

When I try to print the value of "projectPath" I get "${#Project#path}" instead of the actual value.

 

Regards,

Manju M Yadav

New Contributor

Re: Transfer the value of one property to another without using groovy

Hello,

 

I have had a simular problem. My solution was to use groovy to get the variable to a local variable

and then you could create a new testproperty on testsuite level. 

 

You could also look at this message for local use of the variable:

https://community.smartbear.com/t5/SoapUI-Open-Source/Groovy-Read-Response-using-xpath-in-a-soapui-p...

 

TestTestTest

New Here?
Join us and watch the welcome video:
Watch the new Interview
Top Kudoed Authors