A shopper in Leeds types "trainers". The site sells hundreds of them. Search says "No results found".
Nothing crashed. Nothing logged an error. Every automated test passed, because every test searched for "sneakers", which is the word in the product data. The shopper left, and nobody knew why sales from search had dipped.
That's how search usually fails. Not with an error page, but with results that are quietly wrong, missing or in the wrong order. Which is why testing it means more than checking that a box returns something.
Test cases for search functionality are specific checks that prove a search feature finds the right things, in the right order, quickly and safely, whatever people type, including typos, synonyms, odd characters and attacks, and across filters, pages and devices.
Below are 115 of them, in fourteen groups. After the list, there's a simple method for testing relevance properly, which most test case lists skip, and a 20-case smoke set for every release.
115 Test Cases for Search Functionality
Each test case gives the check and the result that proves it. Where a case mentions a timing, limit or rule, use your product's actual values.
Basic Matching
The everyday queries that make up most real searches.
Exact keyword match. Searching for a known term returns items containing it, ranked by relevance.
Partial word: Typing "lap" returns laptops and laptop bags, if prefix matching is supported.
Multiple words: "Wireless keyboard" ranks items matching both words above items matching only one.
Upper, lower and mixed case: "LAPTOP", "Laptop" and "laptop" return exactly the same results.
Singular and plural: "Jacket" and "jackets" return the same items.
Word forms: "Running" also finds "run" and "runner", where the search is meant to understand word forms.
Common words don't swamp results: "The red dress" behaves like "red dress", rather than matching every item with "the" in it.
Exact phrase: If quotation marks are supported, "red wine glass" finds that phrase, not every red item and every wine glass.
Numbers and units: "32 inch", "32in" and "32″" all find 32-inch screens.
Product codes: Searching an exact SKU or model number returns that item first, with no fuzzy matches above it.
Leading and trailing spaces: " laptop " behaves exactly like "laptop".
Search from every page: Searching from the home page, a category page and an item page all give the same results for the same query.
Spelling, Synonyms and Language
Where most search features quietly fail real users.
One-letter typo: "Iphon" still finds the iPhone, or offers "Did you mean iPhone?".
Swapped letters: "Lpatop" is corrected or matched, just like a missing letter.
Typo tolerance has limits: A very short or very different word isn't "corrected" into something unrelated.
Synonyms: "Trainers" and "sneakers" return the same products, as do "mobile" and "cell phone", where the business serves both terms.
UK and US spellings: "Colour" and "color", or "grey" and "gray", return the same results.
Accents: "Cafe" finds "café", and "Muller" finds "Müller".
Apostrophes and hyphens: "O'Neill" and "ONeill", or "e-mail" and "email", match each other where they should.
Non-Latin scripts: Queries in other scripts, such as Greek, Arabic or Chinese, are accepted and either matched or handled cleanly.
Emoji: A query containing an emoji doesn't cause an error.
Abbreviations: "TV" finds televisions, and "HDMI" isn't treated as a typo.
Language of the site: On a French version of the site, French queries match French product data.
Empty, Odd and Hostile Input
Search has to fail safely, whatever people type.
Empty search: Submitting nothing shows a gentle prompt, or popular searches, never every record or an error.
Only spaces: Whitespace on its own behaves like an empty search.
Only punctuation: "!!!" or "???" returns no results cleanly, with no error page.
Special characters mixed with text: "50% off" and "R&D" search sensibly, with no crash.
Wildcards and regular expression characters: "*", ".*" and "[a-z]" are treated as plain text, not as patterns that return everything or time out.
Very long query: A query of 1,000 characters is trimmed or rejected with a message, without slowing the system.
SQL injection: "' OR 1=1 --" returns no unexpected data and no database error.
Script injection: A query containing a script tag is shown as text on the results page, and never runs.
HTML in the query: Tags typed into search are shown safely, not rendered as formatting or links.
Encoded characters: URL-encoded input in the search link, such as %3Cscript%3E, is handled as safely as typed input.
No results: A query with no matches shows a clear message and something useful to do next.
The Search Box
Small details here decide whether people search at all.
Easy to find: The search box is visible without scrolling, on desktop and on phones.
Helpful placeholder: Placeholder text suggests what people can search for.
Proper label: The field has a label, not just placeholder text, so screen readers announce it.
Enter key works: Pressing Enter runs the search, exactly like clicking the button.
Button works: Clicking the search icon or button runs the search, or opens the box if it's collapsed.
Clear button: The clear (×) button empties the box and returns to the default view.
Keyboard shortcut: If a shortcut like "/" or Ctrl+K exists, it moves the cursor into the search box.
Phone keyboard: On a phone, the keyboard shows a "Search" or "Go" key, and pressing it runs the search.
Recent searches: Recent searches appear when the box is focused, if the product offers them, and can be cleared.
Query stays visible: After searching, the query stays in the box, so people can adjust it.
Box stays usable on small screens: On narrow screens, the box collapses to an icon and expands properly.
Autocomplete and Suggestions
Search as you type is where timing bugs live.
Suggestions appear quickly: Suggestions appear within the target time after typing, often a few hundred milliseconds.
Minimum characters: Suggestions start after the agreed number of characters, not on the first keystroke if that's the rule.
Suggestions are relevant: Suggestions for "wire" are about wireless products, not random items.
Fast typing doesn't show stale suggestions: Typing quickly ends with suggestions for the full word, not for an earlier fragment.
Arrow keys work: Up and down arrows move through suggestions, and Enter selects one.
Escape closes the list: Pressing Escape closes suggestions without clearing the query.
Selecting a suggestion searches: Choosing a suggestion runs the search with exactly that term.
Matching text is highlighted: The typed part of each suggestion is visually highlighted.
No suggestions for hostile input: Script or SQL fragments typed into the box never appear in suggestions.
No private data in suggestions: Suggestions never show other users' searches, names or account details.
Results and Relevance
Search can return data and still be useless. These cases check it's useful.
Best match first: An exact match ranks above partial matches, and a title match above a description match.
Search terms highlighted: Matching words are highlighted in result titles and summaries.
Results show what people need: Each result shows the expected fields, such as title, image, price, date or status, with none missing.
No duplicates: No item appears twice, on one page or across pages.
Result count is right: The total shown matches the number of results across all pages.
Zero results page helps: A search with no results suggests other searches, categories or spelling fixes, and never shows a broken layout.
Did you mean: Spelling suggestions appear for likely typos, and clicking one runs the corrected search.
Promoted results are labelled: Sponsored or pinned results are marked as such, if the business uses them.
Hidden or retired items stay hidden: Unpublished, archived or retired items don't appear for normal users.
Same query, same results: Running the same query twice, a minute apart with no data changes, returns the same order.
Filters, Sorting and Pagination
Where results and data meet.
Filter narrows results: Applying a category filter shows only items in that category.
Filter counts are accurate: Counts next to each filter match the number of results it produces.
Filters combine correctly: Two filters together show only items meeting both, and impossible combinations show a clear empty state.
Price filter boundaries: With a £50 to £100 range, items at exactly £50.00 and £100.00 are included, and £49.99 and £100.01 are not.
Clearing filters: Removing one filter, or all filters, restores the right results.
Each sort works: Sorting by price, date, rating or name orders results correctly, in both directions.
Sort survives pagination: Moving to page 2 keeps the chosen sort, without repeating or skipping items.
Pagination is consistent: Every result appears on exactly one page, and the last page is reachable.
Infinite scroll loads the rest: On infinite scroll, more results load at the end, and loading stops cleanly when there are no more.
Results per page: Changing the number of results per page keeps the same results in the same order.
State and Navigation
People share, refresh and go back. Search needs to survive all three.
Query is in the link: The URL includes the query, filters, sort and page, so the same search can be reopened.
Shared link works: Opening a shared search link in another browser shows the same results.
Back button restores the search: Going back from an item returns to the same results, page and scroll position.
Refresh keeps the search: Refreshing the results page keeps the query, filters and sort.
Browser history makes sense: Each new search adds one history entry, not one per keystroke or filter click.
Fresh and Changing Data
Search reads from an index, and indexes fall behind.
New items appear in time: A newly added item becomes searchable within the agreed time.
Deleted items disappear: A deleted or withdrawn item stops appearing in results and suggestions.
Changes are reflected: A changed price, name or status shows correctly in results, not the old value.
Out-of-stock handling: Out-of-stock items either appear clearly labelled or are excluded, according to the business rule.
Search during re-indexing: Searching while the index is being rebuilt still returns sensible results, or a clear message.
Online Shops
Cases specific to ecommerce search.
Search by brand: A brand name returns that brand's products, with the most relevant first.
Product variants: Searching "blue jacket" shows jackets available in blue, and the selected colour is preselected on the item page.
Add to basket from results: Adding an item from the results page adds the right product, size and price.
Searching across categories: "Black" returns results from several categories, clearly grouped or labelled.
Price shown matches the item page: The price in results matches the price on the item page and in the basket.
Currency and tax display: Prices in results show the right currency and tax treatment for the customer's region, such as including VAT in the UK.
Business Applications
Search in CRM, ERP and other business systems has different rules.
Search by name: Full and partial customer names find the right records.
Search by reference number: An order, case or claim number returns that exact record, with no fuzzy matches.
Date range boundaries: A search from 1 to 31 March includes records on both dates, and none from 1 April.
Search across record types: Global search groups results by type, such as contacts, accounts and cases, and each opens the right record.
Permissions are respected: Users only see records they're allowed to see, and restricted records never appear in results or counts.
Archived records: Archived records are excluded by default, and included only when the user asks for them.
Module search: Search inside a module, such as finance or HR, returns only that module's records.
AI and Natural Language Search
Newer search features need newer checks.
Natural language query: "Waterproof jacket under £100 for walking" returns relevant results, respecting the price limit.
Answers come from real data: AI-generated answers or summaries only mention products, policies or records that actually exist.
Answers show their source: Where the search gives an answer, it links to the item or document it came from.
Out-of-scope questions: A question the search can't answer gets an honest response, not an invented one.
Permissions apply to AI answers: An AI answer never reveals information the user couldn't find through normal search.
Consistent answers: The same question asked twice gives answers that agree with each other.
Accessibility
Search has to work for everyone.
Keyboard-only search: The whole journey, from the box to a result, works with the keyboard alone, with a visible focus indicator.
Screen reader announces results: After searching, the number of results is announced.
Autocomplete is announced: Screen readers announce that suggestions are available, how many there are and which one is selected.
Focus moves sensibly: After a search, focus moves to the results or a results heading, not back to the top of the page.
Contrast and zoom: The search box and results stay readable at 200% zoom and meet contrast requirements.
Performance and Security
Search is one of the busiest parts of most applications.
Results load in time: Most searches return within the agreed target, and slow searches are rare.
Busy periods: Response times stay within targets at peak traffic, such as a sale launch.
Expensive queries: Very broad queries, or ones with many filters, don't slow everyone else down.
Deep pages: Jumping to a very high page number doesn't time out or error.
Rate limiting: Automated, rapid-fire searching from one source is slowed or blocked.
No sensitive data in logs: Search logs don't store passwords, card numbers or other sensitive data people paste into the box.
Pages of results need careful testing in their own right, and our list of pagination test cases covers the edge cases in full.

How to Test Relevance, Not Just Results
Most search test cases check that results appear. Very few check that the right results appear in the right order, which is what actually matters to the person searching. Relevance feels subjective, but it can be tested with a simple, repeatable method.
Build a Golden Query Set
Pick 30 to 50 real queries from your search logs. Include your most popular searches, a few that often return nothing, some with typos and a handful of long, specific ones. For each, agree with the business which results should appear near the top.
Set a Pass Rule
A common rule is that at least three of the five expected results must appear in the top five. For product codes and reference numbers, make it strict, so the exact item must be first.
Run It on Every Change
Run the whole set whenever the search engine, the ranking rules, the synonyms or the product data change. Track the score over time, so a quiet drop in relevance shows up before customers notice.
A worked example (illustrative)
Query | Expected Near the Top | Rule | Result |
|---|---|---|---|
trainers | Running trainers, everyday trainers, kids' trainers | 3 of top 5 | Fail, 0 of 5, synonym missing |
waterproof jacket | Waterproof jackets in the outdoor category | 3 of top 5 | Pass, 5 of 5 |
JKT-044 | The exact product with code JKT-044 | Must be first | Pass |
iphon case | iPhone cases | 3 of top 5 | Pass, 4 of 5, typo corrected |
gift for dad under £30 | Gifts priced at £30 or less | 3 of top 5, all £30 or less | Fail, two items over £30 |
Three passes and two failures, and each failure points at a specific fix.
Add the missing synonym, and make price limits in natural language queries strict. Once the set is stable, the same table becomes an automated test that runs on every release.
Running one search journey against a table of queries and expected results is exactly what data-driven testing is designed for.
A 20-Case Smoke Set for Every Release
You won't run all 115 cases on every change. These 20 cover the failures that hurt most, and the ones that show up first when something breaks.
Area | Test Case Numbers |
|---|---|
Matching and language | 1, 3, 13, 16 |
Hostile and empty input | 24, 30, 31 |
Search box and autocomplete | 38, 49 |
Results | 56, 59, 61 |
Filters and sorting | 69, 72 |
State and freshness | 78, 82 |
Permissions and AI answers | 96, 100 |
Accessibility and speed | 105, 110 |
Add your golden query set to this, and you'll catch both broken search and bad search.
Automating Search Tests
Search is tricky to automate with traditional scripts. Autocomplete lists appear and disappear in milliseconds, results load after the page, and search boxes in business systems are often built from components that make elements hard to find reliably. Coded tests tend to fail with "element not found" or "stale element" errors that have nothing to do with search itself.
Three habits make search automation far more dependable. Drive search tests from data, so one journey covers many queries. Check results through the API as well as the screen, so you can tell an index problem from a display problem. And wait for results to settle before checking them, rather than for a fixed time.
If you're automating search with Selenium and hitting stale elements during autocomplete, our guide to the stale element reference exception explains why it happens and how to fix it.
How Virtuoso QA Helps You Test Search
Virtuoso QA lets you write search tests in plain English, the way you'd describe them to a colleague, and run them against a whole table of queries at once. Your golden query set becomes a data table, with one journey that searches each query and checks the expected results, so relevance testing runs on every release instead of once a quarter.
The same journey can call your search API to check what the index returned, then check what the customer sees on screen, so you know straight away whether a problem is in the data or the display.
Journeys run across 2,000+ browser and OS combinations in parallel, which matters for search, because autocomplete and keyboard behaviour often differ between browsers. When the search box or results layout changes, Virtuoso QA works out where elements moved and heals the step visibly, or proposes a fix for someone to accept.
Virtuoso QA's automated regression testing runs your search journeys and golden query sets on every release, across browsers, so a missing synonym or a stale index is found before your customers find it.
Related Reads
Search Functionality Test Cases FAQs
What are the most important test cases for search functionality?
How do you test search relevance?
What negative test cases should search have?
How do you test autocomplete?
How is testing AI search different?
How do I test search functionality across browsers?
Written by

Rishabh Kumar
AI Testing & Quality Engineering Contributor
Rishabh leads business development and marketing at Virtuoso QA. He writes about AI-powered test automation, end-to-end testing, self-healing tests, and quality engineering, exploring how these capabilities can improve test coverage, reduce test maintenance, and support reliable software releases.











