cancel
Showing results for 
Search instead for 
Did you mean: 

How to import all custom properties values to SoapUI Pro from command prompt.

Highlighted
Occasional Contributor

How to import all custom properties values to SoapUI Pro from command prompt.

I want to import All custom properties at project level during runtime. Is there any way can I import the proprty file for environment and not just one property at a time.

 

 

2 REPLIES 2
Highlighted
Community Leader

Re: How to import all custom properties values to SoapUI Pro from command prompt.

Hi @sdudani ,

 

Hope below article will help, write that code in a dedicated test suite which will execute first like a configuration Test Suite and store all the value to custom properties .

 

 

soapui oad custom properties from file using groovy

 


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" 🙂

Thanks and Regards,
Himanshu Tayal
Highlighted
Frequent Contributor

Re: How to import all custom properties values to SoapUI Pro from command prompt.

Hi @sdudani ,

you may need take advantage of Groovy to load properties.

// set file path
// assume you run script on project level
def projectPath = project.path + "/<YourFilePath>/xxx.properties"
def properties = new Properties()
de props = new File(ProjectPath)
if (props.isFile()) {
    props.withInputStream {
        properties.load(it)
    }
}

// if want to remove space
for (def key in properties.propertyNames()) {
    properties.put(key, properties.getProperty(key).trim())
}

// return

BR,

/Aaron

New Here?
Join us and watch the welcome video:
Read the Latest News
JuneSCNJ
Top Kudoed Authors