How to omit parameters in a REST request
- 6 years ago
Couple of things:
To be able to use below groovy script, an external library is needed which can be downloaded from here and copied under READYAPI_HOME/bin/ext directory and restart the tool before running it.
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)
Now coming to each test case, you may want to send certain query and header parameters.
Define custom properties at test case leve as shown below in the same notation (do not use angular brackets, just shown for separation). Also shown in the picture below.
QUERY_<parametername> and its value
HEADER_<parametername> and its value
Define as many query and header parameters as needed for the specific test.
That way, correct parameters can be identified and passed automatically under query, header sections respectively.
And now in each test case, you will only have one Groovy Script test step with above content and only custom properties are changed.
You can find the script in text format from my git
- 6 years ago
About omitting the parameters...
If a parameter with an empty value shouldn't be sent, you need to un-check the Required check-box for this parameter in the Advanced options section for this parameter.