Search Testing

Search is one of the most used features in web applications. Users expect it to work fast, return relevant results, and handle their queries gracefully — even when those queries are unusual.

Functional Search Tests

Test CaseInputExpected Behavior
Exact match“iPhone 15 Pro”Product appears in results
Partial match“iPhone”All iPhone products appear
No results“xyznonexistent123”Friendly “no results” message with suggestions
Empty search(empty string)Show all results or prompt user
Single character“a”Return results or show minimum length message
Special characters<script>alert(1)</script>Sanitized, no XSS execution
SQL injection' OR 1=1 --Safely handled
Very long query1000+ charactersHandled gracefully
Numbers“12345”Search by ID or product number
Unicode“Ünïcödë”Proper unicode handling
Quoted phrases"exact phrase match"Exact phrase results if supported

Search Relevance

Results should be ranked by relevance:

  1. Exact title matches first
  2. Partial title matches second
  3. Description/content matches third
  4. Related or suggested items last

Test that the most relevant result appears first, not buried on page 3.

Search Performance

  • Search should return results within 200-500ms for most queries
  • Autocomplete/suggestions should appear within 100-300ms of typing
  • Very broad searches (returning 10,000+ results) should still respond quickly
  • Search should work with network throttling (slow connections)

Search Filters and Facets

If the search supports filters (category, price range, date):

  1. Apply a filter — do results update correctly?
  2. Apply multiple filters — are they combined correctly (AND vs. OR)?
  3. Remove a filter — do results revert correctly?
  4. Are filter counts accurate? (e.g., “Electronics (42)”)
  5. Does the URL update with filter state (for shareable/bookmarkable results)?

Pagination Testing

Pagination divides large result sets into manageable pages.

Core Pagination Tests

Test CaseExpected
First pageShows items 1-N, Previous disabled, Next enabled
Middle pageShows correct items, both Previous and Next enabled
Last pageShows remaining items, Next disabled, Previous enabled
Page number clickNavigates to correct page with correct items
Items per page changeRecalculates pages, shows correct items
Direct URL access/results?page=5 shows page 5 content

Pagination Edge Cases

  • Total items = 0: No pagination controls should appear
  • Total items = 1: Single page, no pagination controls
  • Total items = exactly page size: Single page, no “next” button
  • Total items = page size + 1: Two pages, last page has 1 item
  • Negative page number: /results?page=-1 should redirect to page 1
  • Page beyond total: /results?page=999 should show last page or empty state
  • Non-numeric page: /results?page=abc should handle gracefully

Sorting Testing

Basic Sort Verification

For each sortable column, verify:

  1. Ascending sort: Items in correct A-Z or low-to-high order
  2. Descending sort: Items in correct Z-A or high-to-low order
  3. Sort indicator: Visual indicator (arrow) shows current sort direction
  4. Default sort: Initial page load shows expected default order
  5. Sort persistence: Sort order preserved when navigating away and back

Sort Edge Cases

ScenarioWhat to Verify
Null/empty valuesWhere do they appear? First? Last? Consistent?
Identical valuesIs secondary sort applied? Is order stable?
Special characters!@# vs. ABC — where do they sort?
Numbers as strings“2” vs. “10” — is it numeric or alphabetic sort?
Mixed case“apple” vs. “Banana” — case-sensitive or not?
Dates across timezonesCorrect chronological order?
Currency with different symbols$10 vs. €20 — how are they compared?

Hands-On Exercise

Complete Feature Audit

Perform a comprehensive audit of this feature area:

  1. Positive tests: Execute all standard user flows and verify outcomes
  2. Negative tests: Invalid inputs, boundary values, error conditions
  3. Integration tests: Data flow between this feature and related components
  4. Security tests: Input validation bypass, unauthorized access attempts
  5. Performance tests: Response times, behavior under slow network

Document Your Findings

#Test CaseStepsExpectedActualStatusSeverity
1[Description][Steps][Expected][Actual]Pass/FailHigh/Med/Low

Common Pitfalls

  1. Data consistency after errors: Is data left in a consistent state after partial failures?
  2. Browser back button: Does pressing back produce unexpected results?
  3. Concurrent modification: Two users modifying the same data simultaneously
  4. Empty states: How does the feature behave with no data?
  5. Maximum data volume: Behavior with large amounts of data

Pro Tips

Tip 1: Test with realistic data including special characters, long names, and multiple languages.

Tip 2: Focus more on unhappy paths than happy paths — that is where QA delivers the most value.

Tip 3: Keep a personal checklist of bugs found in similar features. Bug patterns repeat across projects.

Key Takeaways

  • Systematic testing covers functional, integration, security, performance, and usability aspects
  • Negative test cases reveal more bugs than positive testing alone
  • Always verify both UI behavior and underlying data (API responses, database state)
  • Document findings with clear reproduction steps and severity ratings
  • Build personal testing checklists based on patterns discovered across projects