SCRIPTING RECIPE Product search flow (Target)

Prev Next

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

1.png

  1. 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
target_1.png

4. Hit Save and your Transaction test with login script is ready!
Target_2.png