Another nice post from Groovy in soapUI, check it out: http://groovyinsoapui.wordpress.com/2008/11/27/using-script-assertion-in-soap-ui/
This one is a real treat; a great walkthrough on how to use soapUI for complex functional testing with properties, database-access, etc - the works! Check it out at http://dimosthenes.blogspot.com/2008/10/testing-web-services.html
/Ole
Here comes a nice tip from danielmeyer, check it out: http://ourcraft.wordpress.com/2008/10/15/keyboard-shortcuts-in-soapui/
Thanks a mill!
/Ole
When running a TestCase, the testRunner collects a TestStepResult object for each executed step which contains data and messages related to what was executed. A WsdlTestRequest (a SOAP Request) step for example creates a WsdlTestRequestStepResult result object (which gives access to the entire message exchange for its execution) and a Property-Transfer step creates a PropertTransferResult which contains a log of all transferred values and their corresponding PropertyTransfer configurations.
It is a quite common requirement to control the flow of a TestCase based on some external input or results. The ConditionalGoto TestStep gives a rather coarse possibility to do this with XPath-related functionality, but if you want to do more advanced flow-logic (for example looping, branching, etc) you will have to resort to a groovy script.
Let's dig into the wonderful world of Apache XMLBeans and find out how you can use it to make complex message processing and validation a breeze in your groovy scripts. In this first tutorial we'll do this in the context of a MockService that will use XMLBeans to validate the incoming request and return a fault if the request does not comply with the schema.
Here we go!
We are seeing more and more users doing rather advanced scripting in their soapUI Projects, for example
Since groovy scripts in soapUI have full access to the soapUI object model, anything is possible. Unfortunately though the API documentation is only available in javadoc format and can be hard for new users to grasp, especially if they lack prior knowledge of java or groovy. I'll walk you through the basics of the soapUI API, hopefully giving you a foundation for further exploration.
If you want to disable a TestCase, TestStep or TestSuite maybe based on the outcome of some previous tests you could use
testRunner.testCase.disabled = true|false testRunner.testCase.testSteps["name of teststep"].disabled = true|false testRunner.testCase.testSuite.disabled = true|false
and for assertions this would be:
testRunner.testCase.testSteps["name of teststep"].assertions["name of assertion"].disabled = ...
/Ole
If you want to stop a TestCase from withing a groovy script, use
testRunner.cancel( "I'm getting tired" )
if you want to fail the TestCase use
testRunner.fail( "It didn't work" )
(the string is a reason displayed in the log)
/Ole
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Nov | ||||||
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 | |