---
title: "SCRIPTING RECIPE Travel site flow(American Express)"
slug: "scripting-recipe-travel-site-flowamerican-express"
updated: 2025-07-09T20:48:31Z
published: 2025-07-09T20:48:31Z
canonical: "docs.catchpoint.com/scripting-recipe-travel-site-flowamerican-express"
---

> ## 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 Travel site flow(American Express)

## Objectives

This article provides an example site flow on the American Express travel website: searching for flights to purchase. The transaction follows these steps:
- Open American Express Travel homepage
- Type and select the "From" and "To" cities in the search bar
- Select the "Start" and "Return" dates
- Hit the "go/search flight" button

## Prerequisites
- Access to Catchpoint portal with Create/Modify tests permission

## Process

1. Log in to Catchpoint portal and create a Transaction Test
![image.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/image%28466%29.png){height="" width=""}

2. Copy the script below into the **Script** field:
```
// Step - 1 
open("https://travel.americanexpress.com/travel/home") 
setStepName("1 - Home") 
waitForElementPresent("//div[@id='flight']") 

// Step - 2 // Set up search 
typeAndWait("//*[@id='rhFlightFromField']", "LAX") 
fireEvent("//*[@id='rhFlightFromField']", "keydown") 
fireEvent("//*[@id='rhFlightFromField']", "keypress") 
fireEvent("//*[@id='rhFlightFromField']", "input") 
fireEvent("//*[@id='rhFlightFromField']", "keyup") 
pause("1000") click("//*[@id="ui-id-1"]/li[2]") 
type("//*[@id='rhFlightToField']", "JFK") 
fireEvent("//*[@id='rhFlightToField']", "keydown") 
fireEvent("//*[@id='rhFlightToField']", "keypress") 
fireEvent("//*[@id='rhFlightToField']", "input") 
fireEvent("//*[@id='rhFlightToField']", "keyup") 
pause(1000) 
click("//*[@id="ui-id-2"]/li[2]") // Set outDate 
var outDate = ${Time(MM/DD/YYYY,60,60)}; 
var backDate = ${Time(MM/DD/YYYY,65,65)}; 
type("//*[@id='flightStartDate']", "${Var(outDate)}") 
type("//*[@id='flightReturnDate']", "${Var(backDate)}") 
setStepName("2 - Enter Search Details") 

// Step - 3 
clickAndWait("//*[@id='rhSearchFlight']") 
setStepName("3 - Search") 
var selectIndex = ${Random(1, 4)}; 
waitForElementPresent("(//a[text()='Select'])[${var(selectIndex)}]") `
```

3. Modify the settings in the script per your requirements:
![image.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/image%28467%29.png){height="" width=""}

4. **Save** and your Transaction test with login script is ready!
![image.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/image%28468%29.png){height="" width=""}
