---
title: "SCRIPTING RECIPE Product search flow(Target)"
slug: "scripting-recipe-product-search-flowtarget"
updated: 2023-01-19T21:19:40Z
published: 2023-01-19T21:19:40Z
canonical: "docs.catchpoint.com/scripting-recipe-product-search-flowtarget"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.catchpoint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SCRIPTING RECIPE Product search flow (Target)

## Objectives

This article provides you an example of a product searching flow on the Target website.

The typical purchase flow on an eCommerce website is as given below.

- Open the Target homepage
- Type the product in the search bar
- Hit go/search button

## Prerequisites

- Access to Catchpoint portal with Create/Modify tests permission

## Process

1. Login to the Catchpoint Portal and create a Transaction test

<img src="https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360003553291-1.png" width="337" height="392" alt="1.png" />

2. Copy the script below:
~~~
// Step - 1
open(http://www.target.com)
waitForNoRequest(3000)
setStepName("1 - Home")
fireEvent(//*[@id="search"], "focus")
var string = ${RandomList('controllers', 'shoes', 'home', health, pets)}

// Step - 2
typeKeysAndWait(//*[@id="search"], '${var(string)}')
waitForNoRequest(3000)
setStepName("2 - Home")

// Step - 3
clickAndWait(//*[text()='go'])
waitForNoRequest(3000)
setStepName("3 - Search Results")
~~~

3. Paste the script into the Script Editor and modify the settings accordingly
<img src="https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360004176692-target_1.png" width="662" height="593" alt="target_1.png" />

4. Hit **Save** and your Transaction test with login script is ready!
<img src="https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360004176712-Target_2.png" width="636" height="484" alt="Target_2.png" />
