Choosing Events

Top  Previous  Next

In this chapter you will learn how to adjust your requirements to test coverage measurement by choosing events for GUI objects.

How GuiProf Uses Events

Suppose, you need to test a button. To do it, you have to set the focus to a button, click it with the mouse and check the result. As was explained in What is GUI Test Coverage?, in order to measure the test coverage GuiProf needs to know what actions can be done with the button. In this case there are two actions: setting focus and clicking.

To obtain this information, GuiProf analyzes events associated with the button. An event is a notifications about an action that is performed with an object. For instance, when a button gets focus, it raises event Enter. When you click the button, it raises event Click. Each type of GUI object has its own set of events.

Per default, GuiProf uses a minimalistic set of events for each GUI type. For instance, for a button it uses events Enter and Click. For a text box, it uses Enter and TextChanged events. These settings are applied every time you create a new project.

You may wish to override the default settings for a number of reasons. For instance, if a text box in your application has a special reaction on mouse double-click, you can add DoubleClick event for this object. By doing this, you tell GuiProf to include this event in the test coverage measurement. If you forget to test it, GuiProf will show the test-box as untested or partially tested.

You also may wish to narrow down the default event set. For instance, you would like to ignore one menu item in the test coverage measurement. You can remove all events for this menu item and GuiProf will consider it as non-testable.

GuiProf allows to choose events on two levels:

Type level (e.g. set events for all buttons)
Object level (e.g. set events for one particular button)

These features are explained in greater details below.

Events for Type

To choose events for a GUI type, select any object of this type in the tree view and go to Context MenuChoose events for type.... For example, to choose events for all buttons, select any button in the tree and go to the context menu. The following form appears:

sh_choose_events_type

You can now choose the events and press OK or Apply to confirm.

Events for All Forms

To set events for all forms, select any form in the tree view and go to Context MenuChoose events for all forms....

Events for Object

To set events for one particular GUI object, select this object in the tree view and go to Context MenuChoose events for selected object.... GuiProf displays the following dialog:

sh_choose_events_object

To be able to choose events for the object, first select Use objects-specific settings. This tells GuiProf to override type selection for this particular object. Then you can choose events from the list.

Not all events from the list can be raised by the object. It depends on many factors. For instance, a combobox that allows editing its value (mode DropDown), can raise TextUpdate event. If the same combobox is switched to the mode where only selection from the list is allowed (DropDownList), it never raises TextUpdate event. To help you decide whether or not to include an event in the event set, GuiProf displays actual event counters for each event .

To go back to the event set for the type, select Use type settings.

See Also

What is GUI Test Coverage?

Profiling

Analyzing Test Coverage