GUI Automation RFT

59
Rational Functional Tester (RFT)

Transcript of GUI Automation RFT

Page 1: GUI Automation RFT

Rational Functional Tester (RFT)

Page 2: GUI Automation RFT

Agenda

Introduction Datastore Enabling Environments Configuring Application for Testing Recording Automation Script Play Back Resources Data Driven – Data Pool

Page 3: GUI Automation RFT

Introducing RFT…

What it is… RFT is a GUI Testing application that is built

on Eclipse and uses Java as its testing language. It tests by replicating user input following a script written by the user.

Those that are familiar with WinRunner or RobotJ or XDE Tester will be Comfortable with this type of testing.

Page 4: GUI Automation RFT

Salient Features of RFT

RFT is Cross Platform capable

Scripts are in Java.

Object Oriented.

Recording - Creates scripts by its own against user’s actions on a Java or HTML application.

Uses Eclipse editor as IDE.

Page 5: GUI Automation RFT

Platform Support

Microsoft Windows Microsoft Windows XP Professional with Service Pack 1 or 2 Microsoft Windows 2000 Professional with Service Pack 4 Microsoft Windows 2000 Server with Service Pack 4 Microsoft Windows 2000 Advanced Server with Service Pack 4 Microsoft Windows Server 2003 Standard Edition with Service

Pack 1 Microsoft Windows Server 2003 Enterprise Edition with Service

Pack 1

Linux Red Hat Enterprise Linux Workstation Version 4.0 Red Hat Desktop Version 4.0 (running in 32-bit mode) SUSE Linux Enterprise Server (SLES) Version 9 (all service packs;

running in 32-bit mode)

Page 6: GUI Automation RFT

IDE Setup

Perspectives: Perspectives control what appears in certain

menus and toolbars. (e.g.: Java ,Test, Debug etc…)

Path :Main menu->Windows->Open Perspective

Page 7: GUI Automation RFT

RFT Default Window

Script ViewScript View

Menu BarMenu Bar

Functional Test

Scripts

Functional Test

Scripts

Script ViewScript View

Script ExplorerScript

Explorer

Task List, Console, ...Task List, Console, ...

Page 8: GUI Automation RFT

What are the major views (or windows )

Functional Test Project explorer Script editor Script explorer Task window Console window Debug view Play back window The “workbench”

Page 9: GUI Automation RFT

Functional Test Project

Page 10: GUI Automation RFT

Funtional Test Project -- Description

Basically a folder with files that holds:

Scripts RFT resources associated with the scripts Script templates Logs text and HTML Object maps Verification point files

Page 11: GUI Automation RFT

Functional Test Project properties windows

The Functional Test Project properties window is of great importance Setting the build path Including libraries and jar files required

Page 12: GUI Automation RFT

FT properties window

Page 13: GUI Automation RFT

Create or Connect to a Functional Test Project

File > New > Functional Test Project File > Connect to a Functional Test Project…

Page 14: GUI Automation RFT

Create a RFT Functional Test Project

Page 15: GUI Automation RFT

Enabling Environments

Page 16: GUI Automation RFT

Enabling Environments for Testing What are environments?

Environments specify where your application will run Each browser is considered an “environment” for running

HTML applications Browsers have plug-in environments (designated Java

runtime – JRE) for running Java applets JREs/JVMs/JDKs are environments for running Java

applications What is enabling?

Enabling provides information to RFT about the environment so it can set up how to communicate with the application during recording

Page 17: GUI Automation RFT

Enabling Environments for Testing

Target environments must be enabled prior to recording

Page 18: GUI Automation RFT

Enabling Environments – Web Browsers

Search Add … Remove Enable Disable Set as

Default

Page 19: GUI Automation RFT

Enabling Environments – Java Environments

RFT Tester JRE is automaticallyenabled and set as the default JRE

Search to add otherJRE’s (note: search takes a long time)

When setting up environments, specify the JRE the target application for testing is supposed to use Enable Set as Default

Page 20: GUI Automation RFT

Configuring Applications

Page 21: GUI Automation RFT

Configuring Applications for Testing

What is configuring an application in RFT? Configuring an application specifies runtime options

so that the application can be launched from RFT

Why is configuring necessary? The application under test must be configured in

order to launch the application during a RFT record session

Page 22: GUI Automation RFT

Configure Applications for Testing

Set up RFT Tester to run the target application

Page 23: GUI Automation RFT

Application Configuration Tool

Add Remove Run

Page 24: GUI Automation RFT

Add Application

Page 25: GUI Automation RFT

Add Application – Java, HTML or Executable

JAVA

HTMLLocal = HTMLURL = e.g. www.rational.com

Executableor Batch File

Page 26: GUI Automation RFT

Test Configuration Run application from Application Configuration Tool to

test the configuration

Page 27: GUI Automation RFT

Recording & Playback

Page 28: GUI Automation RFT

Recording Automation Script

Test application should be learnt for automation. Application can be learnt through recording. For Recording 1.Click the record button OR Click File->New->Functional Test script using recorder. 2.Launches script recorder window.

3.Choose the application to be recorded.4.Run the application.5.RFT records the application and generates an automation script.

Page 29: GUI Automation RFT

Recording Automation Script…

Page 30: GUI Automation RFT

Recording Automation Script…

File->New->XDE-Tester script using recorder.Clicking this will launch Script recorder window

Page 31: GUI Automation RFT

Recording Automation Script…

Start Application

Clicking the Start Application button launches the application window.

Page 32: GUI Automation RFT

Recording Automation Script…

Select an application from the application window. Start recording the application by clicking OK button.

Page 33: GUI Automation RFT

Recording Automation Script…

Stop Recording

RFT learns the actions performed over the application.Script Recorder Window shows recording details .Click stop button to end recording.Automation script is created

Page 34: GUI Automation RFT

PlaybackSelect the script and click the running man button.

Run

Page 35: GUI Automation RFT

Playback… Brings RFT Play

back monitor Script name Execution line

number Current line in

the script

Current line

Script name

Current line

Script name

Page 36: GUI Automation RFT

Associated Resources

Page 37: GUI Automation RFT

Associated resources

Test object maps Verification points Scripts Logs( After Playback)

Page 38: GUI Automation RFT

Test Object map

VP

Script

logs

Page 39: GUI Automation RFT

Test object Maps

The Functional Tester test object map lists the test objects in the application under test.

Test Object Maps store information about the objects of the application being tested

It is a static view that describes test objects known to Functional Tester in the application-under-test.

Page 40: GUI Automation RFT

Test object Maps…(Create)

While creating script Click next

brings up this window

Default is private

Click Finish

Page 41: GUI Automation RFT

Test object Maps…(Create)

On choosing shared Displays any existing

shared TOM Selecting from

display makes that as the TOM for this script

Page 42: GUI Automation RFT

Adding Test Objects…

Launch the application to be automated.

Open the TOM window by double clicking TOM icon in the tester script explorer.

Learn the object of interest using the Object finder.

Page 43: GUI Automation RFT

Adding Test Objects…

TOM

TOM window

Page 44: GUI Automation RFT

Adding Test Objects…

Select an object to learn

Page 45: GUI Automation RFT

RFT highlights the selected Test Object by a red box

Page 46: GUI Automation RFT

Adding Test Objects…

Page 47: GUI Automation RFT

Adding Test Objects…

Page 48: GUI Automation RFT

Adding Test Objects…

Page 49: GUI Automation RFT

Verification Points

Verification points verify the state of an object.

When you create a verification point, you are capturing information about an object in the application

To establish this as baseline information for comparison during playback.

Page 50: GUI Automation RFT

Create a VP

•Using RFT Tester Recorder action wizard

Page 51: GUI Automation RFT

Create a VP

Select object to verify

Page 52: GUI Automation RFT

Create a VP

Page 53: GUI Automation RFT

Logs

Text Html

Page 54: GUI Automation RFT

Data Pool :

A datapool is a test dataset, a collection of related data records which supplies data values to the variables in a test script during test script playback.

Page 55: GUI Automation RFT

Datapool Usage

To add realistic data to a test script To import data from a Functional Tester datapool, an

IBM Rational TestManager datapool, or a .csv file created using a spreadsheet application.

To create a datapool manually and add data to a datapool

To edit datapool values or change data types To export datapools to use in other Functional Test

projects or to a .csv file to edit in a spreadsheet application.

To change the datapool record selection order to determine how the test script accesses an associated datapool during playback.

Page 56: GUI Automation RFT

Functional Tester Command-Line Interface

java <standard java options> com.rational.test.ft.rational_ft <Functional Tester options>

Example : java -classpath "E:\Program Files\IBM\

SDP70\FunctionalTester\bin\rational_ft.jar;" com.rational.test.ft.rational_ft –datastore C:\RftTestScripts\Project1 -playback Script1

Page 57: GUI Automation RFT

Some CLI Options

-datastore <datastore directory> is needed whenever a script is specified, for example with -record or -playback.

-record <script name> to record a new script (or in conjunction with -insertafter <line number> to insert recording into an existing script).

-playback <script name> to play back a specific Java script.

Page 58: GUI Automation RFT

Hands - On

Sample Functional Test Script Recording Functional Test Script Functional Test Script using Data

Pool

Page 59: GUI Automation RFT

Help Resources

RFT Online Help Subscribe to [email protected]

and [email protected] for RFT related mails.