Forum Discussion

lc25s's avatar
lc25s
Occasional Contributor
11 years ago

can you preload properties before sending request?

Is there a way to preload properties before submitting request?

5 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    If you have multiple properties, you can save them into file and load them when you need. Having a file for properties really helps at times, say, different environments may use different values, so user can modify those values and load it.
    If you want to load the properties automatically? Then you can write a reading properties files and setting values to properties using SetupScript for the project and pass the filename using a jvm argument say -Dsoapui.properties=<file path of property file>, Use System.getProperty('soapui.properties') in the SetupScript.

    You call soapui.sh -Dsoapui.properties=<file path of property file> or testrunner.sh -Dsoapui.properties=<file path of property file> to load the properties automatically.
    Am I off track from the question?
  • lc25s's avatar
    lc25s
    Occasional Contributor
    Tks for the reply. For clarity, I have a properties file as a test step, I'd like to use say a start-up script to pull all of those properties, and update the soap request so that instead of #phone-number I would see the actual phone number. Does that help? Your response suggested editing the file prior to launching the gui. Id like to be able to update a properties file, and during start-up, update the request.
  • nmrao's avatar
    nmrao
    Champion Level 3
    That was an example. You may do it similarly for the properties at different level after lauch of soapui.
  • lc25s's avatar
    lc25s
    Occasional Contributor
    so, 1) write them to file and 2) from the startup script I can call System.getProperty ? or is there more to it?
  • nmrao's avatar
    nmrao
    Champion Level 3
    That is correct, once you get the property files in the load/setup script, properties needs to be set with the values provided in the file, loop thru keys and set values.