0

In SoapUI 4.5.2, I can generally get & set test-request properties with Groovy in a test-case setup script (e.g. someTestRequestStep.getPropertyValue("Password") and someTestRequestStep.setPropertyValue("Password", "S0mePassw0rd"))...except for the WSS-Password Type property.

someTestRequestStep.getPropertyValue("WSS-Password Type") simply returns null and someTestRequestStep.getPropertyList() does not include a property named WSS-Password Type (or anything like it that I see).

someTestRequestStep.setPropertyValue("WSS-Password Type", "PasswordText") does not produce an error...but also does not affect the WSS-Password Type property of the referenced test request that I see in the GUI.

Also, I have explored someTestRequestStep.getModelItem().getSettings() a bit for a solution: no luck thus far.

How can I set the WSS-Password Type property of a SoapUI test request with Groovy?

J0e3gan
  • 8,740
  • 10
  • 53
  • 80

1 Answers1

3

According to this, you should try:

someTestRequestStep.getHttpRequest().setWssPasswordType( "PasswordText" )

Or (more groovily):

someTestRequestStep.httpRequest.wssPasswordType = 'PasswordText'
tim_yates
  • 167,322
  • 27
  • 342
  • 338
  • 1
    That works. Excellent find. One potentially confusing thing I noticed is that if my startup script does not set another test-request property (e.g. _Password_), the new _WSS-Password Type_ value does not show in the GUI right away (i.e. vs. a `setPropertyValue` change like `setPropertyValue("Password", "S0mePassw0rd")` that shows immediately). `setPropertyValue` seems to trigger a refresh of test-request properties in the GUI whereas `setWssPasswordType` does not. To see the solo-updated _WSS-Password Type_, I clicked on another test-request property afterward. – J0e3gan Sep 10 '13 at 14:36