Navigation: JunoRestClient > Advanced >

Property File


Send comments on this topic.



Load Property File

You can load properties from a .properties file using Groovy script and use property names in request URL, headers and payload.



If you want to run the same service on another server for example, you just update the file with new server name and run the service.

You do not need to change service URL. You can add any number of properties within the file and use them in request URL, headers and payload.

It saves your time.


Also, you can create a properties file for each environment as,, and and so on.



Step 1: Create file in a folder C:/temp.











Step: 2 Add a Groovy Script with the following.


def propertyFileName = "C:/temp/" ;

app.importProperties( propertyFileName ) ;





Step 3: Add a REST service and replace URL with the following.





Step 4: Now Select both groovy script and service. Click on [Run Services and Scripts] button.




Step 5: At runtime, SERVER_NAME in URL is replaced with the value obtained from file.


Step 6: Click on Respone | Report | View Report button and see the report.


























Copyright © 2016