Ask a Question

How to omit parameters in a REST request

SOLVED
AAB
Regular Contributor

How to omit parameters in a REST request

Hi,

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.

For example:

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.

43 REPLIES 43
AAB
Regular Contributor

errormessage.png

 

So the script is working but still an error message....

nmrao
Champion Level 2

Can you show the project level custom properties, please?


Regards,
Rao.
AAB
Regular Contributor

there's only 'Language'. Nothing more

nmrao
Champion Level 2

I bet, you have not read the reply properly. I would request you to read the answer carefully and try.

 

Thank you.



Regards,
Rao.
AAB
Regular Contributor

customprop.png

nmrao
Champion Level 2

Please re-read and follow actual answer


Regards,
Rao.
richie
Community Hero

Hi @AAB 

 

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,

 

richie

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
AAB
Regular Contributor

my answer/question is spam???????

nmrao
Champion Level 2

@AAB 

 

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.

 

Selection_031.png

 



Regards,
Rao.
AAB
Regular Contributor

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

propertynama.pngShoud 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.

 

cancel
Showing results for 
Search instead for 
Did you mean: