Forum Discussion

marcu's avatar
marcu
New Contributor
16 years ago

LoadUI using -Dsoapui.properties??

Currently we are using soapui with a specific properties file for startup using -Dsoapui.properties=.... The startup file depends on the environment we are testing against (development, test, acceptance).

Now the question is: "How do we handle this when using loadui for testing?" How can we tell loadui which soapui.properties file to use?

6 Replies

  • That seems a very valuable option: to instruct LoadUI to pass to SoapUI specific command line parameters (just like we can do when SoapUI test cases are run from Maven for example). That would allow us to - as MARCU points out - to use the same LoadUI test and the same set of SoapUI tests for multiple environments and situations.

    Can anyone shed any light on this functional wish?

    kind regards,

    Lucas
  • Hi!

    You should be able to specify -Dsoapui.properties=... as an argument to the loadui bat file as well, have you tried that?

    regards!

    /Ole
    eviware.com
  • marcu's avatar
    marcu
    New Contributor
    I've changed my loadui.bat file to run

    "%JAVAWS%" -J-Dsoapui.properties="D:\Program Files\eviware\loadUI-1.0.2-SNAPSHOT\marctest.properties" loadUI.jnlp

    My properties-file contains just one property, which should be printed.

    But this doesn't work.

    If I add my property to <user-dir>\soapui-settings.xml the property is printed.
    So I think my work around should be to manipulate the soapui-settings.xml per environment so I can take care of this.
  • eelzinga's avatar
    eelzinga
    Occasional Contributor
    Hi Marc

    The next scenario works :

    use the commandline startup for loadui :
    loadUI-cmd.bat -Dsoapui.properties=soapui_tst.properties -p test-loadui-project.xml -l

    in the loaded soapui project only 1 teststep with the groovy script output (log.info "debug test " + my_propertyvalue)

    when run from the prompt you will see the output of the log.info with the value of the propertyvalue-variable which resists in the soapui_tst.properties file
  • I did the following to get the -Dsoupui.properties behavior loaded by loadui while using the Workspace rather than command line. Update the loadUI.jnlp file and proivde the -Dkey=value property by adding a <property/> element in the <resource/> element (removing the -D of course).

        <resources>
    <j2se version="1.6+" java-vm-args="-Xms128m -Xmx768m -XX:MaxPermSize=128m -Dsun.java2d.noddraw=true"/>
    <extension name="JavaFX Runtime" href="http://dl.javafx.com/1.3/javafx-rt.jnlp"/>
    <jar href="lib/loadui-launcher-1.0.1.jar" main="true"/>
    <jar href="lib/org.apache.felix.main-3.0.1.jar"/>
    <jar href="lib/commons-cli-1.2.jar"/>
    <jar href="lib/jna-3.2.7.jar"/>
    <jar href="lib/platform-3.2.7.jar"/>
    <property name="soapui.properties" value="<path_to_file>\soupui_test.properties"/>
    </resources>


    The System property is utilized by the SOUPUI runtime when loadui invokes the runner. The property file is picked up relative to your loadui.bat script or it can take an absolute path.