Forum Discussion

vmm's avatar
vmm
New Contributor
5 years ago
Solved

How to properly create the request body assertion in ReadyAPI custom plugin?

I've manage to create a custom ReadyAPI plugin with two assertions, for request body and response body. Not the separate test steps, but regular assertions to be added to "Assertions" tab in request test step settings.

 

Both classes extend `WsdlMessageAssertion` class and implement `RequestAssertion` and `ResponseAssertion` interfaces respectively. But the issue is both of these assertions are executed with `assertResponse` -> `internalAssertResponse` methods run.

 

So I have two questions:

1) Is it possible to create a request body assertion that will be run properly with `assertRequest` -> `internalAssertRequest` methods run, and how to achive this?

2) Is it possible to execute request body assertion before the actual request during the test case run? Would it be possible with regular request test step assertions, or should it be achieved with assertions as separate test steps?