Knowledgebase

Search:     Advanced search

Escaping Slashes in List View, Menu, and Tree Control Item Text in QA Wizard Pro Scripts

Article ID: 795  |  Last updated: 07 Jun, 2017

If text in menu, list view, and tree control items includes forward or back slashes, you need to escape the slashes. This tells QA Wizard Pro to interpret slashes literally during playback.

You only need to escape slashes if you manually add statements in Text View or if existing scripts fail after upgrading QA Wizard Pro. Slashes are escaped correctly in recorded statements.

Forward slashes

Use two back slashes (\\) to escape forward slashes (/) in menu, list view, and tree item text.

The following example shows an escaped forward slash in a statement that selects the 'Find/Replace' item in the Edit menu.

Window("Window").Menu("MenuBar").Item("Edit/Find\\/Replace").Select()

The slash after Edit is not escaped because it indicates the path to the item.

Note: In QA Wizard Pro 2007.2 and earlier, forward slashes were automatically replaced with periods (.) in menu items after recording. If a period represents a forward slash in existing scripts, replace it with a forward slash to match the item text and then escape the forward slash with two back slashes.

Back slashes

Use three back slashes (\\\) to escape back slashes (\) in menu, list view, and tree item text.

The following example shows an escaped back slash in a statement that selects the 'Backslash - \' item in the Character List tree.

Window("Window").Tree("List").Item("Character List/Backslash - \\\\ ").Select()

Article ID: 795  |   Last updated: 07 Jun, 2017
Tags
slash escape

Prev   Next
Cannot Record from QA Wizard Pro or Defect Scribe in Chrome...     QA Wizard Pro Cannot Locate a Repository Item