Forum Discussion
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?
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?
- ManjuYadav6 years agoNew Contributor
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
- TestTestTest6 years agoNew Contributor
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:
TestTestTest
Related Content
Recent Discussions
- 14 days agosmilnik