How to write Test Cases for Filters

Test Case for Filters Application

In this how-to, we will walk through how to write test cases for filters. Many applications make use of dropdown filters. Some examples include Google Spreadsheets, Twitter, Amazon, and any modern application. As a result, creating test cases for filters applies to most testers. Follow along with this how-to and finish your application’s first test case by creating your free account in our test case management tool. Before starting our test case, we need to define the Acceptance Criteria.

What are the Acceptance Criteria for our filters?

As discussed in our requirements post, we must have functional requirements. So let’s go ahead and define them as such:

Description: “As an online retailer, users must be able to select and filter the category of product they are searching.”

Acceptance Criteria:

  • Display a complete list of product database categories in the filter dropdown.
  • Show products tagged with the same category as selected in the dropdown.

What are the Filters Test Scenarios?

We will want to document several test scenarios to create test cases for filters successfully. At a high level, they will include:

    1. Verify clicking the filter dropdown expands the filter.
    2. Verify unselecting the filter area collapses the filter.
    3. Ensure application allows displaying filter options prior to searching.
    4. Verify search results before applying filters are accurate and complete.
    5. Validate filtering is optional and not required.
    6. Verify filter functionality is displayed appropriately per business requirements (some requirements may stipulate filtering occurs after retrieving results).
    7. Check if the filter is displayed when database errors are thrown in search results.
    8. Verify values in the filter match the full list available per the database.
    9. Verify maximum text length in the database can be displayed in the filter area.
    10. Validate selecting a filter returns results that match the selected filter.
    11. Verify results outside of the selected filter are not returned.
    12. Ensure the filter is responsive on desktop, laptop, tablets, and mobile phones.
    13. Ensure the filter UI works properly on all browsers your team is certifying (if web application).
    14. Verify if filtering options can be changed after making a selection.
    15. Verify selected filter can be cleared.
    16. Depending on business requirements, verify if a custom criteria filter can be applied.
    17. Validate filter options are persisted from session to session – depending on business requirements.
    18. Verify that returned results can be sorted by relevance.
    19. Verify that returned results can be sorted by keywords.
    20. Check filter options can be hidden if the user desires.
    21. Validate if filter options can be applied without any search query being entered.
    22. Ensure the filter is included on all pages when results have pagination.
    23. Verify search filter corrects any typos.

Keep in mind there are diminishing returns to testing, and developers should be using a thoroughly tested library for filters. However, there is no need to over-test scenarios. For example, if the filters are working on multiple devices, it is unlikely to turn up any bugs to continue testing device permutations.

Writing Test Cases for Filters

In this future section, we will go into detail on how to write the functional test case for filters on your best laptop for software testing.


AccelaTest is a test case management tool packed with features that most other testing tools charge a lot of money for. Get your free account now and create your Test Cases for Search Filter.

Hello there
Do you want to learn the Software Testing techniques, tips, and tricks that have led to a stable, high-paying job and prevented embarrassing multimillion-dollar bugs?