Skip to main content

Content Starts Here

How to make event RequestFilter.filterRequests run for certain Test Cases?

Question
How to make event RequestFilter.filterRequests run for certain test cases?
Answer
Use dynamic property expansion to return true or false checking if the Test Case name contains the Test Case value in the target of the event handler.

To apply the event for Test Cases that contain the name "Json" use the below dynamic property expansion:
${=request.testCase.name.contains("Json")}

To apply the event only for a Test Case named "JSON test case" use the below dynamic property expansion:
${=request.testCase.name.equals("Json test case")}

User-added image

For more information on the target used to filter when the event handler should run please see below link: https://support.smartbear.com/readyapi/docs/testing/handling-events.html?#filter 
 
Previous MonthNext Month
SunMonTueWedThuFriSat