Contributions
How to POST multipart/form-data with soapui 4.0.1 (free)
I am trying to POST a multipart/form-data with 2 form-data parts. The first part is a String, name="directive" and value="STORE_AND_PROCESS". The second part is the contents of a file (as opposed to a file attachment). So the POST request looks like this: *************************************************** POST http://172.18.14.169:8181/services/content/ HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: multipart/form-data; boundary="----=_Part_1_1530692737.1361832805105" MIME-Version: 1.0 User-Agent: Jakarta Commons-HttpClient/3.1 Host: 172.18.14.169:8181 Content-Length: 10042 ------=_Part_1_1530692737.1361832805105 Content-Type: multipart/form-data Content-Transfer-Encoding: 8bit ----=_Part_0_514145621.1361832485399 Content-Disposition: form-data; name="directive" STORE_AND_PROCESS ----=_Part_0_514145621.1361832485399 Content-Disposition: form-data; name="file"; filename="C:\path\to\myfile.json" Content-Type: application/json { "properties":{ "title": "myTitle" } } ***************************************************** I entered the parts into the text area beneath the Media Type drop down (which I set to multipart/form-data). I do not have a Form tab on the REST Test Request screen (is this a soapui Pro feature only?), hence the reason I entered all of this text by hand into this text area. My REST service is failing to process this request, possibly because the boundary is assigned by soapUI when I send the request and is different than the boundary I entered into the text area. So how do I send a multipart/form-data POST request using soapUI 4.0.1 free version? (I am on Windows 7). Thanks.22KViews1like4CommentsHow do I remove a global property from a Groovy script?
I have a Groovy setup script that programmatically creates/sets global properties. In my associated Groovy tear down script I want to remove/delete those same global properties (rather than just set them to null or an empty string). How do I do this? I have tried context.removeProperty( propertyName ) which did nothing (property and its value set in the setup script are still there). I also tried PropertyExpansionUtils.GlobalPropertyExpansionContext.removeProperty( propertyName ) and get a runtime script error that states: Wed Sep 26 13:28:25 MST 2012:ERROR:groovy.lang.MissingMethodException: No signature of method: static com.eviware.soapui.model.propertyexpansion.PropertyExpansionUtils$GlobalPropertyExpansionContext.removeProperty() is applicable for argument types: (java.lang.String) values: [PROPERTY_NAME] Possible solutions: removeProperty(java.lang.String), getProperty(java.lang.String) What am I doing wrong? Thanks - Hugh2.8KViews0likes4CommentsHow to access mock service started by maven plugin
I am starting my mock service using the maven soapui plugin. I start it in the pre-integration-test phase and the log output verifies the SoapUIMockServiceRunner started the mock service. I then run my soapui test suite from the same maven pom file, where I run it in the integration-test phase using the maven soapui plugin. The test starts up fine. My test sends a request to the mock service. I want to verify this request is received by the mock service using a Groovy Script test step in my test suite. How do I programmatically access the mock service since it was started by a different SoapUI runner (SoapUIMockServiceRunner vs. SoapUITestCaseRunner)? (Note, the mock service may or may not be in the same soapui project file. In this case it is, but I know that I will have cases where it will not be) Thanks.1.1KViews0likes0CommentsGroovy access to outputFolder set by maven-soapui-plugin
I am running my soapUI tests using the maven plugin. I have set the output folder to a value that I wish to access in a soapUI test's Groovy Script test step. (I am wanting to generate a report and write it to the same folder specified by the outputFolder setting). I tried testRunner.outputFolder in the Groovy Script, but got an error stating MockTestRunner has no outputFolder property. I had read a previous posting suggesting com.eviware.soapui.SoapUI.cmdLineRunner?.outputFolder, but this returned null. Any help is appreciated.942Views0likes0CommentsSoapUITestCaseRunner and multiple projects
I am trying to automate my project's nightly build process to run all of our soapUI projects during out nightly build on Jenkins. We have roughly 20 individual soapUI projects. I have written a JUnit test class that has a test case for each soapUI project (e.g., testSoapUIPorject1(), testSoapUIProject2, etc.) Each of these JUnit test cases instantiates a new SoapUITestCaseRunner, sets that runner's global properties, project filename, and project properties, and then calls runner.run() This JUnit test class also has @BeforeClass, @Before, and @After methods in it to do one time setup, and setup/teardown per JUnit test case (typical JUnit lifecycle). I also have println statements in each method (including the individual test case methods) to trace execution order. What I am seeing when I run my JUnit test class is that the @BeforeClass method executes, then @Before method, then the first JUnit test case method runs - and then SoapUITestCaseRunner takes over and runs *all* of my soapUI project files (in the order specified by the JUnit test case methods), but the @Before, @After, and remaining JUnit test case methods are not executed. It's not that my soapUI projects are not executed, it's that mu setup and teardown methods per JUnit test case are never executed again. An example: I have soapUI project1 and project2 My JunitTestClass has methods oneTimeSetup(), setup(), teardown(), testProject1(), and testProject2(). Expected execution order would be: oneTimeSetup() setup() testProject1() //creates new SoapUITestCaseRunner teardown() setup() testProject2() //creates new SoapUITestCaseRunner teardown() But actual execution order is: oneTimeSetup() setup() testProject1() testProject2() And if I have 10 soapUI projects (with the associated 10 JUnit test case methods) and I put @Ignore on a couple of them, the first testProject1() method that executes honors the @Ignore annotations, knowing which soapUI projects to run and which not to run. Can anyone help me understand why this is happening? Thank you.2.3KViews0likes0Comments