Seapine Labs
Personal tools

Managing Windows and Controls

From Seapine Labs

Jump to: navigation, search

The first time you record a script against an application, window and control information is captured and saved in the application repository. This information is used during playback to locate windows and controls in the application and perform actions on the objects. If the application changes after scripts are recorded, new windows and controls are added to the repository.

You can modify the window and control data in the application repository to:

  • Provide more intuitive names for windows and controls that are referenced in scripts.
  • Change the properties and values that are used during playback to locate controls.
  • Merge duplicate controls that are captured during recording if the application changes.
  • Update references to modified window and control names in multiple scripts.


Contents

[edit] Capturing window and control data

Each window and control in the tested application has several properties that are used to uniquely identify the object in QA Wizard Pro. Different properties are captured for different types of windows and controls. Following are examples of properties that may be captured:

  • ControlOrder: The order of controls in the window.
  • Focused: Indicates if the control is currently selected.
  • ListItems: The values displayed in a combo box or list box.
  • Number of Items: The number of items in a combo box or list box.
  • SelectedIndexes: The position of items in a combo box or list box.
  • SubType: The definition of the control hin the Window Class.
  • Text: The default text displayed in an edit box or combo box or the text that appears on a button or as a label.
  • Visible: Indicates whether or not the control is displayed.

Before you record a series of scripts, you should take time to properly set up the application in the application repository, which includes capturing the window and controls and modifying their properties.

To capture window and control data, record a script for each major area of the application. These scripts do not have to be used in the future to perform tests. They can be recorded simply to capture data and then deleted. Navigate to each window and dialog box that will be tested. If a window or dialog box is displayed during recording, QA Wizard Pro captures the window, controls, and their properties.

[edit] Modifying window and control names

After new windows or controls are added to the application repository during recording, review the names to make sure they are intuitive. QA Wizard Pro tries to create a meaningful name during recording, but you may want to rename windows and controls so they are more consistent with the tested application. Using intuitive names makes creating and modifying scripts easier.

For example, an application includes a Username field. When recording the first script against the application, QA Wizard Pro names the control ‘editbox8’. It is easier to create and edit scripts if you rename the control to use the field name, ‘Username’, instead of trying to remember that ‘editbox8’ is the Username field.

Windows and controls are displayed alphabetically in the application repository. When you rename windows and controls, you may want to use the same name as the tested application or use a naming convention that groups similar controls. For example, to display all buttons together in the repository, rename the OK and Cancel buttons in the repository to Button - Cancel and Button - OK.

[edit] Modifying window and control properties

Each application window and control has a set of properties that are captured during recording and saved in the application repository. Properties are used as search criteria to find windows and controls in the tested application during playback and to uniquely identify windows and controls in the repository so duplicate objects are not added during subsequent recordings.

Different types of windows and controls have different types of properties and each property has a value. For example, the Text property of an OK button is OK.

A window or control must be unique so QA Wizard Pro can differentiate it from other objects. QA Wizard Pro automatically selects a unique set of properties to use as search criteria for locating objects in the tested application. A window or control is successfully located when its actual property values match the selected search criteria.

QA Wizard Pro stores two values for each property. The Repository Value is the value of the property captured when the script was recorded. The Expected Value is the property value that a script should find when it runs. In most cases, these values will match. If the application changes you may need to change the expected value.

You may also want to select different search criteria based on your knowledge of the application or if QA Wizard Pro cannot locate windows and controls when scripts run. Common search criteria

Following are some of the common properties you can use as search criteria.

  • Left Control Text: The text to the left of the control. This can be the control label or the text in a button or check box to the left of the control. Not applicable for Web controls.
  • Top Control Text: The text above the control. This can be the label for the control or the text in a button or check box above the control. Not applicable for Web controls.
  • Vertical Repeat Index: The order of two or more controls of the same type that have the same X coordinate.
  • Control Order: The order of controls in the window. A control with a Control Order of 0 is the first control created in the window. Control Order is a good search criteria if the controls are not dynamically added or removed from the window. If you add or remove toolbars from a window, this can impact control order.
  • Window Class: The base class for a control. Examples include button, static, and edit. This property is not unique and should be used with another property.
  • Subtype: Definition of the control within the Window Class. This property is not unique and should be used with another property.
  • Parent Relative Left Coordinate: The numeric location of the control measured in pixels from the left edge of the dialog box or window. Use with another property to define search criteria.
  • Parent Relative Top Coordinate: The numeric location of the control, measured in pixels from the top edge of the dialog box or window. Use with another property to define search criteria.
  • Href: The URL associated with a hyperlink.
  • Text: The default text that appears in an edit box or combo box or the text that appears on a button or as a label. Text can generally be used alone to define search criteria for buttons or check boxes.













Issue Management Software | Source Code Control Software | Test Case Management