---
title: "Verify returning from a product restores the intended search context"
description: "Open a product from filtered search results, return with browser Back, and check query, filters, sort, page, and selected result context against the navigation policy."
canonical_url: "https://vostride.com/agent-library/product-catalog/back-navigation-search-state.md"
md_url: "https://vostride.com/agent-library/product-catalog/back-navigation-search-state.md"
content_kind: "recipe"
topic: "product-catalog"
---

# Verify returning from a product restores the intended search context

Open a product from filtered search results, return with browser Back, and check query, filters, sort, page, and selected result context against the navigation policy.

## Risk

Shoppers often inspect several products from one search. Losing the query or returning to an unrelated result page can make the catalog difficult to use even when each product detail route is individually correct.

## Fixtures

- A controlled catalog with enough products for multiple filtered result pages.
- A run-specific search phrase, one active filter, and a nondefault sort order.
- A documented browser-back restoration policy covering page selection and scroll position tolerance.

## Steps

1. Run the fixture search, apply the filter, choose the nondefault sort, and navigate to the second result page.
2. Verify the query text, selected filter, sort control, page indicator, and stable identifiers of visible results.
3. Open one known product and verify its detail identity so the navigation is proven to have completed.
4. Use browser Back and verify restored query, filter, sort, and page match the documented policy; check the selected product is present in the expected result context.
5. Reload the restored results URL and verify URL-backed state remains coherent, recording scroll restoration separately when it is an explicit product requirement.

## Expected results

- Return navigation preserves the search dimensions promised by the product.
- The restored result set contains the expected products in the expected order.
- Reload agrees with URL-backed state rather than silently dropping filters or page selection.

## False-pass traps

- Restoring the search input alone can hide lost filters or an incorrect page.
- Exact pixel scroll comparison is inappropriate unless the product requires it and the viewport and content are controlled.

## Cleanup

- Clear account-saved search preferences and remove the controlled catalog fixtures if they were run-created.

## Use with agent-qa

Adapt this test design to your application's acceptance criteria and configured target using the [recipe execution guide](/agent-library/software-factory/turn-a-recipe-into-an-agent-qa-test.md). External fixture setup and non-UI checks require your own supported hooks or test tooling. Validate the authored test, execute it, and inspect the completed evidence; this recipe is not a recorded test result.

## References

- [agent-qa test](/docs/agent-qa/configuration/test.md)
- [agent-qa hooks](/docs/agent-qa/guides/hooks.md)
- [agent-qa auth state](/docs/agent-qa/guides/auth-state.md)

- [Product catalog QA recipes](/agent-library/product-catalog.md)
- [Software factory QA library](/agent-library.md)
