Skip to content
natritmeyer edited this page Sep 14, 2010 · 5 revisions

Installation

Instructions on where to find and how to install UI Spy are here: http://www.natontesting.com/2010/02/04/where-on-earth-is-uispy/

Introduction

UI Spy can be used to investigate most application user interfaces. WHen writing bewildr scripts you’ll use it a lot to find the details that uniquely identify objects you want to interact with. Most objects will have ‘Automation IDs’ and where true UI Spy will tell you what they are. The same goes for object names, their types, and the ‘Control Patterns’ that are available on them.

When running, the left hand side of the UI spy window presents a hierarchical view of the objects that make up an interface, and bewildr is build around this same hierarchy. The right hand side of the window displays details of the item selected in the object tree.

You’ll notice a few things:

  • The object tree has got one root node – everything hangs off this
  • Below the object tree is a list of windows
  • Each node representing a window can be expanded to reveal all the objects in the window

Turn on ‘Hover Mode’

UI Spy has got a number of ways to interact with objects – the one you’ll use the most is called ‘Hovering Mode’. To enable this, select the button that has an icon of a mouse on it.

Now, when you hold the control-key down on the keyboard and move your mouse over an interface, UI Spy will show you in real time the details of the object being hovered over. Let go of the control-key and the details of the last hovered-over object will be displayed.

The Properties Panel

You’re probably selecting your object because you want to know how to reference it in your bewildr script. If it’s available, use the object’s automation ID. Here’s where you’ll find it:

Now you know to reference the list box as:

my_window.get(:id => "single_select_list_box").some_action

When you’re wanting to find out how to refer to a specific tab within a tab control, you need to use the tab’s name property. Here’s where you’ll find it:

Now, assuming the main tab control is called “my_tabs”, you can select the “text fields” tab using:

my_window.get(:id => "my_tabs").select("text fields")