Knowledgebase

Search:     Advanced search

Scripts Testing WPF Controls Fail After Upgrading to QA Wizard Pro 2010.1.1

Article ID: 831  |  Last updated: 31 Mar, 2015

Problem

Scripts that test Windows Presentation Foundation (WPF) controls fail after upgrading to QA Wizard Pro 2010.1.1.

Cause

The Logical Address By Automation Id and Logical Address By Index control properties were not captured during recording and do not contain values. QA Wizard Pro cannot identify the controls during playback because these properties are used as default search criteria.

Solution

  1. Repopulate the application repository to capture the updated control information. Choose Repository > Populate Repository, select the application, and click Populate. Make sure the 'Only add used controls to the repository' option is selected in the Repository Changes dialog box after populating.
  2. Merge the duplicate controls in the repository. Select the old and new controls, right-click, and choose Merge. Select the new control as the control to keep.
  3. Synchronize the scripts with the repository. Choose Script > Synchronize Multiple With Application Repository, select the scripts to update, and click Open. Click Yes when you are prompted to continue.

Additional information

You may need to perform additional script maintenance after repopulating the repository if errors are returned during playback or scripts include incorrect statements for interacting with WPF controls.

Resolving 'Cannot locate the Control inside the item' or 'Cannot locate the Control' errors

This error is returned when a WPF control cannot be located. Delete the Control(1) parts of the statement. For example:

Change:

Window("ListBoxExamples").ListBox("listBox5").Item("item").Control(1).Control(1).
CheckBox(1).Set()

to:

Window("ListBoxExamples").ListBox("listBox5").Item(“item”).CheckBox(1).Set()

If QA Wizard Pro cannot locate a ToolBar item, you may also need to change the index of the item. For example, if a check box is the second item in a ToolBar item:

Change:

Window("Examples").Toolbar("toolbarName").Item(1).Control(1).CheckBox(1).Set()

to:

Window("Examples").Toolbar("toolbarName").Item(2).CheckBox(1).Set()

Resolving the 'Cannot locate the Label inside the item' error

This error is returned when selecting a list box, list view, combo box, or tree view item. Replace the Label(1).Click() part of the statement with Select(). For example:

Change:

Window("ListBoxExamples").ListBox("listBox5").Item("Label").Label(1).Click()

to:

Window("ListBoxExamples").ListBox("listBox5").Item("Label").Select()

Replacing low-level action statements and multiple Control arguments to clean up scripts

Scripts that select items in a combo box, menu, or toolbar may include low-level actions and several Control arguments, similar to the following example:

#  ' Low-level actions for Control(1) control.

BoundaryChecks(false)

Window("@topwindow").Control(1).Control(1).Control(1).Control(1).
LMouseDown(116, 126, 94)

Window("@topwindow").Control(1).Control(1).Control(1).Control(1).
LMouseUp(116, 126, 156)

BoundaryChecks(true)

#

You may want to re-record these steps to generate more accurate statements. Choose Script > Record Into Script to re-record specific statements.

Article ID: 831  |   Last updated: 31 Mar, 2015
Tags
WPF Windows Presentation Foundation

Prev   Next
Adding HTML Elements to the Application Repository     QA Wizard Pro Server Database ERDs