free seo tool

Groovy Script Assertion soapUI

Groovy Script Assertion is available for both test Request and JDBC Requests.Basically it will provide an editor or a platform to write your code. Let us put it in a simple way, if your response returned a value for a particular field and you need to validate that value against the one you have (it can be a hard coded value, retrieved from database/ external sources, soapUI properties etc), you might use the Script Assertion. See the below example for soapUI Groovy Script Assertion.
def ResponseValue = context.expand( '${GetCustomer#Username}' )
def DatabaseValue = "WebServices" 


assert ResponseValue == DatabaseValue : '''


Response Value is not matching with Database value


'''

In this case, you have two values in variables "ResponseValue" and "DatabaseValue" and you are validating those by using the keyword "assert" . If the values doesn't match, then it will throw an error with message "Response Value is not matching with Database value". This assertion doesn't needs to be as the above example. It could be for some other use as well. Say if you want to validate the length of an email, you can get the email from the response find the length of the email, then assert it with the value you have.
1 comments:
  • Anonymous says:
    September 01, 2014

    This website was... how do I say it? Relevant!!
    Finally I have found something which helped me. Many thanks!


    Feel free to surf to my homepage anti ageing skin care

Post a Comment

This is a new website mainly for SOA Testers using soapUI. Let me know your thoughts/ suggestions.