cancel
Showing results for 
Search instead for 
Did you mean: 

Edit and Submit RAW request without using "Request" tab

Highlighted
Occasional Contributor

Edit and Submit RAW request without using "Request" tab

I would like to change the RAW submission to the server I'm testing. (Specifically to do some negative testing.)

Using the "Request" tab, I'm forced to enter a "true" value into the "$count" parameter to get it to appear.

 

I want to only have "/Public/Property?$count" in the request and not the full "/Public/Property?$count=true" 

 

Ready! API 1.8.0_162.png

 

There are other ways that I'd like to force bad GET requests just to see how my servers respond. 

 

Can the RAW requests be edited to something other than what is generated on the "Request" tab?

 

Thanks

8 REPLIES 8
Highlighted

Re: Edit and Submit RAW request without using "Request" tab

Hi Greg,

 

I looked into this and initially thought you could achieve this with an Event handler of type RequestFilter.filterRequest, which is a good Swiss army knife for modifying requests in various way, but it turns out that direct manipulation of the query string is a bit too low level.

 

It'd be great to have an event handler that fires just before you're sending the request, and I will make a feature request about just that.

 

Meanwhile, I hope that the workaround you came up with is OK.

 

Regards,

Manne, Ready! API developer

Highlighted
Staff

Re: Edit and Submit RAW request without using "Request" tab

Hi!

 

for this specific case you can set the query parameter to be required in the corresponding REST Method definition - which should result it being sent with an empty value

 

/Ole

Highlighted

Re: Edit and Submit RAW request without using "Request" tab

Nice! I didn't think about that!

Highlighted
Occasional Contributor

Re: Edit and Submit RAW request without using "Request" tab

Based on the comments. This is what I did. (For future reference):

Ready! API 1.8.0_164.png

 

But when I did this, the parameter still had the "=" at the end of the GET request:

 

 

 

 

Highlighted
Occasional Contributor

Re: Edit and Submit RAW request without using "Request" tab

Hi Manne,

 

Thanks for the reply. I'm pretty new to this kind of development and using this tool. Could you explain where in the Ready API to edit the Event Handler?


Thanks, Greg

Highlighted
Staff

Re: Edit and Submit RAW request without using "Request" tab

Hi!

 

yes - you're right - that's "expected" behaviour 😞

 

Another alternative to try is to create a HTTP Request TestStep instead of a REST TestStep in your TestCase and simply hardcode the endpoint to contain your query-argument - does that work?

 

/Ole

Highlighted
Occasional Contributor

Re: Edit and Submit RAW request without using "Request" tab

>> create a HTTP Request TestStep

 

Is there an article/tutorial on setting up this kind of request? (The help is greatly appreciated.)

 

Thanks, Greg

Highlighted
Staff

Re: Edit and Submit RAW request without using "Request" tab

Here is the documentation for HTTP testStep,

 

http://readyapi.smartbear.com/structure/steps/request/http/step



Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
New Here?
Join us and watch the welcome video:
Announcements
TechCorner Leaderboard
Want a fun and easy way to learn ReadyAPI and show off your skills? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Compare an expected JSON value and actual response in Events

Participate!

Fetch value/data from JSON response using Groovy Script

See replies!

Filtering data retrieved from a DataSource

See replies!

Get data from Petstore and add it to Excel sheets

Participate!
Top Kudoed Authors