---
title: "SCRIPTING RECIPE Search Engine Sites Flow(Google)"
slug: "scripting-recipe-search-engine-sites-flowgoogle"
updated: 2023-01-19T21:19:40Z
published: 2023-01-19T21:19:40Z
---

> ## 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 Search Engine Sites Flow(Google)

## Objectives

This article provides you an example of searching any string on Google website.

The typical purchase flow on a search engine is given below.

- Open Google homepage
- Type anything in the search bar
- Hit go/search button

## Prerequisites

- Access to Catchpoint portal with Create/Modify tests permission

## Process

1. Log in to the Catchpoint Portal and create a Transaction test

![1.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360003553291-1.png)

1. Copy the script below:

```
// Step - 1 open("http://www.google.com")
waitForNoRequest("3000")
setStepName("1. Google Page")
var string = ${RandomList('book', 'pen', 'phone', laptop, football)}
typeKeys("//*[@name='q']", "${var(string)}")
// Step - 2 clickAndWait(//*[@name="btnG"])
waitForNoRequest("3000")
setStepName("2. Search")
```

3. Paste the script into the Script Editor and modify the settings accordingly

![Google_Search_1.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360004176152-Google_Search_1.png)

4. Hit Save and your Transaction test with login script is ready! ![Google_search_2.png](https://cdn.document360.io/cb4af8f9-6751-4fd2-b39c-07aae832badb/Images/Documentation/360004176192-Google_search_2.png)
