Searching and replacing

Relevant for: GUI actions, scripted GUI components, function libraries, and user code files

When searching in GUI tests you can search in the Editor for text strings only. When searching API tests, you can search in the Editor for text strings, as well as references, derived classes, base classes, or overriding methods, for the current method, function or class.

Note: Search and replace functionality is not available in the Keyword View, the canvas, or an application area.

When performing text searches or replacements you can search throughout an entire solution, test, or folder (even if the file is currently closed). However, the specific file and item types searched within the solution, test, or folder are defined by the search algorithm and cannot be modified by users.

Search strings can be either standard text or regular expressions.

Note: The search is limited to the text in the file at the time that the Find or Replace dialog box was opened. Any changes made after opening the dialog box are not included the search.

When searching for text, you can use standard text or regular expressions in your search strings, and you can perform string replacements. You can also search in documents that are closed but accessible by the search functionality, either by searching an entire solution, or specifying a search folder.

The manner in which UFT One searches differs for GUI tests and components and API tests:

GUI tests and scripted components

When you search for text strings in GUI tests, you can search in actions, function libraries, *.vbs files, or *.txt files. The search is performed in the action scripts, for each action defined in the test.

When you search in scripted components, the search is performed in any defined function libraries.

API tests

When you search for text strings in API tests, you can search in actions, *.cs files, or *.txt files. The search is performed in each source code module and in the test flow.

When you search in a specific C# source code file, the search is performed throughout all user code in theAPI test, as a single text file.

You can search for the following types of items in API tests:

  • Activity or event display names or event handles

  • Global environment variable display names and values

  • Link expressions

  • Loaded XML or schema files

  • Test setting definitions

  • Visible checkpoint or property display names and values

  • X-paths

Tip: If you want to find a specific string in real-time (with highlighting) in the current document, use the Search > Incremental Search or Search > Reverse Incremental Search command. Place the cursor in the current document and type the string to find.

For details on searching and replacing, see Search for references or classes and Replace Dialog Box.