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 Case | Input | Expected 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 query | 1000+ characters | Handled 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:
- Exact title matches first
- Partial title matches second
- Description/content matches third
- 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):
- Apply a filter — do results update correctly?
- Apply multiple filters — are they combined correctly (AND vs. OR)?
- Remove a filter — do results revert correctly?
- Are filter counts accurate? (e.g., “Electronics (42)”)
- 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 Case | Expected |
|---|---|
| First page | Shows items 1-N, Previous disabled, Next enabled |
| Middle page | Shows correct items, both Previous and Next enabled |
| Last page | Shows remaining items, Next disabled, Previous enabled |
| Page number click | Navigates to correct page with correct items |
| Items per page change | Recalculates 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=-1should redirect to page 1 - Page beyond total:
/results?page=999should show last page or empty state - Non-numeric page:
/results?page=abcshould handle gracefully
Sorting Testing
Basic Sort Verification
For each sortable column, verify:
- Ascending sort: Items in correct A-Z or low-to-high order
- Descending sort: Items in correct Z-A or high-to-low order
- Sort indicator: Visual indicator (arrow) shows current sort direction
- Default sort: Initial page load shows expected default order
- Sort persistence: Sort order preserved when navigating away and back
Sort Edge Cases
| Scenario | What to Verify |
|---|---|
| Null/empty values | Where do they appear? First? Last? Consistent? |
| Identical values | Is 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 timezones | Correct 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:
- Positive tests: Execute all standard user flows and verify outcomes
- Negative tests: Invalid inputs, boundary values, error conditions
- Integration tests: Data flow between this feature and related components
- Security tests: Input validation bypass, unauthorized access attempts
- Performance tests: Response times, behavior under slow network
Document Your Findings
| # | Test Case | Steps | Expected | Actual | Status | Severity |
|---|---|---|---|---|---|---|
| 1 | [Description] | [Steps] | [Expected] | [Actual] | Pass/Fail | High/Med/Low |
Common Pitfalls
- Data consistency after errors: Is data left in a consistent state after partial failures?
- Browser back button: Does pressing back produce unexpected results?
- Concurrent modification: Two users modifying the same data simultaneously
- Empty states: How does the feature behave with no data?
- 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