We call functional testing of web pages in TestComplete web testing.
However, web testing does not only mean that TestComplete can simulate
mouse clicks and keystrokes in your Internet browser, but also that it
can access elements of the page from TestComplete scripts
Functional testing of web pages in TestComplete does not only mean that TestComplete
can simulate mouse clicks and key presses in your Internet browser window, but
also can access elements of the page from TestComplete scripts. We call this
testing web testing.
Currently, TestComplete can access elements of web pages that are
displayed in Microsoft Internet Explorer 5, 6 or 7, Mozilla Firefox
1.5-2.0 or in any browser created on the base of the Microsoft
WebBrowser control (that is, your scripts can access web pages
displayed in a WebBrowser control embedded into an application’s form).
Also, limited support is provided for Netscape Navigator ver. 8.1.2
(access to web page elements is available only if Navigator uses the
Internet Explorer rendering engine).
The web testing feature is available in TestComplete Enterprise
only.
Web page elements are displayed in the Object Browser (and used
in your scripts) via any of the four different object models: DOM, Tag, Tree or Hybrid. The DOM
model is similar to the HTML object model used in web scripts. It has the document
root element and all other page elements are children of this object. In the Tag model
the web page elements are grouped by their tag names. In the Tree
model the hierarchy of web objects correspond to the hierarchy of HTML elements
on the web page. This model is the fastest of the four object models, as the
scripting engine spends less time locating the page element. The Hybrid
model is a combination of the Tree and DOM models. It includes objects
provided by the Tree model and the document object of the DOM model and
can be used to port legacy projects that use the DOM model to a new
Tree model.
Web testing interacts with the “client” side of web pages. It does
not depend on how the pages were prepared on the “server” side (CGI,
ASP, PHP, etc).
TestComplete adds specific methods, properties and events to the browser’s
process and windows that display the web pages. These methods and properties
allow you to navigate to the desired web page, delay script execution until
the page is fully loaded, and so on. For example, you could use the web
testing capabilities of TestComplete to do a “smart comparison” of a generated
web page or to run data-driven tests of an order input screen.
Since TestComplete provides access to properties of web page
elements, you can perform almost any checking and verification actions
over the page. TestComplete also includes special features (web
checkpoints) that let you easily perform various comparison and
verification actions. For instance, you can --
- Compare the entire page, or only its tag structure, or only the contents of some elements against a baseline copy.
- Verify that all links on the page are valid.
- Verify that all IMG elements have the ALT attribute specified.
- Check whether the page contains MAILTO links.
- Check whether the page contains Java applets.
- Plus much more!
The object-oriented testing approach offered by TestComplete lets
you create tests that check only the data and are resistant to changes
in the page layout. By using TestComplete’s web document object models
(see the screenshot for an example), you can directly access specific
document elements and evaluate their properties in your test scripts,
thus allowing you to just assess the data you want.
|