background image
<< Supporting Custom Objects | Custom Objects - Supporting graphical controls >>
Custom Objects - Mapping custom classes to standard classes
<< Supporting Custom Objects | Custom Objects - Supporting graphical controls >>
318
User's Guide
17 S
UPPORTING
C
USTOM
O
BJECTS
Mapping custom classes to standard classes
For example, on Windows, SilkTest supports the standard MFC library,
which is a library of functions that allow for the creation of objects and the
mechanism of interaction with them. In supporting these libraries, SilkTest
contains algorithms to interrogate the objects based upon the standard
libraries. When these algorithms do not work, SilkTest reports the object as a
CustomWin.
Let's say that you see a text box in a window in your application under test. It
looks like a normal text field, but SilkTest calls it an object of the class
CustomWin.
The reasons
There are two reasons why SilkTest sees the object as a CustomWin.
·
Upon its definition in the application under test, the control was simply
named differently than the standard name. For example, instead of it
being named a TextField, it was named EnterTextRegion. If this is the
only reason, then you can class map the control to the standard name, as
described in the next section, "Mapping custom classes to standard
classes".
You never know whether class mapping will work until you try it. It will
work if the object isn't really a custom object, but rather a standard
control with a non-standard name. Try this as your first attempt at
dealing with a CustomWin.
If the class mapping does not work, it is because of the following reason.
·
The object truly is a custom object, that is, the software in the application
under test that creates and manipulates the object is not from the standard
library. That means that the SilkTest algorithms written to interrogate this
kind of object will not work, and other approaches will have to be used to
manipulate the object.
If the object is a graphical control, such as a tool bar, see "Supporting
graphical controls" on page 319
. If the object is not a graphical control,
such as a text box, see "Supporting nongraphical controls" on page 322.
Mapping custom classes to standard classes
When an object shows up in the Record Window Declarations dialog as a
CustomWin, but is actually a standard GUI object which the application
developers have renamed, you should map the custom class name to the
built-in class name while in the dialog.