Forum Discussion

crawley's avatar
crawley
Occasional Contributor
13 years ago

Maven and properties

I try to use some properties with soapui and try to override in maven

I use it like that in soapui :

<wsse:Username>${#TestSuite#ws.username}</wsse:Username>
<wsse:Password>${#TestSuite#ws.password}</wsse:Password>

and its work fine.

but when I try to override the value with maven it still the old value, I try many solution :
<configuration>
....
<projectProperties>
<value>ws.username=Hello World!</value>
<value>password=Hello World!</value>
<value>#TestSuite#ws.username=Hello World!</value>
<value>password=Hello World!</value>
<projectProperty>ws.password=value1</projectProperty>
<projectProperty>#TestSuite#ws.password=value1</projectProperty>
</projectProperties>
</configuration>

I try with the tag <value> or <projectProperty> but same, nothing...

Any suggestions?

6 Replies

  • crawley's avatar
    crawley
    Occasional Contributor
    Hi,

    I try but no...
    The wsse:Username its a tag in my SOAP request, I would like to change the value from the "custom Properties" ( eg the screenshoot)

    Nicolas
  • crawley's avatar
    crawley
    Occasional Contributor
    Hi,

    For the moment I have only one "testSuites", my goal it's to run the tests on different environment, but I need to change the login and the password for the webservice.
    With the "Custom Properties" I can change the value in one place, but I always must do a modification to the project file, so I try to set them into the pom.xml for each environment.

    So override properties in all testsuites is perfect for me.

    Regards
    Nicolas
  • crawley's avatar
    crawley
    Occasional Contributor
    Great!

    I try this morning, and its look like good, I set my 2 parameters and work fine.
    Now I can run my testsuite just by changing a parameter in the maven command line!
    Good job.

    Nicolas
  • vikingsteve's avatar
    vikingsteve
    Occasional Contributor
    Hello redfish!

    I want to say THANK YOU for this functionality.

    In about 2 hours I was successfully able to add a maven configuration that automated a SoapUi test suite versus 3 different environments.

    I used projectProperties as follows...

    <projectProperties>
    <value>Username=${my-service-username}</value>
    <value>Password=${my-service-password}</value>
    </projectProperties>

    Fantastic!

    One thing however... I'd rather not advertise passwords to the outside world. Is it possible that any key containing "Password" can be starred out when this log message is output?

    e.g.
    15:19:44,444 INFO [SoapUIProTestCaseRunner] Setting project property [Username] to [fantasticuser]
    15:19:44,444 INFO [SoapUIProTestCaseRunner] Setting project property [Password] to [********]

    Since I'm not happy for logs containing passwords to be randomly lying around on the server

    I notice that the SoapUI GUI handles 'password' properties in this way (with stars ******)

    Thanks for your consideration of this request!
    Viking Steve

    Edit: well, you know, I found a solution to this. the maven plugin configuration supports <username> and <password> under configuration. These seem to override the authentication settings that are in my test suite, which is just what i need.
  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    Hi,
    all my previous post and explanation have been removed as my account has been deleted.

    To summarize
    * this feature is available starting from maven-soapui-extension-plugin 4.5.1.3
    * doc of the new parameter is here: https://github.com/redfish4ktc/maven-so ... properties
    * with SmartBear plugins (and also with maven-soapui-extension-plugin) you can override properties for a given testsuite by providing a properties file (see https://github.com/redfish4ktc/maven-so ... ernal-file)