Dela via


How to: Use Find and Replace in a Web Performance Test

This topic applies to:

Visual Studio Ultimate

Visual Studio Premium

Visual Studio Professional 

Visual Studio Express

Topic applies Topic does not apply Topic does not apply Topic does not apply

You can quickly find and replace text in the Web requests of a Web performance test by using the Web Performance Test Editor.

You can create a context parameter to easily replace all instances of a string in the Web test with the context parameter by using Find and Replace in Request. For example, if you want to parameterize the site portion of https://servername/sitename/sitepage you could create a context parameter for sitename called {{newsitename}} and use Find and Replace in Request to replace all the instances in the Web performance test of sitename with newsitename. For more information, see How to: Use Context Parameters in a Web Performance Test.

Note

You cannot use CTRL+F for find and replace functionality in a Web performance test. CTRL+F opens the Visual Studio Find and Replace dialog box. In a Web performance test, you must use the Find and Replace in Request in the shortcut menu of a node.

To find and replace in a Web performance test

  1. Open a Web performance test.

    The Web Performance Test Editor opens and the request tree for the Web performance test is displayed.

  2. In the request tree, right-click any node and then click Find and Replace in Request.

    The Find and Replace in Request dialog box is displayed.

    Note

    You cannot use CTRL+F for find and replace functionality in a Web performance test. CTRL+F opens the Visual Studio Find and Replace dialog box. In a Web performance test, you must use the Find and Replace in Request in the shortcut menu of a node.

  3. In the Find what text box, type the text you want to find.

  4. In the Replace with text box, type the text you want to use to replace what you entered in the Find what text box.

  5. Click Find Next to locate the first occurrence of the text you entered in the Find what text box in a Web request.

  6. If you determine you want to replace the occurrence, click Replace; otherwise, click Find Next to search for the next occurrence.

  7. Repeat steps 5 and 6 until you find all the occurrences in all the Web requests.

    -or-

    Click Replace All to replace all occurrences in all the Web requests of the text you entered in the Find what text box with the text you entered in the Replace with text box.

See Also

Tasks

How to: Use Context Parameters in a Web Performance Test

Other Resources

Customizing Web Performance Test Recordings Using Web Performance Test Editor