Test suite targets Web apps and treats elements as objects
- By Dan Romanchik
- July 6, 2001
Web sites have quickly evolved from simple pages of text to full-blown computer
applications. Many of the more interesting and useful sites serve their pages directly from a database or allow
users to access data from a database. And as businesses become familiar with the Web and its possibilities, they
will move important business applications to the Web.
The more critical an application is to your business, the more rigorously you need to test that application. You
can do this with a new suite of test tools from Segue Software, Newton, Mass. The suite includes three tools: SilkTest
for functionality tests, SilkPerformer for performance tests, and Surf! to automatically validate all of the links
on your Web site.
OBJECTS OF DESIRE
One of the features that makes this suite so effective in testing Web applications is that it treats each of
the components on a Web page as an object. SilkTest analyzes a Web page and generates a description -- called a
test frame -- that contains all of the elements on the page.
The ability to treat components of a Web page as objects is an important feature for Web applications. The reason
for this, as most Web developers unfortunately know, is that Web pages often appear differently on different browsers.
The page may look one way for a user running Netscape Navigator and another way for a user running Internet Explorer.
Since SilkTest treats Web page elements as objects, the appearance of the Web page does not matter, making it easier
to test a Web application with multiple browsers. The test script will run properly no matter how the browser displays
GENERATING A TEST CASE
Once the test frames are made, you generate a test script using the scripting language 4Test, a proprietary
language. You could write your entire test script in this language, but you'll find it much easier to use SilkTest's
recording feature to automatically generate portions of the script.
This feature works much like the recording feature found in client-server test tools. You command SilkTest to
begin recording, and it records your actions as you move around a Web site and enter values into forms. SilkTest
also records what happens as a result of your actions. That is, it records new pages that are displayed when you
click on a link or text strings the application may display as a result of some data processing.
For example, I maintain Quality Online, an online magazine for quality-control professionals. This Web site
has a search function, which allows users to search the site for articles on a particular topic. From the home
page, users click on a link to go to the search page, then fill in a form field with keywords relating to the information
they want to find. Finally, they click a pushbutton to start the search engine, which searches an index file and
then returns a series of links to articles that may be of interest. To generate a test case for this application,
all I had to do was begin recording, then go through the steps as outlined above. SilkTest recorded all of these
actions and generated 4Test statements for them. After the results were displayed, I clicked the "Back"
button to return to the home page and stopped recording and saved the test case to disk.
To run the test case, all I did was select the Run/Testcase menu and pick the appropriate test case from the
dialogue box. While SilkTest allows you to run individual test cases to do extensive automated testing, you will
want to use SilkTest with Segue's QA Organizer. QA Organizer allows you to define test plans and organize the test
cases to implement those test plans more easily.
Should a test fail, SilkTest reports it and allows you to open the Difference Viewer, which lets you see the
differences between the actual result and the expected result. With this information, you can debug your Web application
more easily. SilkTest also has a built-in recovery system that makes unattended testing possible. Before running
tests, you specify a main window, which is usually the home page of your Web application. You can also specify
a base state to set that window to a known state. SilkTest returns to the main window and base state and is ready
to execute the next test case.
Finally, let me mention the two other products in the test suite, Surf! and SilkPerformer. Surf! checks your
Web application for broken links, but will also tell you if a link produces a different page or document than what
it did originally. SilkPerformer allows you to test the performance of your Web application. With SilkPerformer,
you can use one computer to simulate hundreds of users to perform concurrent testing and load testing of your application.
SilkTest pricing begins at $3,995 per license, SilkPerformer starts at $10,000 per license, and Surf! costs
$495. Volume discounts and all products are available now.
Dan Romanchik is an engineering manager turned writer and Web developer. His current passion is amateur radio. You can read his amateur radio blog at www.blurty.com/~kb6nu.