How to omit parameters in a REST request
For my automation project I will have a lot of testsuites and testcases with a lot of combinations. For each testsuite I've entered the necessary parameters to be able to use in each testcase. In ReadyAPI you do that in tab "Projects" on your created webservice.
Now, not all parameters will be filled in for a particular testcase whereas the REST request will send anyways all the parameters as emtpy string.
For this project this is harmful, as an empty string could give an answer, and that isn't what I'm looking for.
Testsuite parameters: name, cbe_number, country, municipality, neighbours, street, housenumber, po_box
Testcase: Search company on name
For this testcase only parameter 'name' will be filled in, but when I send the request, all other parameters are also filled in in the URL. How can I, per testcase, omit the other parameters please?
Thanks in advance.
Solved! Go to Solution.
As @nmrao said - if you step through his instructions line by line - you'll get it - it's all there in the instructions - I made a similar mistake a week ago when I didn't notice that a snippet Rao had given me was a script assertion and not a groovy script - despite him stating it several times.
I think you're missing things from the instructions cos you're rushing, I understand it's pretty new to you, so you need to take it slowly rather than rush, cos you're missing essential points. This only works if you tick all the boxes, miss anything out and it won't work.
So in regards to the instructions - read the line, understand the line, apply the line's instuctions and move onto the next line in the instructions.
If there's a point you don't understand in the instructions then come back with specific questions referencing the part you are struggling with.
Hope this helps,
I was asking to refer my earlier reply (earlier do not know how point to that reply, now showing that below) and follow the instructions as is. And post the details of issue such as log or screen shot if it does not work.
I'm going one more time try to answer (as my previous answers were seen as spam)
As @richie said, I have indeed misunderstood 1 step and it's absolutely not my intend to be rude or unrespectfull! I DO understand that you're helping us out of free will, so thanks for that and thank you for your time! I really mean this.
@nmrao I have re-read all the posts and yes, it's not always clear to me to what you are referring to. That's why I'm taking the last answer you're giving me and I'm replying to that.
Nevertheless I have indeed re-read the post that you have copied now and did it step by step as Richie said. this step is not clear to me:
Define a custom property at Project level for the service host and post details
Property name as SERVICE_HOST_PORT and value as http://localhost:8080 (or what ever)"
What I've done now, is going to tab 'Project', create a new webservice that's called SERVICE_HOST_PORT
and I added an Endpoint on it.
What I don't understand is "Property name as SERVICE_HOST_PORT "
I can't see Property name anywhere
Shoud I click on something else? Should I highlet the node 'get' and add in the "Method Properties" the value "SERVICE_HOST_PORT" ?
Please advice on this.