Contributions
Re: Automate SoapUI
Looking at what you want to do, using something like Jenkins to kick of a specific test or set of tests might be useful. We have several projects that we run using Jenkins, both kicked off manually or kicked off according to a schedule. It's pretty easy to do and can be set up so that the tests are running in their own workspaces, and thus isolated from each other from running the test point of view. Thus you don't need to create the test projects each time, the test projects are defined once in SoapUI, but you just choose the test project you want to run from an existing list of test projects. Might mean you need less groovy skills to programatically create SoapUI projects on the fly. Just a thought and a different approach that might meet your needs.4.3KViews0likes11CommentsRe: Schema Compliance Assertion setting Definition URL with Groovy
Just thought I'd put the code I got to work in my Groovy, just for completeness. import com.eviware.soapui.impl.wsdl.teststeps.assertions.basic.SchemaComplianceAssertion.* . . . def scAssertName = 'isSchemaCompliantWith' + proj.getPropertyValue("useWsdl") def defUrl = 'http://anAddress:1111/'+ proj.getPropertyValue("useWsdl")+'/services/mystuff?wsdl' if (!tStep.getAssertionByName(scAssertName)) { assertion = tStep.addAssertion("Schema Compliance") assertion.setName(scAssertName) assertion.setConfiguration(org.apache.xmlbeans.XmlObject.Factory.parse('<definition>'+defUrl+'</definition>')) // assertion.setDisabled(true) }3KViews3likes0CommentsSchema Compliance Assertion setting Definition URL with Groovy
We have code which sets up our assertions for some of our regression tests like assertion = tStep.addAssertion("XPath Match") assertion.setName("matchAllExceptTimestamp") assertion.path = assertionStatement assertion.setAllowWildcards(true) assertion.expectedContent = contentsFromFile Nowwe want to create a new Schema Compliance assertion, where we will dynamically change theDefinition URL to keep in line with the endpoint (which is assertion = tStep.addAssertion("Schema Compliance") assertion.setName("Schema Compliance for " + endPointOrg) // where endPointOrg is specific to the endpoint assertion.??????? = myDynamicDefinitionURL I know that the assertion can be changed using something like ${#project#myDynamicUrl}, but that means I have to change each test step, as opposed to just changing the groovy code to create the assertion as required. So is there an assertion.?????? method I can use to set the value for the Definition URL to be used for that, how can it be done programatically in groovy. So far I have trawled the community to find the magic incantation, but to no avail, (including trying to find it in the apidocs) so at last I will turn to you all and hope someone can help. Your help in this always appreciatedSolved3.1KViews0likes3CommentsRe: output is not coming on running a groovy script
If you are using the SoapUI GUI for development and test, then when you use a Groovy Script test step, any logged information is put out to the 'script log', which is a new tab at the bottom of the GUI, they do not get logged to the SoapUI log. Just in case you are looking at the SoapUI log. Good Luck1KViews1like0CommentsRe: check if custom property exists
Yes, here is a sample of code using a GroovyScript teststep and the testRunner variable, hasProperty is the method to find out if theproperty exists. This code sees if a property exists and deletes the property if it is found, so that it can be set by another groovy script. def tc = testRunner.getTestCase() if (tc.hasProperty("myCustomProperty")) tc.removeProperty( "myCustomProperty" ) Hope it helps8.1KViews2likes0CommentsRe: Groovy - Fail and Abort the test execution for 500 ISE and continue to run on 4x error codes
Whilst this is not an answer to the question, it is an alternative approach to using script assertions. You might be able to create the Invalid HttpCode assertion programatically with groovy This is how we are creating some assertions, adding them to the test step before the test step executes and letting SoapUI do the clever assertion stuff. def tStep = testRunner.getTestCase().getTestStepByName(stepName) def assertion // add assertions to the test step assertion = tStep.addAssertion("Contains") assertion.setName("hasCustomerAccountNumber") assertion.setToken("customerAccountNumber") You would have to get hold of the setters for creating theInvalid HttpCode assertion,but I found this easier than writing scripts assertions or another test step groovy script to manipulate the response.2.2KViews0likes0CommentsRe: Running SoapUI tests with Maven : Getting org.xml.sax.SAXParseException; Premature end of file excep
When I set up the SoapUI Maven environment, I had to add one extra dependency manually to the pom <dependency> <groupId>com.jgoodies</groupId> <artifactId>forms</artifactId> <version>1.0.7</version> </dependency> I'm not sure if this is the answer to your problem, but if you don't have that dependency in the com\smartbear\soapui\soapui-maven-plugin\5.2.1soapui-maven-plugin-5.2.1.pom, it didn't work in my jenkins/maven/soapui environment. So its worth just checking that and seeing if it gets rid of the problem.1.6KViews0likes1CommentHow to use a response saved in an external file in an assertion to do an XPATH match for the respons
We are using a some groovy scripts to run our SoaPUI soap requests from values extracts from a database, i.e. using a simple data driven mechanism, to allow our test automation to run through Jenkins/Maven. We set the dump file to save the responses, and are looking to read these files back in again, run the soap request using the right data and then compare the contents of the soap response with the contents of the file we used to prime the test. I'm pretty OK on doing everything through groovy in SoapUI, except getting the contents of the file into the SoapUI Soap Request, so that I can use XPATH matches in the assertion. If anyone that has done this sort of thing before has any tips on how I should do this, I'd be very grateful.521Views0likes0Commentstrying to set the name of a script assertion using groovy
I have some groovy code which sets the assertions on a soap test case step to run tests in our automation framework, but for some reason when I try and create a 'Script Assertion' it does not seem to be taking the name correctly. I am hoping I've made a simple mistake and someone can point me in the right direction. Using SoapUI 5.2.1, - Build Date: 20151002-1138 I have this code running in Groovy for the Test Case. This block of code runs correctly adding the assertion to the testcase (teststep) and running. assertion = tStep.addAssertion("Contains") assertion.setName("hasBillingType") assertion.setToken("billingType") This block of code does not work in the same way, as though the setName is not assigning the name to the Script Assertion, instead it opens the interaction window to add the assertion name. This is not helpful as I want to run this using Maven and Jenkins, once its developed. assertion = tStep.addAssertion("Script Assertion") assertion.setName("testScriptAssertion") assertion.setScriptText("log.info 'we are running the script assertion'\n log.inf Any help greatly appreciated.1.4KViews0likes1Comment