Ask a Question

Generic assertion.

Generic assertion.


It will be nice to have the option to set generic assertion for all the API request in the project , or to select some of the APEs should have the same assertion .



meaning of generic assertion - The user will create the assertion and will have the option to set it the over API requests.

Motivation - I have hundreds of API requests, more then have of them have the same assertion ,so i need to copy paste them one by one.

New Contributor

Being able to apply a single assertion over mutliple steps, cases, suites would be helpful especially if it changes so you only have to update one spot instead of each test step.


I like the idea!


I will bring this up with our product owners.


Kind regards,

Manne, Ready! API Developer

Community Hero

@MFagerlind, @mishka,


I believe that the Event's feature be used to do the same even now, TestRunListener.afterTestStep?


User even can run the required assertion based on certain conditions such as request type or operation / method type / response matching certain xsd etc.


Yes, that's a workaround you could try, since we haven't implemented the generic assertion yet, although you have to know a bit about scripting then, of course.

New Contributor



Can you please post example of such script?


Hi Mishka,


Just to be clear, the script below won't work like an assertion, in that it won't add an assertion result in the GUI, etc, but it will allow you to fail a test case and will log the reason in the script log. This may not be enough for you, and it's clearly not a substitute for the full feature - thanks again for the suggestion!


def testStep = testStepResult.testStep
def responseContent = testStep.testRequest.assertableContent
if (responseContent.length() < 100000) {
def failureMessage = "Response content to short - test step: $"









Maybe it would be better if we can add assertions on the Project dashboard,


Go to Project Dashboard, Browse project, select your API, select a request, run it, add assertions.


Now whenever you pick this REST request to be added to testcase, it  already has the assertions you put on it.

Welcome to the ReadyAPI Feature Requests board!

Here you can review submitted feature requests and vote up the ones you like! If you can't find the feature you want - go ahead and suggest your own idea. Ideas with the highest rating can be implemented in the product.

Check out the Create a Feature Request guide for more information.
New Here?
Welcome to the Community
Sign Up Here