Thursday, June 28, 2007

Recording GUI Scripts in Rational Robot

The Recording Process

When you record a GUI script, Robot records:
  • Your actions as you use the application-under-test. These user actions include keystrokes and mouse clicks that help you navigate through the application.
  • Verification points that you insert to capture and save information about specific objects. A verification point is a point in a script that you create to confirm the state of an object across builds. During recording, the verification point captures object information and stores it as the baseline. During playback, the verification point recaptures the object information and compares it to the baseline.

The recorded GUI script establishes the baseline of expected behavior for the application-under-test. When new builds of the application become available, you can play back the script to test the builds against the established baseline in a fraction of the time that it would take to perform the testing manually.

The Recording Workflow

Typically, when you record a GUI script, your goal is to:

  • Record actions that an actual user might perform (for example, clicking a menu command or selecting a check box).
  • Create verification points to confirm the state of objects across builds of the application-under-test (for example, the properties of an object or the text in an entry field).


Before You Begin Recording

You should plan to use Robot at the earliest stages of the application development and testing process. If any Windows GUI objects such as menus and dialog boxes exist within the initial builds of your application, you can use Robot to record the corresponding verification points.

Consider the following guidelines before you begin recording:

  • Establish predictable start and end states for your scripts.
  • Set up your test environment.
  • Create modular scripts.
  • Create Shared Projects with UNC.

These guidelines are described in more detail in the following sections.

Establishing Predictable Start and End States for Scripts

By starting and ending the recording at a common point, scripts can be played back in any order, with no script being dependent on where another script ends. For example, you can start and end each script at the Windows desktop or at the main window of the application-under-test.

Setting Up Your Test Environment

Any windows that are open, active, or displayed when you begin recording should be open, active, or displayed when you stop recording. This applies to all applications, including Windows Explorer, e-mail, and so on.

Robot can record the sizes and positions of all open windows when you start recording, based on the recording options settings. During playback, Robot attempts to restore windows to their recorded states and inserts a warning in the log if it cannot find a recorded window.

In general, close any unnecessary applications before you start to record. For stress testing, however, you may want to deliberately increase the load on the test environment by having many applications open.

Creating Modular Scripts

Rather than defining a long sequence of actions in one GUI script, you should define scripts that are short and modular. Keep your scripts focused on a specific area of testing — for example, on one dialog box or on a related set of recurring actions.

When you need more comprehensive testing, modular scripts can easily be called from or copied into other scripts. They can also be grouped into shell scripts, which are top-level, ordered groups of scripts.

The benefits of modular scripts are:

  • They can be called, copied, or combined into shell scripts.
  • They can be easily modified or rerecorded if the developers make intentional changes to the application-under-test.
  • They are easier to debug.

Creating Modular Scripts with UNC

When projects containing GUI or Manual scripts are to be shared, create the project in a shared directory using the Uniform Naming Convention (UNC). UNC paths are required for GUI test scripts and Manual test scripts that are run on Agent computers.

Tuesday, June 19, 2007

Hosting Robot/Applications on a Terminal Server

Robot supports the following Terminal Server environments:
  • Citrix MetaFrame (WIN2K)/Citrix MetaFrame client
  • Microsoft Terminal Server (WIN2K)/Microsoft Terminal Server client
  • Windows 2000 Server
  • Windows Terminal Server (Windows NT4)
The server hosts both the application under test and Robot. Robot runs on the client as a terminal server session. Rational Robot supports GUI script recording and playback on the server or from the client. The TestManager Log Viewer edition can be run from the server or from the client.

Starting Robot and Its Components

Before you start using Robot, you need to have:
  1. Rational Robot installed.
  2. A Rational project.

Logging On

When you log onto Robot or one of its components, you provide your user ID and password, which are assigned by your administrator. You also specify the project to log onto.


To log on:

  • From Start > Programs > Rational product name, start Rational Robot or one of its components to open the Rational Login dialog box.



Opening Other Rational Products and Components

Once you are logged onto a Robot component, you can start other products and components from either:




Some components also start automatically when you perform certain functions in another component.

Wednesday, June 13, 2007

Testing Applications with Rational TestFactory

Rational TestFactory is a component-based testing tool that automatically generates TestFactory scripts according to the application’s navigational structure.

TestFactory is integrated with Robot and its components to provide a full array of tools for team testing under Windows NT 4.0, Windows XP, Windows 2000, and Windows 98.

With TestFactory, you can:
  • Automatically create and maintain a detailed map of the application-under-test.
  • Automatically generate both scripts that provide extensive product coverage and scripts that encounter defects, without recording.
  • Track executed and unexecuted source code and report its detailed findings.
  • Shorten the product testing cycle by minimizing the time invested in writing navigation code.
  • Play back Robot scripts in TestFactory to see extended code coverage information and to create regression suites; play back TestFactory scripts in Robot to debug them.

Managing Defects with Rational ClearQuest

Rational ClearQuest is a change-request management tool that tracks and manages defects and change requests throughout the development process. With ClearQuest, you can manage every type of change activity associated with software development, including enhancement requests, defect reports, and documentation modifications.


With Robot and ClearQuest, you can:

  • Submit defects directly from the TestManager log or SiteCheck.
  • Modify and track defects and change requests.
  • Analyze project progress by running queries, charts, and reports.


Collecting Diagnostic Information During Playback


Use the Rational diagnostic tools to perform runtime error checking, profile application performance, and analyze code coverage during playback of a Robot script.

  • Rational Purify is a comprehensive C/C++ runtime error checking tool that automatically pinpoints runtime errors and memory leaks in all components of an application, including third-party libraries, ensuring that code is reliable.
  • Rational Quantify is an advanced performance profiler that provides application performance analysis, enabling developers to quickly find, prioritize, and eliminate performance bottlenecks within an application.
  • Rational PureCoverage is a customizable code coverage analysis tool that provides detailed application analysis and ensures that all code has been exercised, preventing untested code from reaching the end user.


Performance Testing with Rational TestManager


Rational TestManager is a sophisticated tool for automating performance tests on client/server systems. A client/server system includes client applications accessing a database or application server, and browsers accessing a Web server.

Performance testing uses Rational Robot and Rational TestManager. Use Robot to record client/server conversations and store them in scripts. Use TestManager to schedule and play back the scripts. During playback, TestManager can emulate hundreds, even thousands, of users placing heavy loads and stress on your database and Web servers.

Doing performance testing with TestManager, you can:

  • Find out if your system-under-test performs adequately.
  • Monitor and analyze the response times that users actually experience under different usage scenarios.
  • Test the capacity, performance, and stability of your server under real-world user loads.
  • Discover your server’s break point and how to move beyond it.

Managing Requirements with Rational RequisitePro

Rational RequisitePro is a requirements management tool that helps project teams control the development process. RequisitePro organizes your requirements by linking Microsoft Word to a requirements repository and providing traceability and change management throughout the project lifecycle.

Using RequisitePro, you can:

  • Customize the requirements database and manage multiple requirement types.
  • Prioritize, sort, and assign requirements.
  • Control feature creep and ensure software quality.
  • Track what changes have been made, by whom, when, and why.
  • Integrate with other tools, including Rose, ClearCase, Rational Unified Process., and SoDA.

Using Robot with Other Rational Products

Rational Robot is integrated with many other Rational products and components, including TestManager, TestFactory, ClearQuest, Purify, Quantify, PureCoverage, and RequisitePro. The products and components are available based on what you have installed.

Planning and Managing Tests in TestManager

Rational TestManager is the one place to manage all testing activities – planning, design, implementation, execution, and analysis. TestManager ties testing with the rest of the development effort, joining your testing assets and tools to provide a single point from which to understand the exact state of your project.
Test Manager supports five testing activities:
  1. Plan Test. The activity of test planning is primarily answering the question, "What do I have to test?" When you complete your test planning, the result is a test plan that defines what to test. In TestManager, a test plan can contain test cases. The test cases can be organized based on test case folders.
  2. Design Test. The activity of test designing is primarily answering the question, "How am I going to do a test?" When you complete your test designing, you end up with a test design that helps you understand how you are going to perform the test case. In TestManager, you can design your test cases by indicating the actual steps that need to occur in that test. You also specify the preconditions, postconditions, and acceptance criteria.
  3. Implement Test. The activity of implementing your tests is primarily creating reusable scripts. In TestManager, you can implement your tests by creating manual scripts. You can also implement automated tests by using Rational Robot. You can extend TestManager through APIs so that you can access your own implementation tools from TestManager. Because of this extensibility, you can implement your tests by building scripts in whatever tools are appropriate in your situation and organization.
  4. Execute Tests. The activity of executing your tests is primarily running your scripts to make sure that the system functions correctly. In TestManager, you can run any of the following: (1) an individual script, which runs a single implementation; (2) one or more test cases, which run the implementations of the test cases; (3) a suite, which runs test cases and their implementations across multiple computers and users.
  5. Evaluate Tests. The activity of evaluating tests is determining the quality of the system-under-test. In TestManager, you can evaluate tests by examining the results of test execution in the test log, and by running various reports.


Planning and managing tests is only one part of Rational TestManager. You also use TestManager to view the logs created by Robot.

Managing Intranet and Web Sites with SiteCheck and Robot

You use Rational SiteCheck to test the structural integrity of your intranet or World Wide Web site. SiteCheck is designed to help you view, track, and maintain your rapidly changing site.

Use SiteCheck to:
  • Visualize the structure of your Web site and display the relationship between each page and the rest of the site.

  • Identify and analyze Web pages with active content, such as forms, Java, JavaScript, ActiveX, and Visual Basic Script (VBScript).

  • Filter information so that you can inspect specific file types and defects, including broken links.

  • Examine and edit the source code for any Web page, with color-coded text.

  • Update and repair files using the integrated editor, or configure your favorite HTML editor to perform modifications to HTML files.

  • Perform comprehensive testing of secure Web sites. SiteCheck provides Secure Socket Layer (SSL) support, proxy server configuration, and support for multiple password realms.

Robot has two verification points for use with Web sites:


  1. Use the Web Site Scan verification point to check the content of your Web site with every revision and ensure that changes have not resulted in defects.

  2. Use the Web Site Compare verification point to capture a baseline of your Web site and compare it to the Web site at another point in time.

The following figures show the types of defects you can scan for using a Web Site verification point and the list of defects displayed in SiteCheck.




Monday, June 11, 2007

Creating Datapools

A datapool is a source of variable test data that scripts can draw from during playback.

If a script sends data to a server during playback, consider using a datapool as the source of the data. By accessing a datapool, a script transaction that is executed multiple times during playback can send realistic data and even unique data to the server each time. If you do not use a datapool, the same data (the exact data you recorded) is sent each time the transaction is executed.

TestManager is shipped with many commonly used data types, such as cities, states, names, and telephone area codes. In addition, TestManager lets you create your own data types.

When creating a datapool, you specify the kinds of data (called data types) that the script will send — for example, customer names, addresses, and unique order numbers or product names. When you finish defining the datapool, TestManager automatically generates the number of rows of data that you specify.

Analyzing Results in the Log and Comparators

You use TestManager to view the logs that are created when you run scripts and schedules.

Use the log to:

View the results of running a script,
including verification point failures, procedural failures, aborts, and any additional playback information. Reviewing the results in the log reveals whether each script and verification point passed or failed.

Use the Comparators
to:

Analyze the results of verification points
to determine why a script may have failed. Robot includes four Comparators:

- Object Properties Comparator
– Text Comparator
– Grid Comparator
– Image Comparator

When you select the line that contains the failed Object Properties verification point and click View > Verification Point, the Object Properties Comparator opens, as shown in the following figure. In the Comparator, the Baseline column shows the original recording, and the Actual column shows the playback that failed. Compare the two files to determine whether the difference is an intentional change in the application or a defect.

Wednesday, June 6, 2007

Developing Tests in Robot

You use Robot to develop two kinds of scripts: GUI scripts for functional testing and sessions for performance testing.

Use Robot to:
  • Perform full functional testing. Record and play back scripts that navigate through your application and test the state of objects through verification points.
  • Perform full performance testing. Use Rational Robot and Rational. TestManager together to record and play back sessions that help you determine whether a multiclient system is performing within user-defined standards under varying loads.
  • Create and edit scripts using the SQABasic and VU scripting environments. The Robot editor provides color-coded commands with keyword Help for powerful integrated programming during script development. (VU scripting is used with sessions in performance testing.)
  • Test applications developed with IDEs such as Java, HTML, Visual Basic, Oracle Forms, Delphi, and PowerBuilder. You can test objects even if they are not visible in the application’s interface.
  • Collect diagnostic information about an application during script playback. Robot is integrated with Rational Purify, Rational Quantify, and Rational PureCoverage. You can play back scripts under a diagnostic tool and see the results in the log.

The Object-Oriented Recording technology in Robot lets you generate scripts by simply running and using the application-under-test. Robot uses Object-Oriented Recording to identify objects by their internal object names, not by screen coordinates. If objects change locations or their text changes, Robot still finds them on playback.

The following figure shows the main Robot window after you have recorded a script.




The Object Testing technology in Robot lets you test any object in the application-under-test, including the object’s properties and data. You can test standard Windows objects and IDE-specific objects, whether they are visible in the interface or hidden.

In functional testing, Robot provides many types of verification points for testing the state of the objects in your application. For example, you use the Object Properties verification point to capture the properties of an object during recording, and to compare these properties during playback.
The following figure shows the Object Properties Verification Point dialog box.

Introduction to Rational Robot

What Is Rational Robot?

Rational Robot is a complete set of components for automating the testing of Microsoft Windows client/server and Internet applications running under Windows NT 4.0, Windows XP, Windows 2000, and Windows 98.

The main component of Robot lets you start recording tests in as few as two mouse clicks. After recording, Robot plays back the tests in a fraction of the time it would take to repeat the actions manually.
Other components of Robot are:

  • Rational Administrator – Use to create and manage Rational projects, which store your testing information.
  • Rational TestManager Log – Use to review and analyze test results.
  • Object Properties, Text, Grid, and Image Comparators – Use to view and analyze the results of verification point playback.
  • Rational SiteCheck – Use to manage Internet and intranet Web sites.

Managing Rational Projects with the Administrator

You use the Rational. Administrator to create and manage projects.

Rational projects store application testing information, such as scripts, verification points, queries, and defects. Each project consists of a database and several directories of files. All Rational Test components on your computer update and retrieve data from the same active project.

Projects help you organize your testing information and resources for easy tracking. Projects are created in the Rational Administrator, usually by someone with administrator privileges.

Use the Administrator to:

  • Create a project under configuration management.
  • Create a project outside of configuration management.
  • Connect to a project.
  • See projects that are not on your machine (register a project).
  • Delete a project.
  • Create and manage users and groups for a Rational Test datastore.
  • Create and manage projects containing Rational RequisitePro. projects and Rational Rose. models.
  • Manage security privileges for the entire Rational project.
  • Create a test datastore using SQL Anywhere.
  • Convert an existing Microsoft Access test datastore to a SQL Anywhere test datastore.

The following figure shows the main Rational Administrator window after you have created some projects:

Summary


When you create a test datastore, the Rational Administrator uses Microsoft Access for the default database engine. However, if more than one user will access the test datastore simultaneously, use Sybase SQL Anywhere for the database engine. To create a test datastore using SQL Anywhere software, click Advanced Database Setup in the Create Test Datastore dialog box. See the Rational Administrator online Help for more information.

You must install Sybase SQL Anywhere software and create a SQL Anywhere database server before you create a new SQL Anywhere test datastore or convert an existing Microsoft Access test datastore to a SQL Anywhere test datastore.