Forum Discussion

phonehome's avatar
phonehome
Occasional Contributor
6 years ago
Solved

Accessing Project Properties from a Groovy script (NOT Custom Properties)

Hi all,

 

How can I read in the value of a non-Custom Project Property from within a TestCase-level Groovy script? Specifically, I need to get hold of the value of the read-only 'File' property which contains the location of a soapUI project file.

 

E.g. for a soapUI project called 'mySoapServiceTests'...

 

 

I guess the solution might look similar to this which works fine for getting Custom Properties (but not Project Properties):

 

def projFilePath = testRunner.testCase.testSuite.project.getPropertyValue("File")

 

I've trawled through the class doc and various posts and blogs etc. but they all seem to only cover getting and setting Custom Properties.

 

I also don't need to put this value into a SOAP or other request using ${#Project#xxx#} or similar, I just need to get the value into a variable in my Groovy script.

 

Kudos to whoever can first tell me how to do this :smileyhappy:

 

2 Replies