Reputation: 528
Is there any way to access the mock service custom properties, from a mock operation groovy script?
Please check image, custom properties shown left bottom corner which are mock service properties.
Upvotes: 1
Views: 1267
Reputation: 18517
To access a Mock service custom property from inside the Mock script itself you can use the property expansion as follows:
From the SOAPUI documentation:
#MockService# - references a MockService property in the containing MockService
So this can do the trick:
context.expand('${#MockService#YourPropertyName}')
For you specific case:
def userId = context.expand('${#MockService#UserID}')
def password = context.expand('${#MockService#Password}')
Upvotes: 4