Testing query parameter without value in SoapUI - how can I do this?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Testing query parameter without value in SoapUI - how can I do this?
For instance, if I want to test the following URL:
GET http://example.com?api=testAPI&$metadata
How can I append the $metadata to the URL without adding a value to it? It won't work if it has a value.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That didn't have what I was looking for - only query parameters that have values, which I understand how to do already.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is your query parameter name is "$metadata"? Does it contain any value or is it a variable? why do you want to send just parameter without any value?
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes it is. It does not contain a value, but appending it will return me structure information about whatever API I am calling on this web site I am testing.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It can. I've used other query parameters starting with that character, but those ones had values.
So why is my desired test not possible?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For framing the below URL,
GET http://example.com?api=testAPI&$metadata
Solution 1:
I guess you should keep 'api' as query parameter and should hit the request as "GET http://example.com?api=testAPI" and later using 'RequestFilter.filterRequest' option, you should append the later part '&$metadata' to the endpoint using Groovy script.
Solution 2:
Pass the value of 'api' query parameter as "testAPI&$metadata"
Main reason is - SoapUI doesn't send a quary parameter which is not having any value set to it. I expect this to be correct behavior. We are just modding the request to satisfy our needs.
Thanks,
Samy
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can I do this using Groovy? This would seem to be the best solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Since your requirement is directly touching the URI, here is your reference in mode of a plugin,
http://olensmar.blogspot.in/2013/06/a-soapui-plugin-for-runscope.html
Instead of Plugin, this could be achieved even by implementing Custom event handlers in SoapUI Pro/ NG - http://www.soapui.org/scripting---properties/custom-event-handlers.html
Also, if you have a requirement to modify request content on the go, here is again the reference link - http://stackoverflow.com/questions/21277999/soapui-automaticaly-add-custom-soap-headers-to-outgoing-...
Hope this helps you!
Thanks,
Samy
