cancel
Showing results for 
Search instead for 
Did you mean: 

How to Read Project Properties from Groovy script?

Occasional Contributor

How to Read Project Properties from Groovy script?

Hi,

 

We have a requirement to read the Project level properties in a Groovy script configured in BeforeTestCaseEvent handler. Can some one please help me on reading it.

 

Am able to read the custom properties with the below command 

 

testCase.testSuite.project.getPropertyValue("property") 

 

but not able to read the Project properties using it.

 

Thanks.

2 REPLIES 2
Highlighted
Occasional Contributor

This might work:

 

testRunner.testCase.testSuite.project.setPropertyValue( "MyProp", "test" )
def projectProperty = testRunner.testCase.testSuite.project.getPropertyValue( "MyProp" )
log.info projectProperty

 

Highlighted
Community Hero

You need to call a different method for each one:

project.getName()
project.getDescription()
project.getPath()
project.getResourceRoot()
project.isCacheDefinitions()
project.getShadowPassword()
project.getDefaultScriptLanguage()
project.getHermesConfig()

From here: https://support.smartbear.com/readyapi/apidocs/soapui/com/eviware/soapui/impl/wsdl/WsdlProject.html

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors