How can I send HTTP/ Rest post request via Groovy script?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can I send HTTP/ Rest post request via Groovy script?
Can someone please provide me the sample code?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes, you should be able to simply use testRunner context variable like:
testRunner.runTestStepByName("my-test-step-name")
Entire API is available here - http://www.soapui.org/apidocs/com/eviwa ... unner.html
but for simple existing examples you can refer to http://www.soapui.org/Scripting-Propert ... ricks.html
Hope this helps!
Vladimir,
SmartBear Sweden
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Between, I did try HTTPBuilder class but was not able to execute the script successfully.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For this you would need to use a third party http library for Java or Groovy (HTTPBuilder being one alternative). For support on using a third party library, please refer to that library's support options.
Please note that soapUI currently does not support the Grape dependency loader mechanism. Any external library (and its dependencies) will have to be manually placed in the bin\ext directory of your soapUI installation.
Regards,
Dain
SmartBear Sweden
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
as this is an old post, is this still the case or is there now a means of doing this without using 3rd party libraries?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using ServiceV and creating virts (then using VirtServer)
Suppose we have a service (api or soap) that takes a request then in formulating the response invokes another service for data to include within its response
in creating a virt to simulate that behavior we can create some datasets to mimic the secondary request response data which we would then have to maintain to ensure that data's relevance as the actual response data varies massively
or we could send an actual request to that secondary service then use the response data in our virts response thereby removing the dependency on that data maintenance
being able to send requests onto other services from virts would be a useful feature in my opinion, as there doesn't seem to be a direct way of doing this the next logical step would be to do this via groovy
regards
Mike
