---
title: Search and replace in HTTP actions feature review
url: https://blog.octoperf.com/search-and-replace-in-http-actions-feature-review/
date: '2017-06-15'
authors:
- gpereira
categories:
- Innovation
tags:
- Design
- CSV
- HTTP
description: Speeding OctoPerf's Virtual Users design by using the new Search And Replace feature.
---

# Search and replace in HTTP actions feature review

The latest version of OctoPerf comes with an improvement to the Search HTTP actions: **You can now replace values in the flagged HTTP requests actions!**

## How it works

You could already flag HTTP actions that match some search criteria, for example:

* HTTP actions with a specific header's name,
* HTTP actions with a particular query parameter's value,
* POST requests whose content contains some data,
* etc.

![Search header by name](https://blog.octoperf.com/img/blog/search-and-replace-http-actions/search-header-by-name.png "Search header by name")


**Now you can directly update these HTTP actions** by using the replace features:

* Update the currently selected action by using the _Replace_ button,
* Update all flagged actions by using the _Replace Flagged_ button,
* Update ALL actions by using the _Replace All_ button, available when no action is flagged.

![Replace header by name](https://blog.octoperf.com/img/blog/search-and-replace-http-actions/replace-header-by-name.png "Replace header by name")

The search and replace can be used as any classic Search & Replace feature to replace a characters string by another anywhere in the HTTP request actions of the current Virtual User.

**It also comes with more advanced capabilities for many use cases:**

* Replacing all resources HTTP request actions think times by a fixed value,
* Removing an Authorization header to handle this by using the Basic authentication configuration on the request's server,
* Replacing the value of a GET request query parameter to use a variable from a CSV file,
* Activating the _Download resources_ or _Follow redirects_ options fo all requests,
* etc.

## Example : replacing a query parameter

**Our goal here is to replace a specific query parameter's value.** The query parameter is named 'categoryId' and we want to replace its value by `${category}`, a variable we previously created.

The first step is to open the search _Configuration_ panel by clicking on the cogs icon in the _Search HTTP Action_ section. Then we need to use the advanced mode an configure:

* The search term to EQUALS 'categoryId',
* The search location in 'Query parameter name'.

When we close this panel the search is automatically executed and all actions that contain a query parameter with the name 'categoryId' are flagged. **We can verify it in the Virtual User content:**

![Raw catalog GET action](https://blog.octoperf.com/img/blog/search-and-replace-http-actions/raw-catalog-get-action.png "Raw catalog GET action")

Then we simply click on the _Replace flagged_ button. The replace configuration window is automatically opened. Click on _Add replace function_ then on _Add query parameter_.

**A new replace function is added to the table.** Select 'categoryId' for the name and `${category}` for the value:

![Replace configuration](https://blog.octoperf.com/img/blog/search-and-replace-http-actions/replace-configuration.png "Replace Configuration")

Close the window and click on the _Replace flagged_ button once again. All flagged requests are updated:

![Parameterized catalog GET action](https://blog.octoperf.com/img/blog/search-and-replace-http-actions/parameterized-catalog-get-action.png "Parameterized catalog GET action")

The _Add query parameter_ and _Add header_ replace functions **can be used to add a new query parameter / HTTP headers but also to update existing ones.**

## To wrap up

The search and replace should allow you to **save even more time compared to using JMeter or other tools.**
This is typically the kind of feature we want to continue adding to OctoPerf.
