JavaScript Menu by Deluxe-Menu.com

Web Extensibility

Level
Adv
Advanced

QuickTest Professional Web Add-in Extensibility enables you to provide high-level support for third-party and custom Web controls that are not supported out-of-the-box by the QuickTest Professional Web Add-in.

About QuickTest Professional Web Add-in Extensibility

The QuickTest Professional Web Add-in provides built-in support for a number of commonly used Web controls. You use QuickTest Professional Web Add-in Extensibility to extend that support and enable QuickTest to recognize additional Web controls
When QuickTest learns an object in an application, it recognizes the object as belonging to a specific test object class. This determines the identification properties and test object methods of the test object that represents the application's object in QuickTest.
When QuickTest learns the controls on a Web page without Extensibility, it ignores certains types of elements and does not create test objects to represent the controls they define.
For other Web controls that are not supported out-of-the-box by the Web Add-in, QuickTest creates a generic WebElement test object. This type of test object might not have certain characteristics that are specific to the Web control you are testing. Therefore, when you try to create test steps with this test object, the available identification properties and test object methods might not be sufficient.

Identifying the Building Blocks of Web Add-in Extensibility

The sections below describe the main elements that comprise QuickTest object support. These elements are the building blocks of Web Add-in Extensibility. By extending the existing support of one or more of these elements, you can develop the support you need to create meaningful and maintainable tests.

Test Object Classes

In QuickTest, every object in an application is represented by a test object of a specific test object class. The test object class determines the list of identification properties and test object methods available in QuickTest for this test object. The icon used to represent the test object in QuickTest, for example in the Keyword View and Object Repository, is also determined by the test object class.

Test Object Names

When QuickTest learns an object, it creates a unique name for each test object on the page. A descriptive test object name enables you distinguish between test objects of the same class and makes it easier to identify them in your object repository and in tests.

By default, a test object is given the name of its test object class (appended with an index if there is more than one test object of the same class on the page). In many cases, this is not the ideal name for the custom control.

The test object name needs to be meaningful to the QuickTest user, preferably using terminology that is relevant to your toolkit. QuickTest displays this name in the Keyword View, in the Expert View, and in the object repository.

Test Object Identification Properties

The test object class used to represent the Web control determines the list of identification properties available for the test object. It also determines which of these identification properties are used to uniquely identify the control, which identification properties are available for checkpoints (in the Checkpoint Properties dialog box), and which are selected by default for checkpoints. However, the actual values of the identification properties are derived from the definition of the Web control. Therefore, several Web controls that are represented by test objects from the same test object class might have different definitions for the same identification property.

Test Object Methods

The test object class used to represent the Web control determines the list of test object methods for a test object. However, the actual behavior of the test object method depends on the definition of the specific Web control. This means that the same test object method might operate differently for different Web controls that are represented by test objects from the same test object class.

Recording Events

One way to create QuickTest tests is by recording user operations on the application. When you start a recording session, QuickTest listens for events that occur on objects in the application and registers corresponding test steps. The test object class used to represent a Web control determines which events QuickTest can listen for on the Web control and what test step to record for each event that occurs.

Deciding When to Use Web Add-in Extensibility

The QuickTest Professional Web Add-in provides a certain level of support for most Web controls, but ignores controls defined as DIV or SPAN elements. Before you extend support for a custom Web control, analyze it from a QuickTest perspective to view the extent of this support and to decide which elements of support you need to modify.
QuickTest might recognize the control using a test object class that does not fit your needs. You can use Web Add-in Extensibility to instruct QuickTest to identify the custom control as belonging to a new test object class that you create.
The test object class that QuickTest uses for the control might be satisfactory, but you would like to customize the behavior of certain test object methods or identification properties. You can use Web Add-in Extensibility to create a new test object class that extends the one QuickTest uses, override the implementation of these properties and methods with your own custom implementation, and instruct QuickTest to use the new test object class.
You might find that the test object names QuickTest generates for all objects of a certain control type are identical (except for a unique counter) or that the name used for the test object does not clearly indicate the control it represents. You can use Web Add-in Extensibility to create a new test object class that extends the one QuickTest uses, modify how QuickTest names test objects of your new class, and instruct QuickTest to use the new test object class.
QuickTest might identify individual sub-controls within your custom control, but not properly identify your main control. For example, if your main custom control is a digital clock with edit boxes containing the hour and minute digits, you might want changes in the time to be recognized as SetTime operations on the clock control and not as Set operations on the edit boxes. You can use Web Add-in Extensibility to modify how events that occur on child controls are treated.
During a record session, when you perform operations or trigger events on your control, QuickTest might not record a step at all, or it might record steps that are not specific to the control's behavior. Alternatively, QuickTest might record many steps for an event that should be considered a single operation, or it might record a step when no step should be recorded.

Developing the Toolkit Support Set

In this section we are going to develop the toolkit support set for the DhtmlXCombo toolkit and learn the basics of Web Add-in Extensibility.

About dhtmlxCombo

dhtmlxCombo is a cross-browser JavaScript combobox with autocomplete feature. It extends basic selectbox functionality to meet the requirements of the most up-to-date web applications. dhtmlxCombo can be converted from existing HTML SELECT or populated with JavaScript. Supporting AJAX, it can also get list values from the server datasource dynamically.

for the session please download the dhtmlxCombo demo from the dhtmlX web site, or click here

Discussed Automation Topics

  • Create a toolkit support set for web-extensibility.
  • Object indentification methods.