Forum Discussion

ManjuYadav's avatar
ManjuYadav
New Contributor
6 years ago

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

  • nmrao's avatar
    nmrao
    Champion Level 3
    Would it be possible with a screen shot from where to where the transfer has to happen? And why not groovy?
    • ManjuYadav's avatar
      ManjuYadav
      New Contributor

      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?

      • nmrao's avatar
        nmrao
        Champion Level 3
        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?